-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstriped-slider.html
140 lines (126 loc) · 3.64 KB
/
striped-slider.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Flexbox Striped Slider</title>
<style>
body {
font: normal 18px/1.5 "Helvetica Neue", sans-serif;
margin: 0;
padding: 0;
}
.flex-wrapper {
height: 100vh;
display: flex;
}
.flex-wrapper a {
position: relative;
flex: 1;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
text-align: center;
text-decoration: none;
color: #fff;
transition: flex .4s;
}
.flex-wrapper a:hover {
flex: 4;
}
.flex-wrapper .one {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-001.jpg);
background-color: red;
}
.flex-wrapper .two {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-002.jpg);
background-color: green;
}
.flex-wrapper .three {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-003.jpg);
background-color: steelblue;
}
.flex-wrapper .four {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-004.jpg);
background-color: orange;
}
.flex-wrapper .five {
background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/nav-005.jpg);
background-color: tomato;
}
.flex-wrapper .overlay {
display: flex;
width: 100%;
height: 100%;
padding: 0 30px;
box-sizing: border-box;
align-items: center;
justify-content: center;
transition: background-color .4s;
}
.flex-wrapper a:hover .overlay {
background-color: rgba(0, 0, 0, .5);
}
.flex-wrapper .overlay-inner * {
visibility: hidden;
opacity: 0;
transform-style: preserve-3d;
}
.flex-wrapper .overlay h2 {
transform: translate3d(0, -60px, 0);
}
.flex-wrapper .overlay p {
transform: translate3d(0, 60px, 0);
}
.flex-wrapper a:hover .overlay-inner * {
opacity: 1;
visibility: visible;
transform: none;
transition: all .3s .3s;
}
</style>
</head>
<body>
<div class="flex-wrapper">
<a href="" class="one">
<div class="overlay">
<div class="overlay-inner">
<h2>Title #1</h2>
<p>Fusce vulputate orci at nulla consequat, ac tincidunt quam ultrices 2.</p>
</div>
</div>
</a>
<a href="" class="two">
<div class="overlay">
<div class="overlay-inner">
<h2>Title #2</h2>
<p>Quisque facilisis enim eu mi condimentum, id interdum diam pharetra.</p>
</div>
</div>
</a>
<a href="" class="three">
<div class="overlay">
<div class="overlay-inner">
<h2>Title #3</h2>
<p>Donec laoreet enim sed risus suscipit, rutrum egestas ligula tristique.</p>
</div>
</div>
</a>
<a href="" class="four">
<div class="overlay">
<div class="overlay-inner">
<h2>Title #4</h2>
<p>Etiam porta, enim non vulputate consectetur, neque lectus finibus erat, eu. </p>
</div>
</div>
</a>
<a href="" class="five">
<div class="overlay">
<div class="overlay-inner">
<h2>Title #5</h2>
<p>Cras nunc augue, egestas sed maximus non, consectetur in nunc.</p>
</div>
</div>
</a>
</div>
</body>
</html>