• HTML5+CSS实现图片3D旋转效果,附音乐


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

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

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

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

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

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

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

     

  • 相关阅读:
    【vue + echarts】图表自适应缩放(跟随浏览器的窗口缩放,项目侧边栏折叠后的窗口缩放),图表重绘
    Go 语言搭建个人博客(qiucode.cn 重构篇 三)
    从零到一学FFmpeg:av_packet_rescale_ts 函数详析与实战
    (二)Shell编程之运行方式、注释、变量
    vue安装步骤
    基于Python的性能优化
    【SpringBoot3+Vue3】四【基础篇】-前端(vue基础)
    链式二叉树(1)
    吉祥止止 | 天空卫士旗下两家公司分别荣获“国家专精特新小巨人”和“北京市专精特新”企业
    Webpack打包生产环境进行优化处理
  • 原文地址:https://blog.csdn.net/qq_45222550/article/details/127950937