File tree Expand file tree Collapse file tree 3 files changed +88
-0
lines changed Expand file tree Collapse file tree 3 files changed +88
-0
lines changed Original file line number Diff line number Diff line change
1
+ body {
2
+ background : # eee ;
3
+ padding : 0 ;
4
+ margin : 0 ;
5
+ }
6
+ .container {
7
+ font-family : Verdana;
8
+ font-weight : bold;
9
+ font-size : 75px ;
10
+ width : 400px ;
11
+ height : 250px ;
12
+ border-radius : 10px ;
13
+ perspective : 1400px ;
14
+ position : absolute;
15
+ top : 50% ;
16
+ left : 50% ;
17
+ transform : translate (-50% , -50% );
18
+ }
19
+ .card {
20
+ position : relative;
21
+ height : 100% ;
22
+ border-radius : 10px ;
23
+ width : 100% ;
24
+ transform-style : preserve-3d;
25
+ transition-delay : 1s ;
26
+ transition : 1s ease-in-out;
27
+ cursor : pointer;
28
+ }
29
+ .front , .back {
30
+ display : flex;
31
+ justify-content : center;
32
+ align-items : center;
33
+ width : 100% ;
34
+ height : 100% ;
35
+ backface-visibility : hidden;
36
+ border-radius : 10px ;
37
+ text-align : center;
38
+ }
39
+ .back {
40
+ color : # fff ;
41
+ background : # bc2828 ;
42
+ transform : rotateY (180deg );
43
+ }
44
+ .front {
45
+ position : absolute;
46
+ top : 0 ;
47
+ left : 0 ;
48
+ background : # fff ;
49
+ color : # bc2828 ;
50
+ }
51
+ .card .active {
52
+ transform : rotateY (180deg ) rotateX (360deg ) scale (2.5 );
53
+
54
+ }
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+
3
+ < html >
4
+ < head >
5
+ < meta charset ="utf-8 " />
6
+ < title > page</ title >
7
+ < link rel ="stylesheet " type ="text/css " href ="Growing Card Flip.css ">
8
+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
9
+ < link rel ="stylesheet " href ="https://use.fontawesome.com/releases/v5.7.2/css/all.css ">
10
+ </ head >
11
+ < body >
12
+
13
+ < div class ="container ">
14
+ < div class ="card ">
15
+ < div class ="front ">
16
+ Front
17
+ </ div >
18
+ < div class ="back ">
19
+ Back
20
+ </ div >
21
+ </ div >
22
+ </ div >
23
+
24
+ < script >
25
+
26
+ let card = document . querySelector ( ".card" ) ;
27
+ card . addEventListener ( "click" , function ( ) {
28
+ card . classList . toggle ( "active" ) ;
29
+ } ) ;
30
+
31
+ </ script >
32
+
33
+ </ body >
34
+ </ html >
You can’t perform that action at this time.
0 commit comments