-
Notifications
You must be signed in to change notification settings - Fork 5
/
styles.css
85 lines (83 loc) · 2.62 KB
/
styles.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
@-webkit-keyframes wronganim {to { background-color: red; } }
@-moz-keyframes wronganim {to { background-color: red; } }
@keyframes wronganim {to { background-color: red; } }
@-webkit-keyframes correctanim { to { background-color: green; color: white; } }
@-moz-keyframes correctanim { to { background-color: green; color: white; } }
@keyframes correctanim { to { background-color: green; color: white; } }
.brick > div {
height: 50px;
width: 50px;
border: 1px solid black;
text-align: center;
line-height: 50px;
-webkit-backface-visibility: hidden;
-webkit-transition: -webkit-transform 0.3s linear;
-moz-transition: -moz-transform 0.3s linear;
transition: transform 0.3s linear;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
position: absolute;
overflow: hidden;
border-radius: 5px;
}
.brick > .front {
background-color: #AAA;
}
.brick, .brick div {
user-select: none;
cursor: pointer;
}
.brick {
float: left;
margin-right: 10px;
width: 50px;
height: 50px;
}
.brick > .back {
-webkit-animation-duration: 0.5s;
-webkit-animation-timing-function: ease;
-webkit-animation-delay: 0.3s;
-webkit-animation-iteration-count: 1;
-webkit-animation-fill-mode: forwards;
-moz-animation-duration: 0.5s;
-moz-animation-timing-function: ease;
-moz-animation-delay: 0.3s;
-moz-animation-iteration-count: 1;
-moz-animation-fill-mode: forwards;
animation-duration: 0.5s;
animation-timing-function: ease;
animation-delay: 0.3s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
.brick.flipped.wrong > .back {
-webkit-animation-name: wronganim;
-moz-animation-name: wronganim;
animation-name: wronganim;
}
.brick.flipped.correct > .back {
-webkit-animation-name: correctanim;
-moz-animation-name: correctanim;
animation-name: correctanim;
}
.brick > .back {
-webkit-transform: perspective(50px) rotateY(180deg) translate3d(0px, 0px, 2px);
-moz-transform: perspective(50px) rotateY(180deg) translate3d(0px, 0px, 2px);
transform: perspective(50px) rotateY(180deg) translate3d(0px, 0px, 2px);
}
.brick.flipped > .front {
-webkit-transform: perspective(50px) rotateY(-180deg) translate3d(0px, 0px, 2px);
-moz-transform: perspective(50px) rotateY(-180deg) translate3d(0px, 0px, 2px);
transform: perspective(50px) rotateY(-180deg) translate3d(0px, 0px, 2px);
}
.brick.flipped > .back {
-webkit-transform: perspective(50px) rotateY(0deg) translate3d(0px, 0px, 1px);
-moz-transform: perspective(50px) rotateY(0deg) translate3d(0px, 0px, 1px);
transform: perspective(50px) rotateY(0deg) translate3d(0px, 0px, 1px);
}
.front {
font-size: 2em;
}
.error {
color: red;
}