forked from jlooper/olympic-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
89 lines (75 loc) · 2.01 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
body {
background-color: black;
}
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: white;
margin-top: 60px;
}
/* 🥇 style the grid id and the .flip-card class, see Mozilla web docs for CSS Grid */
/* Grid-template-columns: repeat them, fit their content to resize automatically,
with minimum 320px, maximum 1 fraction of the container’s free space */
#grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
grid-gap: 1rem;
justify-items: center;
align-items: center;
}
/* Set the flip card container to be 100% with variable height 50% of the viewport height */
.flip-card {
width: 100%;
height: 50vh;
perspective: 1000px;
}
/* 🥈 style the inner cards and get them ready to flip on hover */
/* .flip-card-inner contains all cards, and it needs to have some animation. It transforms quickly and as if was a 3-D object. */
.flip-card-inner {
width: 100%;
height: 100%;
text-align: center;
transition: transform 0.6s;
transform-style: preserve-3d;
border-radius: 0.5rem;
}
/* .flip-card take a hover transform: hover the mouse over the .flip-card element
and the its inner .flip-card-inner element will rotate on the Y axis, 180 degrees. */
.flip-card:hover .flip-card-inner {
transform: rotateY(180deg);
}
/* 🥉 style the front and back of the cards */
/* .flip-card-back needs an additional transform so that when you DON’T hover over it, the back flips itself back to the front.
*/
.flip-card-front,
.flip-card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
border-radius: 0.5rem;
background-color: white;
color: black;
}
.flip-card-back {
transform: rotateY(180deg);
}
img {
margin: 0px;
padding: 0px;
height: 20vh;
overflow: hidden;
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
width: 100%;
}
.description {
padding: 10px;
}
h2 {
background-color: lightgray;
padding: 5px;
margin-top: -6px;
}