-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfinite.css
74 lines (65 loc) · 1.17 KB
/
infinite.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
/* Add these styles to your existing CSS file or create a new one and link it to your HTML file */
.slider {
height: 250px;
margin: auto;
position: relative;
width: 90%;
display: grid;
place-items: center;
overflow: hidden;
margin-top: 40px;
border: 2px solid #e5e5e5;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.slide-track {
display: flex;
width: calc(250px * 18);
animation: scroll 40s linear infinite;
}
.slide {
height: 200px;
width: 250px;
display: flex;
align-items: center;
padding: 15px;
perspective: 100px;
}
.slider img {
width: 100%;
transition: transform 1s;
}
.slider img:hover {
transform: translateZ(20px);
}
.slider::before,
.slider::after {
background: linear-gradient(
to right,
rgba(255, 245, 225, 1) 0%,
rgba(255, 245, 225, 1) 0%
);
content: "";
height: 100%;
position: absolute;
width: 5%;
z-index: 2;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.slider::before {
left: 0;
top: 0;
}
.slider::after {
right: 0;
top: 0;
}
/* animation auto scroll */
@keyframes scroll {
0% {
transform: translateX(0);
}
100% {
transform: translateX(calc(-250px * 9));
}
}