-
Notifications
You must be signed in to change notification settings - Fork 0
/
flip-card.htm
88 lines (75 loc) · 2.51 KB
/
flip-card.htm
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
<html>
<head>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
.cardframe
{
display: flex;
flex-flow: row;
align-items: center;
justify-content: center;
-moz-perspective: 300rem;
perspective: 700px;
perspective: length;
height: 330px;
width: 330px;
border: 1px solid red;
}
.card
{
height: 300px;
width: 300px;
display: flex;
border: 1px solid;
transition: all 0.9s ease;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
position: absolute;
/* top: 50%;
left: 50%; */
transform: translate(-50%, -50%);
border-radius: 10px;
}
.cardb
{
background-color: #bde0fe;
transform: rotateY(180deg);
}
.cardb_flip
{
transform: rotateY(0deg);
}
.cardf
{
background-color: #ffc8dd;
flex: initial;
transform: rotateY(360deg);
}
.cardf_flip
{
transform: rotateY(180deg);
}
</style>
<script>
$(document).ready(function () {
$(".cardframe").hover(
function () {
$('.cardb').addClass("cardb_flip");
$('.cardf').addClass("cardf_flip");
},
function () {
$('.cardb').removeClass("cardb_flip");
$('.cardf').removeClass("cardf_flip");
}
);
});
</script>
</head>
<body>
<div class="cardframe">
<div class="cardb card" id="back"> ABCDEFGHIJK</div>
<div class="cardf card"> ABCDEFGHIJK </div>
</div>
</body>
</html>