Skip to content

Commit 1c209dc

Browse files
committed
Use smooth transitions for hover effects
1 parent 68e1b49 commit 1c209dc

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

components/BlogEntry/BlogEntry.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
background-size: 200% 100%;
1616
background-position-x: 100%;
1717
background-repeat: no-repeat;
18-
transition-property: background-position-x;
19-
transition-duration: .1s;
20-
transition-timing-function: steps(3);
2118
}
2219
& span:last-of-type {
2320
text-decoration: underline;
2421
}
22+
& span {
23+
transition: background-position-x .15s, font-weight .15s, color .15s;
24+
}
2525

2626
&:hover, &:focus-visible {
2727
font-weight: 600;

components/ButtonLink/ButtonLink.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
text-decoration: underline;
1010
cursor: pointer;
1111
border-radius: .2em;
12+
transition: transform .15s;
1213

1314
&:focus-visible {
1415
outline: var(--focus-ring);
1516
outline-offset: .2em;
1617
}
18+
&:hover, &:focus-visible {
19+
transform: translateY(-.05em);
20+
}
1721
}

components/DesignWork/DesignWork.module.scss

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
align-items: center;
55
text-decoration: none;
66
position: relative;
7+
transition: font-weight .15s, color .15s;
78

89
&::after {
910
content: '';
1011
position: absolute;
1112
inset: 0;
12-
display: none;
13+
display: block;
1314
background: rgba(0 0 0 / .6);
15+
opacity: 0;
16+
transition: opacity .15s;
1417
}
1518

1619
span {
@@ -21,22 +24,26 @@
2124
svg {
2225
height: 3.5em;
2326
width: 3.5em;
27+
stroke-width: 4;
28+
transition: stroke-width .15s;
2429
}
2530

2631
span, svg {
2732
position: relative;
2833
z-index: 1;
29-
stroke-width: 4;
3034
}
3135

3236
img {
3337
position: absolute;
3438
inset: 0;
3539
object-fit: cover;
36-
display: none;
40+
display: block;
3741
background-color: var(--background);
3842
height: 100%;
3943
width: 100%;
44+
opacity: 0;
45+
transform: translateX(-.3em);
46+
transition: opacity .15s, transform .15s;
4047
}
4148

4249
&:hover, &:focus-visible {
@@ -45,13 +52,14 @@
4552
outline: none;
4653

4754
img {
48-
display: block;
55+
opacity: 1;
56+
transform: translateX(0);
4957
}
5058
svg {
5159
stroke-width: 7;
5260
}
5361
&::after {
54-
display: block;
62+
opacity: 1;
5563
}
5664
}
5765
}

components/Project/Project.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.project {
22
text-decoration: none;
3+
transition: transform .15s;
34

45
img {
56
border-radius: 1em;

0 commit comments

Comments
 (0)