JSDM

HTML

4
1
%div.wrap
2
  %div.red-wrap
3
    -(1..20).each do
4
      %div.side
!

CSS

x
 
1
html, body {
2
  height: 100%;
3
}
4
5
body {
6
  background: #222;
7
  background: radial-gradient(circle at center, #eee, #373A5E);
8
  overflow: hidden;
9
  min-height: 100%;
10
}
11
12
.wrap {
13
  perspective: 800px;
14
  perspective-origin: top;
15
  height: 100%;
16
  transform: rotateZ(10deg);
17
}
18
19
.red-wrap {
20
  position: relative;
21
  margin: 0 auto;
22
  top: 10%;
23
  width: 30px;
24
  height: 335px;
25
  transform-style: preserve-3d;
26
  transform-origin: center center;
27
  animation: rotate 10s infinite linear;
28
}
29
30
$total: 20;
31
$deg: 360/$total;
32
$imageWidth: 424;
33
$imageHeight: 335;
34
35
.side {
36
  position: absolute;
37
  height: $imageHeight+px;
38
  width: 24px;
39
  border-top: 5px solid gray;
40
  border-bottom: 5px solid gray;
41
  background: url(http://cdn.jsets.com/2/red-bull-wrapper.jpg);
42
}
43
44
@for $i from 1 through $total {
45
  .side:nth-child(#{$i}){
46
    transform: rotateY($i * $deg+deg) translateZ(70px);
47
    background-position: $imageWidth - ($i * $imageWidth/$total)+px 0;
48
  }
49
}
50
51
@keyframes rotate {
52
  100% {
53
    transform: rotateY(360deg);
54
  }
55
}
!
? ?
? ?
必须是有效的URL
+ 添加另一个资源

JS

1
 
1
// could probably do top and bottom, just experimenting with wrapping an image around a cylinder ;)
!
必须是有效的URL
+ 添加另一个资源
Close

文件管理 点击文件查看URL

图片

  1. 暂无文件

CSS

  1. 暂无文件

JavaScript

  1. 暂无文件

其他

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