JSDM

HTML

53
 
1
.wrapcube
2
    #a.cube
3
        .side.front HOVER ME
4
        .side.left
5
        .side.right
6
        .side.back
7
        .side.top
8
        .side.bottom
9
      #b.cube
10
        .side.front HOVER ME
11
        .side.left
12
        .side.right
13
        .side.back
14
        .side.top
15
        .side.bottom
16
      #c.cube
17
        .side.front HOVER ME
18
        .side.left
19
        .side.right
20
        .side.back
21
        .side.top
22
        .side.bottom
23
      #d.cube
24
        .side.front HOVER ME
25
        .side.left
26
        .side.right
27
        .side.back
28
        .side.top
29
        .side.bottom
30
      #e.cube
31
        .side.front HOVER ME
32
        .side.left
33
        .side.right
34
        .side.back
35
        .side.top
36
        .side.bottom
37
      #f.cube
38
        .side.front HOVER ME
39
        .side.left
40
        .side.right
41
        .side.back
42
        .side.top
43
        .side.bottom
44
      #g.cube
45
        .side.front HOVER ME
46
        .side.left
47
        .side.right
48
        .side.back
49
        .side.top
50
        .side.bottom
51
h1 rotate menu
52
  br
53
  small by Wagner Moschini
!

CSS

x
 
1
*{
2
  margin:0; 
3
  padding:0;
4
}
5
body{ 
6
  color:#fff; 
7
  background:#2c3e50;
8
  font-size: 12px;
9
  min-width: 800px;
10
  display: block;
11
  position: relative;
12
}
13
14
.wrapcube{
15
  perspective: 2000px;
16
  perspective-origin: center center;
17
  width:200px; 
18
  height:320px;
19
  position:absolute;   
20
  top:50px; 
21
  left:50px;
22
}
23
.cube{
24
  width:100%;
25
  height:50px;
26
  margin:0 0 0 0;
27
  position:relative;
28
29
  transition:.25s all ease-out;
30
  transform-style: preserve-3d;
31
32
  font-family: arial, helvetica, sans-serif;
33
  text-align: center;
34
  line-height: 4.5;
35
}
36
37
  
38
#a{z-index:1;}
39
#b{z-index:2;}
40
#c{z-index:3;}
41
#d{z-index:4;}
42
#e{z-index:3;}
43
#f{z-index:2;}
44
#g{z-index:1;}
45
  
46
.cube[data-rotate='1']{ 
47
  transform: rotateY(3deg) translateZ(-00px)  translateX(0px); 
48
}
49
.cube[data-rotate='2']{ 
50
  transform: rotateY(6deg) translateZ(-00px) translateX(0px); 
51
}
52
.cube[data-rotate='3']{ 
53
  transform: rotateY(9deg) translateZ(-00px) translateX(0px); 
54
}
55
.cube[data-rotate='4']{ 
56
  transform: rotateY(12deg) translateZ(-00px) translateX(0px); 
57
}
58
.cube[data-rotate='5']{ 
59
  transform: rotateY(15deg) translateZ(-00px) translateX(0px); 
60
}
61
.cube[data-rotate='6']{ 
62
  transform: rotateY(18deg) translateZ(-00px) translateX(0px); 
63
}
64
.side{
65
  width:100%;
66
  height:100%;
67
  position:absolute;
68
  backface:hidden;
69
}
70
71
.front { 
72
  height:50px; 
73
  transform: rotateY(0deg) rotateX(0deg) rotateZ(0deg) translateZ(100px); 
74
}
75
.left { 
76
  height:50px; 
77
  transform: rotateY(-90deg) rotateX(0deg) rotateZ(0deg) translateZ(100px); 
78
}
79
.right { 
80
  height:50px; 
81
  transform: rotateY(90deg) rotateX(0deg) rotateZ(0deg) translateZ(100px); 
82
}
83
.back { 
84
  height:50px; 
85
  transform: rotateY(-180deg) rotateX(0deg) rotateZ(0deg) translateZ(100px); 
86
}
87
.top { 
88
  height:200px; 
89
  transform: rotateY(0deg) rotateX(90deg) rotateZ(0deg) translateZ(100px); 
90
}
91
.bottom { 
92
  height:200px; 
93
  transform: rotateY(0deg) rotateX(-90deg) rotateZ(0deg) translateZ(-50px); 
94
}
95
96
#a .side{ background:#16a085; }
97
#a .front{ background:#1abc9c; }
98
99
#b .side{ background:#27ae60; }
100
#b .front{ background:#2ecc71; }
101
102
#c .side{ background:#2980b9; }
103
#c .front{ background:#3498db; }
104
105
#d .side{ background:#8e44ad; }
106
#d .front{ background:#9b59b6; }
107
108
#e .side{ background:#f39c12; }
109
#e .front{ background:#f1c40f; }
110
111
#f .side{ background:#d35400; }
112
#f .front{ background:#e67e22; }
113
114
#g .side{ background:#c0392b; }
115
#g .front{ background:#e74c3c; }
116
117
h1{
118
  font-size: 8em;
119
  font-family: 'Lobster Two';
120
  font-style: italic;
121
  text-align: right;
122
  line-height: .3;
123
  display: table;
124
  position: absolute;
125
  top: 60px;
126
  right: 30px;
127
  text-shadow: 2px 4px rgba(0,0,0,.3);
128
  color: #ecf0f1;
129
}
130
131
h1 small{
132
  font-size: .2em;
133
}
!
? ?
? ?
必须是有效的URL
+ 添加另一个资源

JS

12
 
1
var $el = $(".cube");
2
var rotate = function(index){
3
  var index = index || 0;
4
  $el.each(function(e){
5
    $(this).attr("data-rotate",Math.abs($(this).index() - index));
6
  });
7
}
8
$el.hover(function(e){
9
  var index = $(this).index();
10
  rotate(index);
11
});
12
rotate(0);
!
必须是有效的URL
+ 添加另一个资源
Close

文件管理 点击文件查看URL

图片

  1. 暂无文件

CSS

  1. 暂无文件

JavaScript

  1. 暂无文件

其他

  1. 暂无文件
拖动文件到上面的区域或者:
加载中 ..................