-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathphone.html
133 lines (114 loc) · 3.58 KB
/
phone.html
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
---
layout: default
title: Phone
newstylesheet: "iphone"
---
<div class="phone-container">
<div class="phone">
<div class="front"> </div>
<div class="back"> </div>
<div class="left"> </div>
<div class="left-top"> </div>
<div class="left-bottom"> </div>
<div class="right"> </div>
<div class="right-top"> </div>
<div class="right-bottom"> </div>
<div class="shadow"> </div>
</div>
</div>
HTML:
<pre><code><div class="phone-container">
<div class="phone">
<div class="front"> </div>
<div class="back"> </div>
<div class="left"> </div>
<div class="left-top"> </div>
<div class="left-bottom"> </div>
<div class="right"> </div>
<div class="right-top"> </div>
<div class="right-bottom"> </div>
<div class="shadow"> </div>
</div>
</div></code></pre>
SASS:
<pre><code>.phone-container
margin: 100px auto
width: 251px
height: 537px
@include perspective(1000px)
//for elevation on hover:
$elevation: 40px
$elevationDuration: 1s
$elevationTimingFunction: ease-in-out
@include transition(bottom $elevationDuration $elevationTimingFunction)
*
position: absolute
@include transition(all 1500ms)
.phone
left: 125px
@include transform-style(preserve-3d)
@include transform(rotateY(-80deg))
@include animation(rotate-phone 5s linear infinite)
.front
width: 251px
height: 537px
background: url(/images/phone_parts/front.png) no-repeat
@include transform(translateX(-125px) rotateY(0deg) translateZ(14px))
.back
width: 251px
height: 537px
background: url(/images/phone_parts/back.png) no-repeat
@include transform(translateX(-125px) rotateY(180deg) translateZ(13px))
.left
width: 31px
height: 537px
background: url(/images/phone_parts/left_side.png) no-repeat
@include transform(translateX(-138px) rotateY(-90deg))
@include border-radius(20px)
@include backface-visibility(hidden)
.left-top
background: black
width: 29px
height: 30px
top: 4px
@include transform(translateX(-129px) rotateY(-90deg) rotateX(30deg))
.left-bottom
background: black
width: 29px
height: 25px
@include transform(translateX(-131px) translateY(490px) rotateY(-90deg) rotateX(-30deg))
.right
width: 31px
height: 537px
background: url(/images/phone_parts/right_side.png) no-repeat
@include transform(translateX(105px) rotateY(90deg))
@include backface-visibility(hidden)
.right-top
background: black
width: 29px
height: 29px
top: 4px
@include transform(translateX(98px) rotateY(-90deg) rotateX(-30deg))
.right-bottom
background: black
width: 29px
height: 25px
@include transform(translateX(100px) translateY(490px) rotateY(-90deg) rotateX(30deg))
.shadow
width: 250px
height: 20px
@include transform(translateX(-125px) translateY(530px) rotateX(90deg) translateY(-60px))
@include box-shadow(0 60px 60px #000)
@inclue transition(top $elevationDuration $elevationTimingFunction)
&:hover
position: relative
bottom: $elevation
.shadow
position: relative
top: $elevation
@include keyframes(rotate-phone)
0%
@include rotateY(0)
100%
@include rotateY(360deg)
</code></pre>