-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
158 lines (120 loc) · 3.06 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
*{
margin: 0;
padding: 0;
font-family: "Poppins", sans-serif;
}
body{
background: url("images/back.jpg") no-repeat;
background-size: cover;
/* centering the card */
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
/* bluring the background image */
backdrop-filter: blur(5px);
}
.card{
background: white;
position: relative;
/* background: white; */
width: 400px;
height: 500px;
box-shadow: 10px 20px 40px rgba(0,0,0,0.5);
/* For 3d transformation */
transform-style: preserve-3d;
transform: perspective(1000px);
transition: 1s linear;
}
@media screen and (max-width:950px) {
.card{
width: 300px;
height: 400px;
}
}
@media screen and (max-width:650px) {
.card{
width: 200px;
height: 300px;
}
}
@media screen and (max-width:450px) {
.card{
width: 150px;
height: 250px;
}
.card .content .detail h2{
font-size: 1rem;
}
.card .content .detail p{
font-size: 0.8rem;
}
}
/* When the card is open transfering the card to 50% in x direction to fit the open card */
/* If you want you can comment this line and see why it's little bit necessary. It's always good to try somethings by yourself. */
.card:hover{
transform: translateX(50%);
}
.img-box{
position: relative;
width: 100%;
height: 100%;
z-index: 1;
/* So that the rotation axis is left side of img */
transform-origin: left;
transform-style: preserve-3d;
transition: 1s linear;
background: black;
/* background-size: cover; */
box-shadow: 10px 20px 40px rgba(0,0,0,0.5);
}
.card:hover .img-box{
transform: rotateY(-180deg);
}
.img-box img{
position: absolute;
top: 0;
left: -0.3px;
width: 100%;
height: 100%;
object-fit: cover;
/* When the image is rotated it should hide it's background vissibility */
backface-visibility: hidden;
}
/* Setting up the second image so that it appear behind the current image */
.img-box img:nth-child(2){
transform: rotateY(180deg);
}
/* All this is to set the content style it's very easy you can try it yourself. */
/* It's very important in development to try somethings youself that's the secret art of learinig */
.content{
top: 0;
left: 0;
position: absolute;
display: flex;
justify-content: center;
align-items: center;
/* padding: 20px; */
width: 100%;
height: 100%;
background: grey;
}
.card .content .detail{
/* display: flex;
justify-content: center;
align-items: center;
flex-direction: column; */
text-align: center;
}
.card .content .detail h2, p{
color: white;
}
.card .content .detail h2 span{
/* color: palevioletred; */
font-size: 1.3rem;
margin-bottom: 27px;
display: inline-block;
}
.card .content .detail p{
margin: 0 15px;
}