-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
57 lines (42 loc) · 2.26 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="keyword" content="">
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hover effects</title>
<style>
.container {position: absolute; top:15vh; left: 50%; transform: translateX(-50%); width: 80vw; text-align: center;}
.container a {display: block; position: relative; overflow: hidden; z-index: 1; margin:0 25vw; height:100%;}
.img-wrap {transition:transform 0.65s cubic-bezier(0.22, 0.9, 0.5, 1), opacity 0.65s cubic-bezier(0.5, 0, 0, 1); overflow: hidden; z-index: 1;}
.img-wrap img {width:100%; transition:transform 0.65s cubic-bezier(0.22, 0.9, 0.5, 1);}
.inner-text, .outer-text {position: absolute; font-size:80px; text-transform: uppercase; transition:transform 0.65s cubic-bezier(0.22, 0.9, 0.5, 1), opacity 0.65s cubic-bezier(0.5, 0, 0, 1); }
.inner-text {display: flex; align-items: center; justify-content: center; width:100%; height:100%; overflow: hidden; z-index: 1; color:#fff; white-space:nowrap;}
.inner-text span {transition:transform 0.65s cubic-bezier(0.22, 0.9, 0.5, 1)}
.outer-text {display: flex; align-items: center; justify-content: center; height: 100%; left:0; top:0; width:100%; transition: opacity 0.65s cubic-bezier(0.5, 0, 0, 1);}
/* hover */
.container a:hover .img-wrap, .container a:hover .inner-text {transform: scale(0.9075);}
.container a:hover .img-wrap > img {transform: scale(1.2);}
.container a:hover .inner-text > span {transform: scale(1.1);}
</style>
</head>
<body>
<main>
<div class="container">
<a href="#0">
<div class="inner-text">
<span>save the polar bear.</span>
</div>
<div class="img-wrap">
<img src="https://images.unsplash.com/photo-1589656966895-2f33e7653819?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80" alt="" srcset="">
</div>
</a>
<div class="outer-text">
<span>save the polar bear.</span>
</div>
</div>
</main>
</body>
</html>