feat: display random image on refresh

This commit is contained in:
Pihkaal
2024-10-17 19:14:04 +02:00
parent 6d4abf757e
commit 19996aeff2
32 changed files with 982 additions and 84 deletions

27
app.vue
View File

@@ -1,7 +1,28 @@
<script setup lang="ts">
import { resolve } from "path";
import { readdir } from "fs/promises";
const images = await readdir(resolve("public", "lilou"));
const image = images[Math.floor(Math.random() * images.length)];
const imagePath = `/lilou/${image}`;
</script>
<template> <template>
<div> <main
class="h-[100vh] items-center justify-center p-5 flex flex-col space-y-4 bg-[#fa86c4]"
>
<NuxtRouteAnnouncer /> <NuxtRouteAnnouncer />
<p>Ok</p> <h1
</div> class="text-4xl md:text-5xl lg:text-6xl font-serif text-white dark:text-white"
>
Lilou
</h1>
<img class="w-full max-w-[50vh]" :src="imagePath" alt="Lilou" />
<h1
class="text-4xl md:text-5xl lg:text-6xl font-serif text-white dark:text-white"
>
Lilou
</h1>
</main>
</template> </template>

View File

@@ -2,5 +2,5 @@
export default defineNuxtConfig({ export default defineNuxtConfig({
compatibilityDate: "2024-04-03", compatibilityDate: "2024-04-03",
devtools: { enabled: true }, devtools: { enabled: true },
modules: ["@nuxt/eslint"], modules: ["@nuxt/eslint", "@nuxtjs/tailwindcss"],
}); });

View File

@@ -12,9 +12,13 @@
}, },
"dependencies": { "dependencies": {
"@nuxt/eslint": "^0.6.0", "@nuxt/eslint": "^0.6.0",
"@nuxtjs/tailwindcss": "^6.12.2",
"nuxt": "^3.13.0", "nuxt": "^3.13.0",
"vue": "latest", "vue": "latest",
"vue-router": "latest" "vue-router": "latest"
}, },
"packageManager": "pnpm@9.11.0" "packageManager": "pnpm@9.11.0",
"devDependencies": {
"typescript": "5.5.4"
}
} }

1031
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB