Skip to content

Commit

Permalink
feat: add noise animation to background image
Browse files Browse the repository at this point in the history
  • Loading branch information
k-urtica committed Sep 3, 2024
1 parent 2bb82db commit b5f5628
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/app.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
<script setup lang="ts"></script>

<template>
<main class="min-h-dvh">
<main class="cover min-h-dvh">
<img src="@/assets/bg.webp" class="fixed inset-0 size-full object-cover">
<div class="fixed inset-0 size-full bg-gradient-to-b from-[rgb(0_0_0/0.08)] to-[rgb(0_0_0/0.35)]" />
<NuxtPage />
</main>
</template>

<style scoped>
.cover::after {
content: '';
position: fixed;
inset: 0;
opacity: 0.04;
pointer-events: none;
background-image: url('/noise.webp');
animation: noise-anim 1s steps(7) infinite;
}
@keyframes noise-anim {
0% {
background-position: 0 0;
}
100% {
background-position: 140px 140px;
}
}
</style>
Binary file added src/public/noise.webp
Binary file not shown.

0 comments on commit b5f5628

Please sign in to comment.