-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
131 lines (112 loc) · 2.6 KB
/
style.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
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
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--image-comparison-slider-width: min(80vw, 768px);
--image-comparison-slider-handle-width: 50px;
}
body {
font-family: Helvetica, sans-serif;
width: 100%;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
#image-comparison-slider {
position: relative;
width: var(--image-comparison-slider-width);
overflow: hidden;
border-radius: 0.5rem;
box-shadow: -7px 5px 16px 1px rgba(56, 86, 122, 0.6);
cursor: col-resize;
}
#image-comparison-slider img {
display: block;
width: var(--image-comparison-slider-width);
height: auto;
max-height: 80vh;
object-fit: cover;
pointer-events: none;
user-select: none;
}
#image-comparison-slider .img-wrapper {
position: absolute;
top: 0;
right: 0;
width: 50%;
height: 100%;
overflow: hidden;
z-index: 1;
transform: translateZ(0); /* This is in order to fix a Firefox bug, related to the 3D tilt effect */
transition: 0.25s cubic-bezier(.03,.98,.52,.99);
/* transition: 0.25s ease; */
}
#image-comparison-slider .img-wrapper img {
position: absolute;
top: 0;
right: 0;
height: 100%;
}
#image-comparison-slider .label {
position: absolute;
top: 1rem;
z-index: 3;
color: #fff;
background-color: rgba(0, 0, 0, 0.33);
border-radius: 0.25rem;
padding: 0.5rem 0.75rem;
font-size: 0.85rem;
text-align: center;
letter-spacing: 1px;
user-select: none;
opacity: 0;
transition: 0.25s cubic-bezier(.68,.26,.58,1.22);
}
#image-comparison-slider:hover .label {
opacity: 1;
}
#image-comparison-slider .label.label-before {
left: 1rem;
}
#image-comparison-slider .label.label-after {
right: 1rem;
/* background-color: #f95540; */
}
#image-comparison-slider .handle {
position: absolute;
top: 0;
left: calc(50% - var(--image-comparison-slider-handle-width)/2);
width: var(--image-comparison-slider-handle-width);
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
user-select: none;
z-index: 2;
transition: 0.25s cubic-bezier(.03,.98,.52,.99);
}
#image-comparison-slider .handle-line {
width: 2px;
flex-grow: 1;
background-color: #fff;
}
#image-comparison-slider .handle-circle {
width: var(--image-comparison-slider-handle-width);
height: var(--image-comparison-slider-handle-width);
color: #fff;
border: 2px solid #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: space-evenly;
/* background-color: rgba(0,0,0,0.5); */
}
@media (max-width: 768px) {
:root {
--image-comparison-slider-width: 90vw;
}
}