Skip to content

Commit e6efa2d

Browse files
committed
style: 💄 add style on hover
1 parent 5bb6031 commit e6efa2d

File tree

2 files changed

+40
-17
lines changed

2 files changed

+40
-17
lines changed

Diff for: ‎site/static/js/cloud.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
});
4242
var radius = Math.random();
4343

44-
var wSpan = $("<span>").addClass("word w" + word.weight).append(word.text);
44+
var wSpan = $("<span>").addClass("word w" + word.weight).append($("<span>").addClass("word-text").text(word.text));
4545

4646
$this.append(wSpan);
4747

@@ -79,7 +79,7 @@
7979
drawTag(word_array[i]);
8080
setTimeout(() => {
8181
runWord(i + 1);
82-
}, 150);
82+
}, 50);
8383
} else {
8484
setTimeout(() => {
8585
runWord(i);

Diff for: ‎src/css/_cloud.scss

+38-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
section#cloud{
1+
section#cloud {
22
background: $darkGradient;
33
color: $white;
44

5-
.wrapper{
5+
.wrapper {
66
margin: auto;
77
width: 960px;
88
max-width: 100%;
9-
padding:30px;
9+
padding: 30px;
1010

1111
.cloud {
12-
position: relative;
13-
@media screen and (max-width: 767px) {
14-
width: 315px;
15-
height: 500px;
16-
}
17-
min-height: 300px;
12+
position: relative;
13+
@media screen and (max-width: 767px) {
14+
width: 315px;
15+
height: 500px;
16+
}
17+
min-height: 300px;
1818
}
1919
}
2020

@@ -23,19 +23,43 @@ section#cloud{
2323
}
2424

2525
.word {
26-
transition: all 1s ease;
26+
color: var(--word-color);
27+
position: relative;
28+
29+
&::before {
30+
content: "";
31+
position: absolute;
32+
bottom: 0;
33+
left: 0;
34+
width: 100%;
35+
height: 0;
36+
background-color: var(--bg-word-color);
37+
transition: height 0.7s ease;
38+
}
39+
40+
&:hover {
41+
&::before {
42+
height: 100%;
43+
}
44+
.word-text {
45+
mix-blend-mode: difference;
46+
}
47+
}
2748
}
2849

2950
.w10 {
30-
color: $sandyBrown;
51+
--word-color: #{$sandyBrown};
52+
--bg-word-color: #{$sandyBrown};
3153
font-size: 1.6rem;
3254
}
3355
.w9 {
34-
color: $nyanza;
56+
--word-color: #{$nyanza};
57+
--bg-word-color: #{$nyanza};
3558
font-size: 1.5rem;
3659
}
3760
.w8 {
38-
color: $periwinki;
61+
--word-color: #{$periwinki};
62+
--bg-word-color: #{$periwinki};
3963
font-size: 1.4rem;
4064
}
4165
.w7 {
@@ -59,5 +83,4 @@ section#cloud{
5983
.w1 {
6084
font-size: 0.7rem;
6185
}
62-
63-
}
86+
}

0 commit comments

Comments
 (0)