当前位置:   article > 正文

HTML5+CSS实现图片3D旋转效果,附音乐_css 3d旋转的图片球

css 3d旋转的图片球

利用程序呈现图片,可以俘获一众女生的心,增加音乐可以实现图片变化的同时也带上了想要得到效果,如此一程序实乃众人之喜。

先看看程序呈现的效果,还是特别吸引人的。

先在网上爬取想要呈现的美女照片,存放在文件夹img-one,与程序路径一致。

图片像素需进行调整,同一面图片可以使用同一个图片,保持图片像素一致的同时也增加了立体感。第二张02.jpg和2.jpg可以倒着放,这样在程序实现的时候,可以和其他方向的图片一致。

从网上下载自己想要播放的音乐,保存在文件mp3内。 

接下来就是前端呈现的代码了,利用HBuilder实现HTML5代码的编写。

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title></title>
  6. <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  7. <link type="text/css" href="./css/style1.css" rel="stylesheet" />
  8. <!--
  9. 作者:ning@qq.com
  10. 时间:2022-11-20
  11. 描述:style1.css文件为调用图片的代码,img-one为存放图片的文件,mp3为需要播放的音乐
  12. 需注意调整图片像素值,否则呈现不完整
  13. -->
  14. <style>
  15. html,
  16. body {
  17. width: 100%;
  18. height: 100%;
  19. margin: 0;
  20. padding: 0;
  21. overflow: hidden;
  22. }
  23. .container {
  24. width: 100%;
  25. height: 100%;
  26. margin: 0;
  27. padding: 0;
  28. background-color: #000000;
  29. }
  30. </style>
  31. </head>
  32. <body>
  33. <div class="m-main">
  34. <div class="player">
  35. <a href="javascript:void(0)" rel="external nofollow" rel="external nofollow" id="js-play">
  36. <img src="./img-one/开始.png" alt="" id="img1"/>
  37. </a>
  38. <a href="javascript:void(0)" rel="external nofollow" rel="external nofollow" id="js-pause">
  39. <img src="./img-one/暂停.png" alt="" id="img2"/>
  40. </a>
  41. <div class="play-box">
  42. <div class="left">
  43. <p class="timeline"><span style=""></span></p>
  44. <div class="info">
  45. <span class="size">00:00</span>
  46. <span class="timeshow">00:00</span>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="video">
  52. <video controls autoplay name="media" id="js-video"><source src="./mp3/白月光与朱砂痣.mp3" type="video/mp4"></video>
  53. </div>
  54. </div>
  55. </div>
  56. <div id="jsi-cherry-container" class="container">
  57. <div class="box">
  58. <ul class="minbox">
  59. <li></li>
  60. <li></li>
  61. <li></li>
  62. <li></li>
  63. <li></li>
  64. <li></li>
  65. </ul>
  66. <ol class="maxbox">
  67. <li></li>
  68. <li></li>
  69. <li></li>
  70. <li></li>
  71. <li></li>
  72. <li></li>
  73. </ol>
  74. </div>
  75. </div>
  76. <script>
  77. $(function () {
  78. AudioControl('js-video');
  79. function AudioControl(id) {
  80. // 音频控制进度条
  81. console.log(777);
  82. var audio = document.getElementById(id);
  83. $(audio).on('loadedmetadata', function () {
  84. audio.pause();
  85. // 进度条控制
  86. $(document).on('touchend', '.timeline', function (e) {
  87. var x = e.originalEvent.changedTouches[0].clientX - this.offsetLeft;
  88. var X = x < 0 ? 0 : x;
  89. var W = $(this).width();
  90. var place = X > W ? W : X;
  91. audio.currentTime = (place / W).toFixed(2) * audio.duration;
  92. $(this).children().css({
  93. width: (place / W).toFixed(2) * 100 + "%"
  94. })
  95. });
  96. // 播放
  97. $(document).on('click', '#js-play', function () {
  98. audio.play()
  99. $('#img1').css("display","none");
  100. $('#img2').css("display","block");
  101. });
  102. // 暂停
  103. $(document).on('click', '#js-pause', function () {
  104. audio.pause()
  105. $('#img1').css("display","block");
  106. $('#img2').css("display","none");
  107. });
  108. });
  109. setInterval(function () {
  110. var currentTime = audio.currentTime;
  111. setTimeShow(currentTime);
  112. }, 1000);
  113. // 设置播放时间
  114. function setTimeShow(t) {
  115. t = Math.floor(t);
  116. var playTime = secondToMin(audio.currentTime);
  117. $(".size").html(playTime);
  118. $('.timeshow').text(secondToMin(audio.duration));
  119. $('.timeline').children().css({
  120. width: (t / audio.duration).toFixed(4) * 100 + "%"
  121. })
  122. }
  123. // 计算时间
  124. function secondToMin(s) {
  125. var MM = Math.floor(s / 60);
  126. var SS = s % 60;
  127. if (MM < 10)
  128. MM = "0" + MM;
  129. if (SS < 10)
  130. SS = "0" + SS;
  131. var min = MM + ":" + SS;
  132. return min.split('.')[0];
  133. }
  134. }
  135. })
  136. var RENDERER = {
  137. INIT_CHERRY_BLOSSOM_COUNT: 30,
  138. MAX_ADDING_INTERVAL: 10,
  139. init: function () {
  140. this.setParameters();
  141. this.reconstructMethods();
  142. this.createCherries();
  143. this.render();
  144. if (
  145. navigator.userAgent.match(
  146. /(phone|pod|iPhone|iPod|ios|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  147. )
  148. ) {
  149. var box = document.querySelectorAll('.box')[0];
  150. console.log(box, '移动端');
  151. box.style.marginTop = '65%';
  152. }
  153. },
  154. setParameters: function () {
  155. this.$container = $('#jsi-cherry-container');
  156. this.width = this.$container.width();
  157. this.height = this.$container.height();
  158. this.context = $('<canvas />')
  159. .attr({
  160. width: this.width,
  161. height: this.height
  162. })
  163. .appendTo(this.$container)
  164. .get(0)
  165. .getContext('2d');
  166. this.cherries = [];
  167. this.maxAddingInterval = Math.round(
  168. (this.MAX_ADDING_INTERVAL * 1000) / this.width
  169. );
  170. this.addingInterval = this.maxAddingInterval;
  171. },
  172. reconstructMethods: function () {
  173. this.render = this.render.bind(this);
  174. },
  175. createCherries: function () {
  176. for (
  177. var i = 0,
  178. length = Math.round(
  179. (this.INIT_CHERRY_BLOSSOM_COUNT * this.width) / 1000
  180. ); i < length; i++
  181. ) {
  182. this.cherries.push(new CHERRY_BLOSSOM(this, true));
  183. }
  184. },
  185. render: function () {
  186. requestAnimationFrame(this.render);
  187. this.context.clearRect(0, 0, this.width, this.height);
  188. this.cherries.sort(function (cherry1, cherry2) {
  189. return cherry1.z - cherry2.z;
  190. });
  191. for (var i = this.cherries.length - 1; i >= 0; i--) {
  192. if (!this.cherries[i].render(this.context)) {
  193. this.cherries.splice(i, 1);
  194. }
  195. }
  196. if (--this.addingInterval == 0) {
  197. this.addingInterval = this.maxAddingInterval;
  198. this.cherries.push(new CHERRY_BLOSSOM(this, false));
  199. }
  200. }
  201. };
  202. var CHERRY_BLOSSOM = function (renderer, isRandom) {
  203. this.renderer = renderer;
  204. this.init(isRandom);
  205. };
  206. CHERRY_BLOSSOM.prototype = {
  207. FOCUS_POSITION: 300,
  208. FAR_LIMIT: 600,
  209. MAX_RIPPLE_COUNT: 100,
  210. RIPPLE_RADIUS: 100,
  211. SURFACE_RATE: 0.5,
  212. SINK_OFFSET: 20,
  213. init: function (isRandom) {
  214. this.x = this.getRandomValue(
  215. -this.renderer.width,
  216. this.renderer.width
  217. );
  218. this.y = isRandom ?
  219. this.getRandomValue(0, this.renderer.height) :
  220. this.renderer.height * 1.5;
  221. this.z = this.getRandomValue(0, this.FAR_LIMIT);
  222. this.vx = this.getRandomValue(-2, 2);
  223. this.vy = -2;
  224. this.theta = this.getRandomValue(0, Math.PI * 2);
  225. this.phi = this.getRandomValue(0, Math.PI * 2);
  226. this.psi = 0;
  227. this.dpsi = this.getRandomValue(Math.PI / 600, Math.PI / 300);
  228. this.opacity = 0;
  229. this.endTheta = false;
  230. this.endPhi = false;
  231. this.rippleCount = 0;
  232. var axis = this.getAxis(),
  233. theta =
  234. this.theta +
  235. (Math.ceil(
  236. -(this.y + this.renderer.height * this.SURFACE_RATE) / this.vy
  237. ) *
  238. Math.PI) /
  239. 500;
  240. theta %= Math.PI * 2;
  241. this.offsetY =
  242. 40 * (theta <= Math.PI / 2 || theta >= (Math.PI * 3) / 2 ? -1 : 1);
  243. this.thresholdY =
  244. this.renderer.height / 2 +
  245. this.renderer.height * this.SURFACE_RATE * axis.rate;
  246. this.entityColor = this.renderer.context.createRadialGradient(
  247. 0,
  248. 40,
  249. 0,
  250. 0,
  251. 40,
  252. 80
  253. );
  254. this.entityColor.addColorStop(
  255. 0,
  256. 'hsl(330, 70%, ' + 50 * (0.3 + axis.rate) + '%)'
  257. );
  258. this.entityColor.addColorStop(
  259. 0.05,
  260. 'hsl(330, 40%,' + 55 * (0.3 + axis.rate) + '%)'
  261. );
  262. this.entityColor.addColorStop(
  263. 1,
  264. 'hsl(330, 20%, ' + 70 * (0.3 + axis.rate) + '%)'
  265. );
  266. this.shadowColor = this.renderer.context.createRadialGradient(
  267. 0,
  268. 40,
  269. 0,
  270. 0,
  271. 40,
  272. 80
  273. );
  274. this.shadowColor.addColorStop(
  275. 0,
  276. 'hsl(330, 40%, ' + 30 * (0.3 + axis.rate) + '%)'
  277. );
  278. this.shadowColor.addColorStop(
  279. 0.05,
  280. 'hsl(330, 40%,' + 30 * (0.3 + axis.rate) + '%)'
  281. );
  282. this.shadowColor.addColorStop(
  283. 1,
  284. 'hsl(330, 20%, ' + 40 * (0.3 + axis.rate) + '%)'
  285. );
  286. },
  287. getRandomValue: function (min, max) {
  288. return min + (max - min) * Math.random();
  289. },
  290. getAxis: function () {
  291. var rate = this.FOCUS_POSITION / (this.z + this.FOCUS_POSITION),
  292. x = this.renderer.width / 2 + this.x * rate,
  293. y = this.renderer.height / 2 - this.y * rate;
  294. return {
  295. rate: rate,
  296. x: x,
  297. y: y
  298. };
  299. },
  300. renderCherry: function (context, axis) {
  301. context.beginPath();
  302. context.moveTo(0, 40);
  303. context.bezierCurveTo(-60, 20, -10, -60, 0, -20);
  304. context.bezierCurveTo(10, -60, 60, 20, 0, 40);
  305. context.fill();
  306. for (var i = -4; i < 4; i++) {
  307. context.beginPath();
  308. context.moveTo(0, 40);
  309. context.quadraticCurveTo(i * 12, 10, i * 4, -24 + Math.abs(i) * 2);
  310. context.stroke();
  311. }
  312. },
  313. render: function (context) {
  314. var axis = this.getAxis();
  315. if (
  316. axis.y == this.thresholdY &&
  317. this.rippleCount < this.MAX_RIPPLE_COUNT
  318. ) {
  319. context.save();
  320. context.lineWidth = 2;
  321. context.strokeStyle =
  322. 'hsla(0, 0%, 100%, ' +
  323. (this.MAX_RIPPLE_COUNT - this.rippleCount) /
  324. this.MAX_RIPPLE_COUNT +
  325. ')';
  326. context.translate(
  327. axis.x +
  328. this.offsetY * axis.rate * (this.theta <= Math.PI ? -1 : 1),
  329. axis.y
  330. );
  331. context.scale(1, 0.3);
  332. context.beginPath();
  333. context.arc(
  334. 0,
  335. 0,
  336. (this.rippleCount / this.MAX_RIPPLE_COUNT) *
  337. this.RIPPLE_RADIUS *
  338. axis.rate,
  339. 0,
  340. Math.PI * 2,
  341. false
  342. );
  343. context.stroke();
  344. context.restore();
  345. this.rippleCount++;
  346. }
  347. if (axis.y < this.thresholdY || !this.endTheta || !this.endPhi) {
  348. if (this.y <= 0) {
  349. this.opacity = Math.min(this.opacity + 0.01, 1);
  350. }
  351. context.save();
  352. context.globalAlpha = this.opacity;
  353. context.fillStyle = this.shadowColor;
  354. context.strokeStyle =
  355. 'hsl(330, 30%,' + 40 * (0.3 + axis.rate) + '%)';
  356. context.translate(
  357. axis.x,
  358. Math.max(axis.y, this.thresholdY + this.thresholdY - axis.y)
  359. );
  360. context.rotate(Math.PI - this.theta);
  361. context.scale(axis.rate * -Math.sin(this.phi), axis.rate);
  362. context.translate(0, this.offsetY);
  363. this.renderCherry(context, axis);
  364. context.restore();
  365. }
  366. context.save();
  367. context.fillStyle = this.entityColor;
  368. context.strokeStyle = 'hsl(330, 40%,' + 70 * (0.3 + axis.rate) + '%)';
  369. context.translate(
  370. axis.x,
  371. axis.y + Math.abs(this.SINK_OFFSET * Math.sin(this.psi) * axis.rate)
  372. );
  373. context.rotate(this.theta);
  374. context.scale(axis.rate * Math.sin(this.phi), axis.rate);
  375. context.translate(0, this.offsetY);
  376. this.renderCherry(context, axis);
  377. context.restore();
  378. if (this.y <= -this.renderer.height / 4) {
  379. if (!this.endTheta) {
  380. for (
  381. var theta = Math.PI / 2, end = (Math.PI * 3) / 2; theta <= end; theta += Math.PI
  382. ) {
  383. if (this.theta < theta && this.theta + Math.PI / 200 > theta) {
  384. this.theta = theta;
  385. this.endTheta = true;
  386. break;
  387. }
  388. }
  389. }
  390. if (!this.endPhi) {
  391. for (
  392. var phi = Math.PI / 8, end = (Math.PI * 7) / 8; phi <= end; phi += (Math.PI * 3) / 4
  393. ) {
  394. if (this.phi < phi && this.phi + Math.PI / 200 > phi) {
  395. this.phi = Math.PI / 8;
  396. this.endPhi = true;
  397. break;
  398. }
  399. }
  400. }
  401. }
  402. if (!this.endTheta) {
  403. if (axis.y == this.thresholdY) {
  404. this.theta +=
  405. (Math.PI / 200) *
  406. (this.theta < Math.PI / 2 ||
  407. (this.theta >= Math.PI && this.theta < (Math.PI * 3) / 2) ?
  408. 1 :
  409. -1);
  410. } else {
  411. this.theta += Math.PI / 500;
  412. }
  413. this.theta %= Math.PI * 2;
  414. }
  415. if (this.endPhi) {
  416. if (this.rippleCount == this.MAX_RIPPLE_COUNT) {
  417. this.psi += this.dpsi;
  418. this.psi %= Math.PI * 2;
  419. }
  420. } else {
  421. this.phi += Math.PI / (axis.y == this.thresholdY ? 200 : 500);
  422. this.phi %= Math.PI;
  423. }
  424. if (this.y <= -this.renderer.height * this.SURFACE_RATE) {
  425. this.x += 2;
  426. this.y = -this.renderer.height * this.SURFACE_RATE;
  427. } else {
  428. this.x += this.vx;
  429. this.y += this.vy;
  430. }
  431. return (
  432. this.z > -this.FOCUS_POSITION &&
  433. this.z < this.FAR_LIMIT &&
  434. this.x < this.renderer.width * 1.5
  435. );
  436. }
  437. };
  438. $(function () {
  439. console.log(6666);
  440. RENDERER.init();
  441. });
  442. </script>
  443. <style>
  444. html,
  445. body {
  446. width: 100%;
  447. height: 100%;
  448. margin: 0;
  449. padding: 0;
  450. overflow: hidden;
  451. }
  452. .container {
  453. width: 100%;
  454. height: 100%;
  455. margin: 0;
  456. padding: 0;
  457. background-color: #000000;
  458. }
  459. </style>
  460. </body>
  461. </html>

css文件是设置图片路径的代码,先命名为css,可以修改,放置路径需和Html文件一致。

 

  1. @charset "utf-8";
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. }
  6. body {
  7. max-width: 100%;
  8. min-width: 100%;
  9. height: 100%;
  10. background-size: cover;
  11. background-repeat: no-repeat;
  12. background-attachment: fixed;
  13. background-size: 100% 100%;
  14. position: absolute;
  15. margin-left: auto;
  16. margin-right: auto;
  17. }
  18. /*背景音乐*/
  19. .m-main {
  20. width: 380px;
  21. height: 60px;
  22. margin: 0 auto;
  23. position: fixed;
  24. right: 30px;
  25. }
  26. .m-main video {
  27. display: none;
  28. }
  29. .m-main .player {
  30. width: 100%;
  31. height: 60px;
  32. position: relative;
  33. bottom: 0;
  34. }
  35. .m-main .player>a {
  36. display: inline-block;
  37. width: 20px;
  38. margin: 0 auto;
  39. padding: 10px;
  40. color: #FFF;
  41. text-align: center;
  42. float: left;
  43. font-size: 12px
  44. }
  45. .m-main .player>a img {
  46. width: 30px;
  47. height: 30px;
  48. position: absolute;
  49. top: 20px;
  50. left: 41px;
  51. }
  52. #img1 {
  53. display: block;
  54. }
  55. #img2 {
  56. display: none;
  57. }
  58. .m-main .play-box {
  59. width: 300px;
  60. height: 60px;
  61. margin: 0 auto;
  62. position: absolute;
  63. top: 0;
  64. right: 0;
  65. }
  66. .m-main .play-box .left {
  67. width: 100%;
  68. float: left;
  69. }
  70. .m-main .play-box .left p.timeline {
  71. width: 33%;
  72. height: 10px;
  73. background-color: rgba(216, 216, 216, 0.5);
  74. border-radius: 5px;
  75. margin: 30px auto 0;
  76. position: relative;
  77. z-index: 2;
  78. }
  79. .m-main .play-box .left p.timeline span {
  80. position: relative;
  81. width: 0;
  82. height: 10px;
  83. background-color: #D3EEDF;
  84. border-radius: 5px;
  85. display: block;
  86. -webkit-transition: width ease-out 0.3s;
  87. -o-transition: width ease-out 0.3s;
  88. transition: width ease-out 0.3s;
  89. }
  90. .m-main .play-box .left p.timeline span:after {
  91. content: "";
  92. position: absolute;
  93. top: -4px;
  94. right: -0.6rem;
  95. width: 1.2rem;
  96. height: 1.2rem;
  97. border-radius: 50%;
  98. background-color: green;
  99. }
  100. .m-main .play-box .left div.info {
  101. height: 26px;
  102. line-height: 26px;
  103. font-size: 14px;
  104. color: #9A9A9A;
  105. position: relative;
  106. top: -18px;
  107. margin: 0 10px;
  108. z-index: 1;
  109. }
  110. .m-main .play-box .left div.info .size {
  111. float: left;
  112. display: block;
  113. }
  114. .m-main .play-box .left div.info .timeshow {
  115. float: right;
  116. display: block;
  117. margin-right: 30px
  118. }
  119. /* ----------------------------------------------- */
  120. li {
  121. list-style: none;
  122. }
  123. .box {
  124. width: 200px;
  125. height: 200px;
  126. background-size: cover;
  127. background-repeat: no-repeat;
  128. background-attachment: fixed;
  129. background-size: 100% 100%;
  130. position: absolute;
  131. margin-left: 42%;
  132. margin-top: 22%;
  133. -webkit-transform-style: preserve-3d;
  134. -webkit-transform: rotateX(13deg);
  135. -webkit-animation: move 5s linear infinite;
  136. }
  137. .minbox {
  138. width: 100px;
  139. height: 100px;
  140. position: absolute;
  141. left: 50px;
  142. top: 30px;
  143. -webkit-transform-style: preserve-3d;
  144. }
  145. .minbox li {
  146. width: 100px;
  147. height: 100px;
  148. position: absolute;
  149. left: 0;
  150. top: 0;
  151. }
  152. .minbox li:nth-child(1) {
  153. background: url(../img-one/01.jpg) no-repeat;
  154. background-size: cover;
  155. -webkit-transform: translateZ(50px);
  156. }
  157. .minbox li:nth-child(2) {
  158. background: url(../img-one/02.jpg) no-repeat;
  159. background-size: cover;
  160. -webkit-transform: rotateX(180deg) translateZ(50px);
  161. /* transform: rotate(180deg); */
  162. }
  163. .minbox li:nth-child(3) {
  164. background: url(../img-one/03.jpg) no-repeat;
  165. background-size: cover;
  166. -webkit-transform: rotateX(-90deg) translateZ(50px);
  167. }
  168. .minbox li:nth-child(4) {
  169. background: url(../img-one/04.jpg) no-repeat;
  170. background-size: cover;
  171. -webkit-transform: rotateX(90deg) translateZ(50px);
  172. }
  173. .minbox li:nth-child(5) {
  174. background: url(../img-one/05.jpg) no-repeat;
  175. background-size: cover;
  176. -webkit-transform: rotateY(-90deg) translateZ(50px);
  177. }
  178. .minbox li:nth-child(6) {
  179. background: url(../img-one/06.jpg) no-repeat;
  180. background-size: cover;
  181. -webkit-transform: rotateY(90deg) translateZ(50px);
  182. }
  183. .maxbox li:nth-child(1) {
  184. background: url(../img-one/1.jpg) no-repeat 0 0;
  185. background-size: cover;
  186. -webkit-transform: translateZ(50px);
  187. }
  188. .maxbox li:nth-child(2) {
  189. background: url(../img-one/2.jpg) no-repeat 0 0;
  190. -webkit-transform: translateZ(50px);
  191. background-size: cover;
  192. /* transform: rotate(180deg); */
  193. }
  194. .maxbox li:nth-child(3) {
  195. background: url(../img-one/3.jpg) no-repeat 0 0;
  196. background-size: cover;
  197. -webkit-transform: rotateX(-90deg) translateZ(50px);
  198. }
  199. .maxbox li:nth-child(4) {
  200. background: url(../img-one/4.jpg) no-repeat 0 0;
  201. background-size: cover;
  202. -webkit-transform: rotateX(90deg) translateZ(50px);
  203. }
  204. .maxbox li:nth-child(5) {
  205. background: url(../img-one/5.jpg) no-repeat 0 0;
  206. background-size: cover;
  207. -webkit-transform: rotateY(-90deg) translateZ(50px);
  208. }
  209. .maxbox li:nth-child(6) {
  210. background: url(../img-one/6.jpg) no-repeat 0 0;
  211. background-size: cover;
  212. -webkit-transform: rotateY(90deg) translateZ(50px);
  213. }
  214. .maxbox {
  215. width: 800px;
  216. height: 400px;
  217. position: absolute;
  218. left: 0;
  219. top: -20px;
  220. -webkit-transform-style: preserve-3d;
  221. }
  222. .maxbox li {
  223. width: 200px;
  224. height: 200px;
  225. background: #fff;
  226. border: 1px solid #ccc;
  227. position: absolute;
  228. left: 0;
  229. top: 0;
  230. opacity: 0.2;
  231. -webkit-transition: all 1s ease;
  232. }
  233. .maxbox li:nth-child(1) {
  234. -webkit-transform: translateZ(100px);
  235. }
  236. .maxbox li:nth-child(2) {
  237. -webkit-transform: rotateX(180deg) translateZ(100px);
  238. }
  239. .maxbox li:nth-child(3) {
  240. -webkit-transform: rotateX(-90deg) translateZ(100px);
  241. }
  242. .maxbox li:nth-child(4) {
  243. -webkit-transform: rotateX(90deg) translateZ(100px);
  244. }
  245. .maxbox li:nth-child(5) {
  246. -webkit-transform: rotateY(-90deg) translateZ(100px);
  247. }
  248. .maxbox li:nth-child(6) {
  249. -webkit-transform: rotateY(90deg) translateZ(100px);
  250. }
  251. .box:hover ol li:nth-child(1) {
  252. -webkit-transform: translateZ(300px);
  253. width: 400px;
  254. height: 400px;
  255. opacity: 0.8;
  256. left: -100px;
  257. top: -100px;
  258. }
  259. .box:hover ol li:nth-child(2) {
  260. -webkit-transform: rotateX(180deg) translateZ(300px);
  261. width: 400px;
  262. height: 400px;
  263. opacity: 0.8;
  264. left: -100px;
  265. top: -100px;
  266. }
  267. .box:hover ol li:nth-child(3) {
  268. -webkit-transform: rotateX(-90deg) translateZ(300px);
  269. width: 400px;
  270. height: 400px;
  271. opacity: 0.8;
  272. left: -100px;
  273. top: -100px;
  274. }
  275. .box:hover ol li:nth-child(4) {
  276. -webkit-transform: rotateX(90deg) translateZ(300px);
  277. width: 400px;
  278. height: 400px;
  279. opacity: 0.8;
  280. left: -100px;
  281. top: -100px;
  282. }
  283. .box:hover ol li:nth-child(5) {
  284. -webkit-transform: rotateY(-90deg) translateZ(300px);
  285. width: 400px;
  286. height: 400px;
  287. opacity: 0.8;
  288. left: -100px;
  289. top: -100px;
  290. }
  291. .box:hover ol li:nth-child(6) {
  292. -webkit-transform: rotateY(90deg) translateZ(300px);
  293. width: 400px;
  294. height: 400px;
  295. opacity: 0.8;
  296. left: -100px;
  297. top: -100px;
  298. }
  299. @keyframes move {
  300. 0% {
  301. -webkit-transform: rotateX(13deg) rotateY(0deg);
  302. }
  303. 100% {
  304. -webkit-transform: rotateX(13deg) rotateY(360deg);
  305. }
  306. }

 

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号