forked from DamHVHQ/DamHVHQ.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
present.css
213 lines (206 loc) · 5.24 KB
/
present.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
html, body {
margin: 0;
}
.above-fold {
height: 100vh;
width: 100vw;
padding: 0;
margin: 0;
perspective: 800px;
perspective-origin: 50% 200px;
display: flex;
flex-wrap: wrap;
position: relative;
}
.above-fold .info-text {
width: 100%;
display: block;
text-align: center;
margin: 0;
padding: 0;
color: #555;
font-family: "Avenir";
font-weight: 100;
font-size: 13px;
height: 25px;
align-self: flex-end;
}
.wrap-present {
width: 100%;
display: flex;
align-self: flex-end;
}
.present-box {
transform-style: preserve-3d;
width: 200px;
height: 200px;
margin: auto;
-webkit-animation: rotate 11s alternate linear infinite;
animation: rotate 11s alternate linear infinite;
cursor: pointer;
}
.present-box:hover {
-webkit-animation: staticFront 700ms ease forwards;
animation: staticFront 700ms ease forwards;
}
.present-box.open {
/*&>.side.top{
opacity: .2;
}*/
-webkit-animation: zoomIn 1s ease-in forwards;
animation: zoomIn 1s ease-in forwards;
transform: rotateX(-103deg) rotateY(-180deg);
transition: transform 400ms;
}
.present-box.open .present {
pointer-events: auto;
visibility: visible;
}
.present-box.open .present .img-wrap {
opacity: 1;
transition: transform 600ms 800ms, opacity 800ms 200ms;
transform: translateZ(0px);
}
.present-box.open > .side {
opacity: 0.3;
transition: opacity 500ms 600ms;
}
.present-box.open > .side.back {
opacity: 0.7;
transform: translateZ(-101px) rotateY(180deg);
}
.present-box.open > .side.front {
transition: transform 800ms 0s, opacity 500ms 600ms;
transform: translateZ(100px) rotateY(190deg) translateX(0px);
transform-origin: 0% 0%;
opacity: 0.3;
width: 0;
}
.present-box .present {
position:bottom;
width: 200px;
height: 200px;
z-index: 50;
transform: rotateY(-180deg) rotateX(180deg) translateZ(-100px);
display: flex;
perspective: 600px;
pointer-events: none;
visibility: hidden;
}
.present-box .present > .img-wrap {
width: 200px;
align-self: center;
transition: transform 400ms;
opacity: 0;
transform: translateZ(-80px);
}
.present-box .present > .img-wrap a {
transition: transform 300ms;
position: relative;
display: block;
transform: scale(0.94);
}
.present-box .present > .img-wrap a:hover {
transform: scale(1);
}
.present-box .present > .img-wrap img {
max-width: 100%;
height: auto;
}
.present-box > .side {
width: 200px;
height: 200px;
position: absolute;
display: block;
background: repeating-linear-gradient(45deg, #cc2000, #cc2000 20px, #ffffff 20px, #ffffff 40px);
top: 0;
left: 0;
transition: transform 400ms;
}
.present-box > .side.back {
transform: translateZ(-100px) rotateY(180deg);
}
.present-box > .side.right {
transform: rotateY(-270deg) translateX(100px);
transform-origin: top right;
}
.present-box > .side.left {
transform: rotateY(270deg) translateX(-100px);
transform-origin: center left;
}
.present-box > .side.top {
transform: rotateX(-90deg) translateY(-100px);
transform-origin: top center;
transform-style: preserve-3d;
perspective: 100px;
text-align: center;
}
.present-box > .side.top .to {
display: inline-block;
font-family: cursive;
position: relative;
padding: 10px 10px 30px 10px;
border: 5px dotted #ff6666;
border-width: 2px;
background: #fff;
margin: auto;
transform: translateZ(-2px) translateY(50px);
}
.present-box > .side.top .to:after {
content: "HAPPY BIRTHDAY!!!!!";
display: inline-block;
transform: rotateY(180deg);
color: #990000;
}
.present-box > .side.top .to .name {
display: block;
position: absolute;
transform: translateY(20px) rotateY(180deg) translateX(10px);
text-align: center;
width: 100%;
font-size: 1.1rem;
color: green;
}
.present-box > .side.bottom {
transform: rotateX(90deg) translateY(100px);
transform-origin: bottom center;
}
.present-box > .side.front {
transform: translateZ(100px);
}
@-webkit-keyframes rotate {
100% {
transform: rotateY(-360deg) rotateX(180deg);
}
}
@keyframes rotate {
100% {
transform: rotateY(-360deg) rotateX(180deg);
}
}
@-webkit-keyframes staticFront {
100% {
transform: rotateX(-100deg) rotateY(-180deg);
}
}
@keyframes staticFront {
100% {
transform: rotateX(-100deg) rotateY(-180deg);
}
}
@-webkit-keyframes zoomIn {
50% {
transform: rotateX(-143deg) rotateY(-180deg) translateZ(-15px);
}
100% {
transform: rotateX(-167deg) rotateY(-180deg) translateZ(-15px) scale(1.2);
}
}
@keyframes zoomIn {
50% {
transform: rotateX(-143deg) rotateY(-180deg) translateZ(-15px);
}
100% {
transform: rotateX(-167deg) rotateY(-180deg) translateZ(-15px) scale(1.2);
}
}