-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
137 lines (119 loc) · 2.58 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
132
133
134
135
136
137
@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");
:root {
--left-bg-color: rgba(87, 84, 236, 0.7);
--right-bg-color: rgba(43, 43, 43, 0.8);
--left-btn-hover-color: rgba(87, 84, 236, 1);
--right-btn-hover-color: rgba(28, 122, 28, 1);
--hover-width: 80%;
--other-width: 20%;
--speed: 1s;
}
* {
box-sizing: border-box;
}
body {
font-family: "Roboto", sans-serif;
height: 100vh;
overflow: hidden;
margin: 0;
}
h1 {
font-size: 4rem;
color: #fff;
position: absolute;
left: 50%;
top: 20%;
transform: translateX(-50%);
white-space: nowrap;
}
.btn {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
left: 50%;
top: 40%;
transform: translateX(-50%);
text-decoration: none;
color: #fff;
border: #fff solid 0.2rem;
font-size: 1rem;
font-weight: bold;
text-transform: uppercase;
width: 15rem;
padding: 1.5rem;
}
.split.left .btn:hover {
background-color: var(--left-btn-hover-color);
border-color: var(--left-btn-hover-color);
}
.split.right .btn:hover {
background-color: var(--right-btn-hover-color);
border-color: var(--right-btn-hover-color);
}
.container {
position: relative;
width: 100%;
height: 100%;
background-color: #333;
}
.split {
position: absolute;
width: 50%;
height: 100%;
overflow: hidden;
transition: var(--speed) ease;
}
.split.left {
left: 0;
background: url("https://images.unsplash.com/photo-1635048438162-7a31e9648949?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=327&q=80");
background-repeat: no-repeat;
background-size: cover;
}
.split.left::before {
content: "";
position: absolute;
width: 100%;
height: 100%;
background-color: var(--left-bg-color);
}
.split.right {
right: 0;
background: url("https://images.unsplash.com/photo-1621259181233-aa03cf592ea7?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=429&q=80");
background-repeat: no-repeat;
background-size: cover;
}
.split.left::before,
.split.right::before {
content: "";
position: absolute;
width: 100%;
height: 100%;
}
.split.left::before {
background-color: var(--left-bg-color);
}
.split.right::before {
background-color: var(--right-bg-color);
}
.hover-left .left {
width: var(--hover-width);
}
.hover-left .right {
width: var(--other-width);
}
.hover-right .right {
width: var(--hover-width);
}
.hover-right .left {
width: var(--other-width);
}
@media screen and (max-width: 800px) {
h1 {
font-size: 2rem;
}
.btn {
padding: 1.2rem;
width: 12rem;
}
}