-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathText-Hover.css
79 lines (68 loc) · 1.31 KB
/
Text-Hover.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
@import url('https://fonts.googleapis.com/css?family=Poppins');
#text-hover{
margin: 0;
padding: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Poppins', sans-serif;
}
h1{
margin: 0;
padding: 0;
font-size: 10em;
line-height: 0.8em;
}
h1 span{
position: relative;
text-transform: uppercase;
display: block;
}
h1 span:nth-child(1)::before{
content: '';
position: absolute;
top: calc(50% - 15px);
right: 0;
width: 48%;
height: 30px;
background: #f00;
transform-origin: right;
transform: scaleX(0);
transition: 0.5s;
z-index: 1 ;
}
h1:hover span:nth-child(1)::before{
transform: scaleX(1);
}
h1 span:nth-child(2)::before{
content: '';
position: absolute;
top: calc(50% - 15px);
left: 0;
width: 50%;
height: 30px;
background: #f00;
transform-origin: left;
transform: scaleX(0);
transition: 0.5s;
z-index: 1 ;
}
h1:hover span:nth-child(2)::before{
transform: scaleX(1);
}
h1 span hide{
transition: 0.5s;
transition-delay: 0.5s;
}
h1:hover span hide{
color: #f00;
transition-delay: 0.5s;
opacity: 0;
}
h1:hover span:nth-child(1) hide{
padding-right: 30px;
}
h1:hover span:nth-child(2) hide{
padding-right: 40px;
}