Skip to content

Commit 92158d5

Browse files
committed
Change the background animation
1 parent 388106e commit 92158d5

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

aoc-web/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn router(route: Route) -> Html {
6161
html! {
6262
<>
6363
<Header year={year} route={route} />
64-
<main>{ main }</main>
64+
<main class="fade-in">{ main }</main>
6565
</>
6666
}
6767
}

aoc-web/src/solution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn solution(props: &Props) -> Html {
5656
};
5757

5858
html! {
59-
<div>
59+
<div class="fade-in">
6060
<pre>
6161
<code>{ output.join("\n") }</code>
6262
</pre>

aoc-web/static/fragment.glsl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ void main() {
99
float snow = 0.0;
1010
for (int k = 0; k < 3; k++) {
1111
for (int i = 0; i < 8; i++) {
12-
float cellSize =
13-
2.0 + (float(i) * iResolution.x / 640.); // (float(i) * 3.);
12+
float cellSize = floor(2.0 + (float(i) * iResolution.x / 800.));
1413
float downSpeed =
15-
0.3 + (sin(iTime * 0.4 + float(k + i * 20)) + 1.0) * 0.00008;
14+
0.2 + (sin(iTime * 0.4 + float(k + i * 20)) + 1.0) * 0.00008;
1615
vec2 uv = (gl_FragCoord.xy / iResolution.x) +
1716
vec2(0.01 * sin((iTime + float(k * 6185)) * 0.6 + float(i)) *
1817
(5.0 / float(i)),
@@ -39,7 +38,7 @@ void main() {
3938

4039
float omiVal =
4140
fract(sin(dot(uvStep.xy, vec2(32.4691, 94.615))) * 31572.1684);
42-
if (omiVal < 0.08 ? true : false) {
41+
if (omiVal < 0.15) {
4342
float newd =
4443
(x + 1.0) * 0.4 *
4544
clamp(1.9 - d * (15.0 + (x * 6.3)) * (cellSize / 1.4), 0.0, 1.0);

aoc-web/static/styles.css

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Mostly borrowed from https://adventofcode.com/ to get the same look */
1+
/* Base theme borrowed from https://adventofcode.com/ to get the same look */
22

33
html,
44
body {
@@ -178,12 +178,6 @@ footer {
178178
transform: rotateX(-90deg) translateZ(120px);
179179
}
180180

181-
main {
182-
opacity: 0;
183-
animation: fadeInAnimation ease-in 400ms;
184-
animation-fill-mode: forwards;
185-
}
186-
187181
@keyframes fadeInAnimation {
188182
0% {
189183
opacity: 0;
@@ -217,11 +211,17 @@ code:before {
217211

218212
.highlighted pre {
219213
font-size: 10pt;
220-
display: inline-block;
214+
max-width: 900px;
221215
margin: 0;
222216
padding: 1rem;
223217
opacity: 90%;
224218
overflow-x: scroll;
225219
background: #10101a !important;
226220
border: 1px solid #333340;
227221
}
222+
223+
.fade-in {
224+
opacity: 0;
225+
animation: fadeInAnimation ease-in 400ms;
226+
animation-fill-mode: forwards;
227+
}

0 commit comments

Comments
 (0)