-
Notifications
You must be signed in to change notification settings - Fork 0
/
border-width.html
174 lines (156 loc) · 3.43 KB
/
border-width.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>border-width效果</title>
<style type="text/css">
body {
background-color: #eaf0f2;
}
h1{
font-size: 14px;
font-family: "Microsoft Yahei";
text-align: center;
}
.paper-flip {
position: relative;
width: 500px;
height: 300px;
margin: 0 auto;
}
.share-layer {
position: absolute;
left: 0;
top: 0;
width: 500px;
height: 300px;
background-color: #fff;
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
opacity: 0;
}
.btn-wrap {
pointer-events: none;
opacity: 0;
text-align: center;
margin-top: 140px;
text-align: center;
}
.btn {
padding: 10px;
border-radius: 2px;
color: #fff;
display: inline-block;
}
.btn-facebook {
background-color: #3b5998;
}
.btn-twitter {
background-color: #00aced;
margin: 0 20px;
}
.btn-google {
background-color: #d34836;
}
.btn-close {
pointer-events: none;
position: absolute;
right: 15px;
top: 10px;
color: rgba(0,0,0,0.3);
font-size: 20px;
z-index: 11;
opacity: 0;
cursor: default;
}
.paper-flip.folded .btn-close {
-webkit-transition: 0.4s;
transition: 0.4s;
-webkit-transition-delay: 0.6s;
transition-delay: 0.6s;
opacity:1;
cursor: pointer;
pointer-events: initial;
}
.paper-flip.folded .btn-wrap{
opacity: 1;
-webkit-transition: all 0.4s;
-o-transition: all 0.4s;
transition: all 0.4s;
-webkit-transition-delay: 0.6s;
-o-transition-delay: 0.6s;
transition-delay: 0.6s;
pointer-events: initial;
}
.paper-flip.folded .share-layer {
z-index: 1;
opacity: 1;
-webkit-transition: all 0.1s;
-o-transition: all 0.1s;
transition: all 0.1s;
-webkit-transition-delay: 0.4s;
-o-transition-delay: 0.4s;
transition-delay: 0.4s;
}
/*image-layer*/
.image-layer {
width: 500px;
height: 300px;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
}
.image-layer img {
width: 500px;
cursor: pointer;
}
.image-layer:before {
content: '';
position: absolute;
top: 0;
right: 0;
border-style: solid;
border-width: 0;
border-color: rgba(0,0,0,0.2) #fff;
border-radius: 0 0 0 4px;
box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2);
-webkit-transition: all 0.4s ease-out;
transition:all 0.4s ease-out;
}
.image-layer:hover:before{
border-right-width:80px;
border-bottom-width:80px;
}
.paper-flip.folded .image-layer:before{
border-right-width:1000px;
border-bottom-width:600px;
}
</style>
</head>
<body>
<h1>请使用webkit内核标准浏览器查看效果</h1>
<h1>翻书页效果</h1>
<div class="paper-flip" id="paper-flip">
<div class="share-layer">
<div class="btn-wrap">
<a class="btn btn-facebook">FaceBook</a>
<a class="btn btn-twitter">Twitter</a>
<a class="btn btn-google">Google +</a>
</div>
<span class="btn-close">×</span>
</div>
<div class="image-layer" id="image-layer">
<img src="http://p6.qhimg.com/d/inn/3f563406/table.jpg" alt="">
</div>
</div>
<script type="text/javascript">
document.getElementById('paper-flip').addEventListener("click",function(e){
if(e.target.className=="btn-close"){
this.className = "paper-flip";
} else {
this.className = "paper-flip folded";
}
});
</script>
</body>
</html>