-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmskr-test.html
More file actions
348 lines (282 loc) · 7.11 KB
/
smskr-test.html
File metadata and controls
348 lines (282 loc) · 7.11 KB
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<style>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,600,300);
html{
height:100%;
}
body {
font-family: 'Open Sans', sans-serif;
height:100%;
color:#fff;
background: #1b1b1b!important;
}
#container{
background: #1b1b1b!important;
}
/*Basic Phone styling*/
.phone {
border: 40px solid #121212;
border-width: 55px 7px;
border-radius: 40px;
margin: 50px auto;
overflow: hidden;
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
-webkit-animation: fadein 2s; /* Safari, Chrome and Opera > 12.1 */
-moz-animation: fadein 2s; /* Firefox < 16 */
-ms-animation: fadein 2s; /* Internet Explorer */
-o-animation: fadein 2s; /* Opera < 12.1 */
animation: fadein 2s;
}
.phone iframe {
border: 0;
width: 100%;
height: 100%;
background-color:#000;
}
/*Different Perspectives*/
/* Table View */
.phone.view_1 {
-webkit-transform: rotateX(50deg) rotateY(0deg) rotateZ(-30deg);
transform: rotateX(50deg) rotateY(0deg) rotateZ(-30deg);
box-shadow: -3px 3px 0 #000, -6px 6px 0 #000, -9px 9px 0 #000, -12px 12px 0 #000, -14px 10px 20px #000;
}
/* Front View */
.phone.view_2 {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
box-shadow: 0px 3px 0 #000, 0px 4px 0 #000, 0px 5px 0 #000, 0px 7px 0 #000, 0px 10px 20px #000;
}
@-webkit-keyframes rotate {
0%{-webkit-transform: rotateX(50deg) rotateY(0deg) rotateZ(-30deg);}
50%{-webkit-transform: rotateX(50deg) rotateY(0deg) rotateZ(-40deg);}
100%{-webkit-transform: rotateX(50deg) rotateY(0deg) rotateZ(-30deg);}
}
/* Rotate Animation */
.view_1.rotate
{
-webkit-animation-name: rotate;
-webkit-animation-duration: 15s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
/*Controls*/
#controls {
position: absolute;
top: 80px;
left: 20px;
font-size: 0.9em;
color: #333;
width:17px;
}
#controls div {
margin: 10px;
}
#controls div label {
width: 150px;
display: block;
float: left;
color: #fff;
}
#phone-controls{
position: absolute;
top: 80px;
right: 20px;
width: 200px;
font-size:14px;
}
#phones {
border-top:1px solid #fff;
margin-top:20px;
padding-top:20px;
}
#phones button {
outline: none;
width: 198px;
border: 1px solid #016aa0;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
-o-border-radius:5px;
background-color: #016aa0;
height: 40px;
margin: 10px 0;
color: #fff;
-webkit-transition: all 0.2s;
transition: all 0.2s;
}
#phones button:hover {
color: #444;
background-color: #eee;
}
#views button {
outline: none;
width: 198px;
border: 1px solid #00a8ff;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
-o-border-radius:5px;
background-color: #00a8ff;
height: 40px;
margin: 10px 0;
color: #fff;
-webkit-transition: all 0.2s;
transition: all 0.2s;
}
#views button:hover {
color: #444;
background-color: #eee;
}
@media (max-width:900px) {
#wrapper {
-webkit-transform: scale(0.8, 0.8);
transform: scale(0.8, 0.8);
}
}
@media (max-width:700px) {
#wrapper {
-webkit-transform: scale(0.6, 0.6);
transform: scale(0.6, 0.6);
}
.phone { margin: 0 0 0 -70px; }
}
@media (max-width:500px) {
#wrapper {
-webkit-transform: scale(0.4, 0.4);
transform: scale(0.4, 0.4);
}
}
/* Fade In Animation */
@keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Firefox < 16 */
@-moz-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Internet Explorer */
@-ms-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
/* Opera < 12.1 */
@-o-keyframes fadein {
from { opacity: 0; }
to { opacity: 1; }
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function () {
/*Only needed for the controls*/
phone = document.getElementById("phone_1"),
iframe = document.getElementById("frame_1");
/*View*/
function updateView(view) {
if (view) {
phone.className = "phone view_" + view;
}
}
/*Controls*/
function updateIframe() {
// preload iphone width and height
phone.style.width = "375px";
phone.style.height = "667px";
/*Idea by /u/aerosole*/
document.getElementById("wrapper").style.perspective = (
document.getElementById("iframePerspective").checked ? "1300px" : "none"
);
}
updateIframe();
/*Events*/
document.getElementById("controls").addEventListener("change", function() {
updateIframe();
});
document.getElementById("views").addEventListener("click", function(evt) {
updateView(evt.target.value);
});
document.getElementById("phones").addEventListener("click", function(evt) {
if(evt.target.value == 1){
// iphone 6
width = 375;
height = 667;
}
if(evt.target.value == 2){
// samsung
width = 400;
height = 640;
}
if(evt.target.value == 3){
// microsoft
width = 320;
height = 480;
}
if(evt.target.value == 4){
// htc
width = 360;
height = 640;
}
if(evt.target.value == 5){
// ipad mini
width = 768;
height = 1024;
}
phone.style.width = width + "px";
phone.style.height = height + "px";
});
iframe = document.getElementById('frame_1');
if (iframe.attachEvent){
iframe.attachEvent("onload", function(){
afterLoading();
});
} else {
iframe.onload = function(){
afterLoading();
};
}
function afterLoading(){
setTimeout(function() {
phone.className = "phone view_1";
setTimeout(function() {
// do second thing
phone.className = "phone view_1 rotate";
}, 1000);
}, 1000);
}
})
</script>
<div id="inner_wrap">
<!--The Main Thing-->
<div id="wrapper" style="perspective: 1300px;">
<div class="phone view_2" id="phone_1" style="width: 360px; height: 640px;">
<iframe src="https://cdpn.io/pen/debug/YzJoKZG?authentication_hash=RBrOJWPRojbM" id="frame_1"></iframe>
</div>
</div>
<!--Controls etc.-->
<div id="controls">
<!--Idea by /u/aerosole-->
<div>
<label for="iframePerspective">Add perspective:</label>
<input type="checkbox" id="iframePerspective" checked="true">
</div>
</div>
<div id="phone-controls">
<div id="views">
<button value="1">Table View</button>
<button value="2">Front View</button>
</div>
<div id="phones">
<button value="1">iPhone 6</button>
<button value="2">Samsung Galaxy Note</button>
<button value="3">Microsoft Lumia 1020</button>
<button value="4">HTC One</button>
<button value="5">iPad Mini</button>
</div>
</div
</div>