Skip to content

Commit c36bf35

Browse files
author
guldus98
committed
html, css and js
1 parent 4f930ac commit c36bf35

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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>

Growing Card Flip/Screenshot_2.png

11.1 KB
Loading

0 commit comments

Comments
 (0)