web2.0作业三:动态按钮

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
<!DOCTYPE html>
<html>
<head>
<title>环形按钮</title>
<meta charset="utf-8">
<link rel="icon" sizes="196x196" href="assets/images/favicon.png">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="at-plus-container">
<div id="bottom-positioner">
<div id="button">
<div id="info-bar">
<div style="display:block" class="info">
<ul>
<li title="2人参与讨论" class="page user"><img src="assets/images/people.png"><span>14</span></li>
<li title="3条评论" class="page comment"><img src="assets/images/comment.png"><span>20</span></li>
<li title="我有6条评论" class="mine posted"><img src="assets/images/post.png"><span>3</span></li><li title="被赞6次" class="mine like"><img src="assets/images/like.png"><span>4</span></li>
</ul>
</div>
</div>
<div id="control-ring-container">
<ul id="control-ring">
<li title="蒙板" class="mask button"></li>
<li title="历史记录" class="history button"></li>
<li title="消息" class="message button"><span class="unread">2</span></li>
<li title="设置" class="setting button"></li>
<li title="登录/注册" class="sign button"></li>
</ul>
</div>
<div class="apb">
<div class="icon"></div>
</div>
</div>
</div>
</div>
</body>
</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
175
176
177
178
179
180
181
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}

#at-plus-container {
width: 200px;
height: 100%;
margin: 0 auto;
position: relative;
}

#info-bar {
position: absolute;
background-color: #7E7E7E;
border-radius: 50%;
height: 26px;
width: 26px;
bottom: 97px;
left: 77px;
opacity: 0;
transition: 0.5s;
}

#button:hover #info-bar {
border-radius: 50%;
background-color: #7E7E7E;
width: 130px;
height: 130px;
bottom: 150px;
left: 25px;
opacity: 1;
}

#button ul{
margin: 0;
padding: 0;
}

#button li{
list-style: none;
text-align: center;
color: white;
margin-top: 5px;
margin-bottom: 5px;
}

#info-bar li.comment {
font-size: 30px;
}

#info-bar li.comment img {
width: 30px;
height: 30px;
padding-right: 2px;
}

#info-bar li span {
margin-left: 8px;
}

#info-bar li img {
vertical-align: middle;
}

#info-bar li.mine {
display: inline-block;
width: 50%;
color: #26E79E;
font-weight: bold;
box-sizing: border-box;
}

#info-bar li.posted {
padding-left: 15px;
}

#info-bar li.like {
padding-right: 5px;
}

#control-ring-container {
position: absolute;
width: 200px;
height: 200px;
border-radius: 50%;
bottom: -10px;
left: 30px;
}

#control-ring-container ul{
margin-left: 45px;
margin-top: 60px;
}


#control-ring li{
display: block;
background: #686868 center no-repeat;
position: absolute;
list-style: none;
width: 30px;
height: 30px;
background-size: 16px 16px;
border-radius: 50%;
transition: 0.5s;
opacity: 0;
}

#control-ring .unread{
display: block;
position: absolute;
width: 18px;
height: 18px;
border-radius: 50%;
background-color: red;
color: #E0D6DC;
margin-left: 18px;
margin-top: -5px;
font-size: 9pt;
}

#button:hover #control-ring li{
opacity: 1;
}

#button:hover #control-ring > li.mask.button{
margin-top: -32px;
margin-left: -55px;
background-image: url('assets/images/nomask.png');
}

#button:hover #control-ring > li.history.button{
margin-top: 5px;
margin-left: -70px;
background-image: url('assets/images/history.png');
}

#button:hover #control-ring > li.message.button{
margin-top: 44px;
margin-left: -55px;
background-image: url('assets/images/message.png');
}

#button:hover #control-ring > li.setting.button{
margin-top: 68px;
margin-left: -15px;
background-image: url('assets/images/setting.png');
}

#button:hover #control-ring > li.sign.button{
margin-top: 60px;
margin-left: 30px;
background-image: url('assets/images/signin.png');
}

#button .apb{
background: url('assets/images/atplus_white.png') center no-repeat;
background-size: 20px 15px;
position: absolute;
width: 26px;
height: 26px;
bottom: 97px;
left: 77px;
border-radius: 50%;
background-color: #989FCF;
transition: 0.5s;
}

#button:hover .apb {
background: url('assets/images/atplus_green.png') center no-repeat;
background-size: 40px 30px;
width: 50px;
height: 50px;
bottom: 85px;
left: 65px;
border-radius: 50%;
background-color: #303F9F;
}

1

1

Donate? comment?