Add retro overlay

This commit is contained in:
Jordan Goulder 2025-01-12 23:28:14 -05:00
parent fd8d3831a1
commit 0335b34ed9
7 changed files with 54 additions and 21 deletions

BIN
resources/lines.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

BIN
resources/lines.xcf Normal file

Binary file not shown.

View File

@ -5,6 +5,7 @@ import SiteHeader from '@/components/SiteHeader.vue'
import HomeView from '@/components/HomeView.vue'
import NotFoundView from '@/components/NotFoundView.vue'
import PlaygroundView from '@/components/PlaygroundView.vue'
import RetroScreenOverlay from '@/components/RetroScreenOverlay.vue'
const routes: { [index: string]: Component } = {
'/': HomeView,
@ -19,6 +20,7 @@ window.addEventListener('hashchange', () => {
</script>
<template>
<RetroScreenOverlay />
<SiteHeader />
<main>
<component :is="routes[currentPath.slice(1) || '/'] || NotFoundView" />

View File

@ -1,9 +1,11 @@
<script lang="ts" setup>
import SiteHeader from '@/components/SiteHeader.vue'
import NotFoundView from '@/components/NotFoundView.vue'
import RetroScreenOverlay from '@/components/RetroScreenOverlay.vue'
</script>
<template>
<RetroScreenOverlay />
<SiteHeader />
<main>
<NotFoundView />

BIN
src/assets/lines.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

View File

@ -18,6 +18,8 @@ body {
button {
font-family: 'Courier New', monospace;
font-weight: bold;
font-size: 1.1em;
margin: 0.5em 0;
padding: 0.5em 0.75em;
}

View File

@ -0,0 +1,27 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue'
const isActive = ref(false)
onMounted(() => {
isActive.value = !window.matchMedia('(prefers-contrast: more)').matches
})
</script>
<template>
<div :class="{ lines: isActive }"></div>
</template>
<style scoped>
.lines {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url('../assets/lines.png') transparent;
opacity: 0.25;
z-index: 99;
pointer-events: none;
}
</style>