Skip to content

Commit cee8ac3

Browse files
committed
make external-links respect prefers-reduced-motion
1 parent a5d57e0 commit cee8ac3

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

assets/css/components/_external-link.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323
gap: var(--spacing-sm);
2424
position: relative;
2525
overflow: hidden;
26-
transition:
27-
transform 0.3s ease,
28-
box-shadow 0.3s ease,
29-
color 0.3s ease;
30-
animation: slideInFromLeft 0.5s 0.4s var(--transition-timing) both;
26+
27+
&.animated {
28+
transition:
29+
transform 0.3s ease,
30+
box-shadow 0.3s ease,
31+
color 0.3s ease;
32+
animation: slideInFromLeft 0.5s 0.4s var(--transition-timing) both;
33+
}
3134

3235
&::after {
3336
/* Shimmer effect */

layouts/posts/single.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ <h1 class="animated title">{{ .Title }}</h1>
1919
{{- if or .Params.github .Params.colab .Params.codepen .Params.wikipedia .Params.link }}
2020
<div class="external-link-row">
2121
{{- if .Params.github }}
22-
<a class="external-link" href="{{ .Params.github }}">
22+
<a class="external-link animated" href="{{ .Params.github }}">
2323
<img src="/media/icons/github.svg" alt="GitHub icon" />
2424
<span>GitHub Repo</span>
2525
</a>
2626
{{ end }}
2727
{{- if .Params.colab }}
28-
<a class="external-link" href="{{ .Params.colab }}">
28+
<a class="external-link animated" href="{{ .Params.colab }}">
2929
<img src="/media/icons/colab.svg" alt="Google Colab icon" />
3030
<span>Colab Notebook</span>
3131
</a>
3232
{{ end }}
3333
{{- if .Params.codepen }}
34-
<a class="external-link" href="{{ .Params.codepen }}">
34+
<a class="external-link animated" href="{{ .Params.codepen }}">
3535
<img src="/media/icons/codepen.svg" alt="CodePen icon" />
3636
<span>CodePen</span>
3737
</a>
3838
{{ end }}
3939
{{- if .Params.wikipedia }}
40-
<a class="external-link" href="{{ .Params.wikipedia }}">
40+
<a class="external-link animated" href="{{ .Params.wikipedia }}">
4141
<img src="/media/icons/wikipedia.svg" alt="Wikipedia icon" />
4242
<span>Wikipedia Article</span>
4343
</a>
4444
{{ end }}
4545
{{- if .Params.webpage }}
46-
<a class="external-link" href="{{ .Params.webpage }}">
46+
<a class="external-link animated" href="{{ .Params.webpage }}">
4747
<img src="/media/icons/webpage.svg" alt="web icon" />
4848
<span>Webpage</span>
4949
</a>

0 commit comments

Comments
 (0)