-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
53 lines (46 loc) · 1.14 KB
/
style.css
File metadata and controls
53 lines (46 loc) · 1.14 KB
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
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap");
* {
box-sizing: border-box;
}
body {
background-color: #efedd696;
font-family: "Roboto", sans-serif;
display: flex;
/* flex here aligns the content to the centre of the window */
flex-direction: column;
align-items: center;
justify-content: center;
margin: 0;
overflow-x: hidden;
}
h1 {
margin: 10px;
}
.box {
background-color: steelblue;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
width: 400px;
height: 200px;
margin: 10px;
border-radius: 10px;
box-shadow: 2px 4px 5px rgba(0, 0, 0, 0.3);
/* the transform moves the content box off screen
400% is large enough for even large screen sizes */
transform: translateX(400%);
/* changed ease from 0.4 to 0.8 as looked a bit too quick */
transition: transform 0.8s ease;
}
.box:nth-of-type(even) {
/* this moves every other content box to the opposite side */
transform: translateX(-400%);
}
.box.show {
/* the .show class moves the content box to default position - 0 */
transform: translateX(0);
}
.box h2 {
font-size: 45px;
}