Skip to content

Commit 5aecbff

Browse files
committed
allow svgs and links to display properly without js
1 parent eba7e2b commit 5aecbff

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

assets/css/year-in-review.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ html {
3535
}
3636
}
3737

38+
a {
39+
color: white;
40+
}
41+
3842
.YIR-wrapper {
3943
color: white;
4044
min-height: 100vh;

layouts/_default/year-in-review.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ <h1>Heat metrics</h1>
230230
</div>
231231

232232
<div class="metric-wrapper">
233-
<svg class="fire-svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
233+
<svg class="fire-svg in-view" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
234234
width='220px' height ='220px' viewBox="-1 -1 38 38" xml:space="preserve" >
235235
<path class="fire-st0" d="M35,19c0-2.1-0.4-4-1-5.9c-0.5,5.4-3.3,8.2-6.3,6.9c-2.8-1.2-0.9-5.9-0.8-8.2c0.2-3.8,0-8.2-6.9-11.8
236236
c2.9,5.5,0.3,8.9-2.3,9.1c-3,0.2-5.7-2.5-4.7-7c-3.2,2.4-3.3,6.4-2.3,9c1,2.7,0,5-2.6,5.2c-2.8,0.3-4.4-3-3-8.3c-2.5,3-4,6.8-4,11
@@ -269,7 +269,7 @@ <h1>Light metrics</h1>
269269
</div>
270270

271271
<div class="metric-wrapper">
272-
<svg class="sun-svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
272+
<svg class="sun-svg in-view" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
273273
width='220px' height ='220px' viewBox="-1 -1 38 38" xml:space="preserve">
274274
<path class="sun-st0" d="M8,18a10,10 0 1,0 20,0a10,10 0 1,0 -20,0"/>
275275
<path class="sun-st1" d="M16,2c0,0,0-2,2-2s2,2,2,2v2c0,0,0,2-2,2s-2-2-2-2V2z"/>
@@ -311,7 +311,7 @@ <h1>Love metrics</h1>
311311
</div>
312312

313313
<div class="metric-wrapper">
314-
<svg class="heart-svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
314+
<svg class="heart-svg in-view" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
315315
width='220px' height ='220px' viewBox="-1 -1 38 38" xml:space="preserve">
316316
<path class="heart-st0" d="M31.6,22.9c2-2.8,3.5-5.8,4-8.8c0.2-0.7,0.3-1.5,0.3-2.2C35.9,6.4,31.5,2,26,2c-3.3,0-6.2,1.6-8,4.1
317317
C16.2,3.6,13.3,2,10,2c-5.4,0-9.9,4.4-9.9,9.9c0,0.8,0.1,1.5,0.3,2.2C1.8,22.6,11.2,31.6,18,34c2.6-0.9,5.6-2.8,8.4-5.3"/>

static/js/year-in-review.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ observer = new IntersectionObserver((entries) => {
1919
});
2020
}, config);
2121
document.querySelectorAll('.YIR-wrapper svg').forEach(image => {
22+
image.classList.remove('in-view');
2223
observer.observe(image);
2324
});
2425

0 commit comments

Comments
 (0)