-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.vue
More file actions
145 lines (121 loc) · 2.82 KB
/
app.vue
File metadata and controls
145 lines (121 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<script setup lang="ts">
import "@fontsource-variable/jetbrains-mono"
import "~/assets/globals.scss"
const router = useRouter()
router.beforeEach(async (to, from, next) => {
await artificialDelay(250)
next()
})
const enablePixelate = ref(true)
const pixelateFactorPre = ref(0.35)
const pixelateFactorPost = ref(0.25)
const delayToggle = enableArtificialDelay
</script>
<template>
<div class="center">
<div
class="aspect-container"
:style="{ filter: enablePixelate ? 'url(#pixelate)' : '' }"
>
<NuxtPage />
<BottomBar />
</div>
<div class="controls">
<label>
<input v-model="delayToggle" type="checkbox" />
Artificial delay
</label>
<label>
<input v-model="enablePixelate" type="checkbox" />
Pixelate
</label>
<label>
<input v-model="pixelateFactorPre" type="range" min="0" max="1" step="0.01" />
Pixelate factor pre ({{ pixelateFactorPre }})
</label>
<label>
<input v-model="pixelateFactorPost" type="range" min="0" max="1" step="0.01" />
Pixelate factor post ({{ pixelateFactorPost }})
</label>
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="0" height="0">
<defs>
<filter id="pixelate" x="0" y="0">
<feFlood
x="2"
y="2"
:height="1 * pixelateFactorPre"
:width="1 * pixelateFactorPre"
/>
<feComposite :width="5 * pixelateFactorPre" :height="5 * pixelateFactorPre" />
<feTile result="a" />
<feComposite in="SourceGraphic" in2="a" operator="in" />
<feMorphology operator="dilate" :radius="2.5 * pixelateFactorPost" />
</filter>
</defs>
</svg>
</template>
<style lang="scss">
#__nuxt {
background: hsl(0deg 0% 20%);
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.aspect-container {
position: relative;
background: var(--background);
--height: min(600px, 95vh, calc(95vw / 4 * 3));
--width: calc(var(--height) * 4 / 3);
height: var(--height);
width: var(--width);
aspect-ratio: 4 / 3;
font-size: calc(var(--height) / 20);
text-shadow:
1px 1px 2px black,
1px 1px 2px black;
font-weight: 400;
font-family: "JetBrains Mono Variable", cursive;
display: flex;
align-items: center;
flex-direction: column;
// overflow: hidden;
-webkit-font-smoothing: none;
}
main {
position: relative;
flex-grow: 1;
max-height: 100%;
width: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
h1 {
color: var(--accent-orange);
margin: 0.5em 0;
margin-bottom: 1em;
text-shadow: none;
font-weight: 300;
text-transform: uppercase;
}
h2 {
color: var(--accent-orange);
padding: 0.1em 0.5em;
text-shadow: none;
font-weight: 250;
text-transform: uppercase;
font-size: 1.25em;
border-bottom: 2px solid var(--accent-orange);
}
a {
text-decoration: none;
}
.controls {
display: flex;
flex-direction: column;
width: 100%;
}
</style>