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>
<div>
<main
class="h-[100vh] items-center justify-center p-5 flex flex-col space-y-4 bg-[#fa86c4]"
>
<NuxtRouteAnnouncer />
<p>Ok</p>
</div>
<h1
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>