forked from xuanfeng/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo1.html
100 lines (98 loc) · 1.98 KB
/
demo1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>轩枫阁-基于Canvas实现的炫酷3D动画大背景</title>
<style>
*{margin: 0;padding: 0;}
#container {
position: absolute;
height: 100%;
width: 100%;
}
#output {
width: 100%;
height: 100%;
}
.color{
width: 120px;
height: 20px;
margin: 0 auto;
position: fixed;
left: 50%;
margin-left: -60px;
bottom: 20px;
}
.color li{
float: left;
margin: 0 5px;
width: 20px;
height: 20px;
background: #ccc;
box-shadow: 0 0 4px #FFF;
list-style: none;
cursor: pointer;
}
.color li:nth-child(1){
background: #002c4a;
}
.color li:nth-child(2){
background: #35ac03;
}
.color li:nth-child(3){
background: #ac0908;
}
.color li:nth-child(4){
background: #18bbff;
}
.logo{
width: 140px;
height: 70px;
position: fixed;
top: 10px;
left: 50%;
margin-left: -70px;
border: solid 1px #BBBBBB;
-webkit-transition: all 400ms ease-in-out;
-ms-transition: all 400ms ease-in-out;
-o-transition: all 400ms ease-in-out;
-moz-transition: all 400ms ease-in-out;
transition: all 400ms ease-in-out;
}
.logo:hover{
border: solid 1px #FFF;
background: rgba(255, 255, 255, 0.2);
}
</style>
<script src="js/jquery.js"></script>
<script src="js/vector.js"></script>
<script>
$(function(){
// 初始化 传入dom id
var victor = new Victor("container", "output");
var theme = [
["#002c4a", "#005584"],
["#35ac03", "#3f4303"],
["#ac0908", "#cd5726"],
["#18bbff", "#00486b"]
]
$(".color li").each(function(index, val) {
var color = theme[index];
$(this).mouseover(function(){
victor(color).set();
})
});
});
</script>
</head>
<body>
<div id="container"><div id="output"></div></div>
<ul class="color">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<div class="logo"><a href="http://www.xuanfengge.com/" title="轩枫阁"><img src="http://www.xuanfengge.com/wp-content/themes/lee2.0/images/logo.png" alt=""></a></div>
</body>
</html>