{"id":70977,"date":"2023-09-23T13:45:05","date_gmt":"2023-09-23T05:45:05","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=70977"},"modified":"2023-09-23T13:45:05","modified_gmt":"2023-09-23T05:45:05","slug":"css3-3d-tech","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/css3-3d-tech.html","title":{"rendered":"\u6559\u4f60\u73a9\u4f1a CSS3 3D \u6280\u672f"},"content":{"rendered":"
\u8981\u73a9\u8f6ccss3\u76843d\uff0c\u5c31\u5fc5\u987b\u4e86\u89e3\u51e0\u4e2a\u8bcd\u6c47\uff0c\u4fbf\u662f\u900f\u89c6(perspective<\/span>)\u3001\u65cb\u8f6c(rotate<\/span>)\u548c\u79fb\u52a8(translate<\/span>)\u3002\u900f\u89c6<\/span>\u5373\u662f\u4ee5\u73b0\u5b9e\u7684\u89c6\u89d2\u6765\u770b\u5c4f\u5e55\u4e0a\u76842D\u4e8b\u7269\uff0c\u4ece\u800c\u5c55\u73b03D\u7684\u6548\u679c\u3002\u65cb\u8f6c<\/span>\u5219\u4e0d\u518d\u662f2D\u5e73\u9762\u4e0a\u7684\u65cb\u8f6c\uff0c\u800c\u662f\u4e09\u7ef4\u5750\u6807\u7cfb\u7684\u65cb\u8f6c\uff0c\u5c31\u5305\u62ecX\u8f74\uff0cY\u8f74\uff0cZ\u8f74\u65cb\u8f6c\u3002\u5e73\u79fb<\/span>\u540c\u7406\u3002<\/p>\n \u5f53\u7136\u7528\u7406\u8bba\u6765\u8bf4\u660e\uff0c\u4f30\u8ba1\u4f60\u8fd8\u4e0d\u660e\u767d\u3002\u4e0b\u9762\u662f3\u4e2agif\uff1a<\/p>\n \u65cb\u8f6c\u5e94\u8be5\u6ca1\u95ee\u9898\u4e86\uff0c\u90a3\u7406\u89e3\u5e73\u79fb\u8d77\u6765\u5c31\u6bd4\u8f83\u5bb9\u6613\u4e86\uff0c\u5c31\u662f\u5728\u5728X\u8f74\u3001Y\u8f74\u3001z\u8f74\u79fb\u52a8\u3002<\/p>\n \u4f60\u53ef\u80fd\u4f1a\u8bf4\u900f\u89c6\u6bd4\u8f83\u4e0d\u597d\u7406\u89e3\uff0c\u4e0b\u9762\u6211\u4ecb\u7ecd\u4e00\u4e0b\u900f\u89c6\u7684\u51e0\u4e2a\u5c5e\u6027\u3002<\/p>\n perspective<\/span>\u82f1\u6587\u540d\u4fbf\u662f\u900f\u89c6\uff0c\u6ca1\u6709\u8fd9\u4e1c\u897f\u5c31\u6ca1\u529e\u6cd5\u5f62\u62103D\u6548\u679c\uff0c\u4f46\u662f\u8fd9\u4e2a\u4e1c\u897f\u662f\u600e\u4e48\u8ba9\u6211\u4eec\u6d4f\u89c8\u5668\u5f62\u62103D \u6548\u679c\u7684\u5462\uff0c\u53ef\u4ee5\u770b\u4e0b\u9762\u8fd9\u5f20\u56fe\uff0c\u5176\u5b9e\u5b66\u8fc7\u7ed8\u753b\u7684\u5e94\u8be5\u77e5\u9053\u900f\u89c6\u5173\u7cfb\uff0c\u800c\u8fd9\u91cc\u5c31\u662f\u8fd9\u4e2a\u9053\u7406\u3002<\/p>\n <\/p>\n \u4f46\u662f\u5728css\u91cc\u5b83\u662f\u6709\u6570\u503c\u7684\uff0c\u4f8b\u5982perspective: 1000px<\/span>\u8fd9\u4e2a\u4ee3\u8868\u4ec0\u4e48\u5462\uff1f\u6211\u4eec\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3\uff0c\u5982\u679c\u6211\u4eec\u76f4\u63a5\u773c\u775b\u9760\u7740\u7269\u4f53\u770b\uff0c\u7269\u4f53\u5c31\u8d85\u5927\u5360\u6ee1\u6211\u4eec\u7684\u89c6\u7ebf\uff0c\u6211\u4eec\u79bb\u5b83\u8ddd\u79bb\u8d8a\u6765\u8d8a\u5927\uff0c\u5b83\u5728\u53d8\u5c0f\uff0c\u7acb\u4f53\u611f\u4e5f\u5c31\u51fa\u6765\u4e86\u662f\u4e0d\u662f\uff0c\u5176\u5b9e\u8fd9\u4e2a\u6570\u503c\u6784\u9020\u4e86\u4e00\u4e2a\u6211\u4eec\u773c\u775b\u79bb\u5c4f\u5e55\u7684\u8ddd\u79bb\uff0c\u4e5f\u5c31\u6784\u9020\u4e86\u4e00\u4e2a\u865a\u62df3D\u5047\u8c61\u3002<\/p>\n \u7531\u4e0a\u9762\u6211\u4eec\u4e86\u89e3\u4e86perspective<\/span>\uff0c\u800c\u52a0\u4e0a\u4e86\u8fd9\u4e2aorigin<\/span>\u662f\u4ec0\u4e48\uff0c\u6211\u4eec\u524d\u9762\u8bf4\u7684\u8fd9\u4e2a\u662f\u773c\u775b\u79bb\u7269\u4f53\u7684\u8ddd\u79bb\uff0c\u800c\u8fd9\u4e2a\u5c31\u662f\u773c\u775b\u7684\u89c6\u7ebf\uff0c\u6211\u4eec\u7684\u89c6\u70b9\u7684\u4e0d\u540c\u4f4d\u7f6e\u5c31\u51b3\u5b9a\u4e86\u6211\u4eec\u770b\u5230\u7684\u4e0d\u540c\u666f\u8c61\uff0c\u9ed8\u8ba4\u662f\u4e2d\u5fc3\uff0c\u4e3aperspectice-origin: 50% 50%<\/span>,\u7b2c\u4e00\u4e2a\u6570\u503c\u662f 3D \u5143\u7d20\u6240\u57fa\u4e8e\u7684 X \u8f74\uff0c\u7b2c\u4e8c\u4e2a\u5b9a\u4e49\u5728 y \u8f74\u4e0a\u7684\u4f4d\u7f6e<\/p>\n \u5f53\u4e3a\u5143\u7d20\u5b9a\u4e49 perspective-origin \u5c5e\u6027\u65f6\uff0c\u5176\u5b50\u5143\u7d20\u4f1a\u83b7\u5f97\u900f\u89c6\u6548\u679c\uff0c\u800c\u4e0d\u662f\u5143\u7d20\u672c\u8eab\u3002\u5fc5\u987b\u4e0e perspective \u5c5e\u6027\u4e00\u540c\u4f7f\u7528\uff0c\u800c\u4e14\u53ea\u5f71\u54cd 3D \u8f6c\u6362\u5143\u7d20\u3002(W3school)<\/p><\/blockquote>\n <\/p>\n perspective<\/strong>\u53c8\u6765\u4e86\uff0c\u6ca1\u9519\uff0c\u5b83\u662fcss\u4e2d3D\u7684\u5173\u952e\uff0ctransform-style<\/span>\u9ed8\u8ba4\u662fflat<\/span>\uff0c\u5982\u679c\u4f60\u8981\u5728\u5143\u7d20\u4e0a\u89c6\u7ebf3D\u6548\u679c\u7684\u8bdd\uff0c\u5c31\u5fc5\u987b\u7528\u4e0atransform-style: preserve-3d<\/span>,\u5426\u5219\u5c31\u53ea\u662f\u5e73\u9762\u7684\u53d8\u6362\uff0c\u800c\u4e0d\u662f3D\u7684\u53d8\u6362<\/p>\n \u4ee5\u4e0a\u6211\u4eec\u7a0d\u5fae\u4e86\u89e3\u6982\u5ff5\uff0c\u4e0b\u9762\u5c31\u5f00\u59cb\u5b9e\u6218\u5427\uff01<\/p>\n \u6211\u4eec\u770b\u4e00\u4e2a\u6548\u679c\uff0c\u662f\u4e0d\u662f\u5f88\u9177\u70ab~<\/p>\n <\/p>\n \u5982\u679c\u56fe\u7247\u52a0\u8f7d\u4e0d\u51fa\u6765\uff0c\u5c31\u76f4\u63a5\u8bbf\u95eehttps:\/\/bupt-hjm.github.io\/css3-3d\/<\/a>\uff0c\u89c9\u5f97\u53ef\u4ee5\u7684\u8bdd\u8bb0\u5f97\u7ed9star\u54afhh<\/p><\/blockquote>\n \u5f88\u7b80\u5355\u7684\u4e00\u4e2a\u5bb9\u5668\u5305\u88f9\u7740\u4e00\u4e2a\u88c5\u4e866\u4e2apiece<\/span>\u7684piece-box<\/span><\/p>\n \u901a\u8fc7\u4e0a\u9762\u7684\u8bb2\u89e3\uff0c\u5e94\u8be5\u5bf9perspective<\/span>\u6bd4\u8f83\u719f\u6089\u4e86\u5427,<\/p>\n \u5f53\u7136\uff0c\u5728\u4f60\u5b8c\u6210\u8fd9\u6b65\u4e4b\u540e\u4f60\u8fd8\u662f\u53ea\u770b\u5230\u4e00\u4e2a\u6b63\u65b9\u5f62\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u7684piece-6<\/span>,\u56e0\u4e3a\u6211\u4eec\u76843Dtransform<\/span>\u8fd8\u6ca1\u5f00\u59cb<\/p>\n <\/p>\n \u9996\u5148\u662f\u5b9e\u73b0\u8d70\u9a6c\u706f\uff0c\u6211\u4eec\u5148\u4e0d\u8981\u8ba9\u5b83\u8d70\uff0c\u5148\u5b9e\u73b0\u706f\u90e8\u5206\u3002<\/p>\n \u5982\u4f55\u5b9e\u73b0\u5462\uff1f\u56e0\u4e3a\u8981\u6784\u6210\u4e00\u4e2a\u5706\uff0c\u5706\u662f360\u5ea6\uff0c\u800c\u6211\u4eec\u67096\u4e2apiece\uff0c\u90a3\u4e48\uff0c\u5f88\u5bb9\u6613\u60f3\u5230\uff0c\u6211\u4eec\u9700\u8981\u628a\u6bcf\u4e00\u4e2apiece\u4ee5\u9012\u589e60\u5ea6\u7684\u65b9\u5f0frotateY<\/span>\uff0c\u5c31\u53d8\u6210\u5982\u4e0b<\/p>\n \u8fd9\u91cc\u6211\u4eec\u8fd8\u8981\u6ce8\u610f\u4e00\u70b9\uff0c\u5728\u6211\u4eec\u4f7f\u5143\u7d20\u7ed5Y\u8f74\u65cb\u8f6c\u4ee5\u540e\uff0c\u5176\u5b9eX\u8f74\u548cZ\u8f74\u4e5f\u4f1a\u8ddf\u7740\u65cb\u8f6c\uff0c\u6240\u6240\u4ee5\u6b63\u65b9\u4f53\u7684\u6bcf\u4e2a\u9762\u7684\u5782\u76f4\u7ebf\u8fd8\u662fZ\u8f74\uff0c\u6211\u4eec\u5c31\u53ea\u9700\u8981\u6539\u53d8\u4e0btranslateZ<\/span>\u7684\u503c,\u800c\u5f53translateZ<\/span>\u4e3a\u6b63\u7684\u65f6\u5019\uff0c\u5c31\u671d\u7740\u6211\u4eec\u7684\u65b9\u5411\u8d70\u6765\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u62c9\u5f00\u4e86<\/p><\/blockquote>\n \u4f46\u662f\u62c9\u5f00\u7684\u8ddd\u79bb\u5982\u4f55\u8861\u91cf\uff1f<\/p>\n <\/p>\n \u662f\u4e0d\u662f\u4e00\u76ee\u4e86\u7136\u4e86~<\/p>\n \u4e0b\u9762\u6211\u4eec\u518d\u4fee\u6539\u4e0bcss<\/p>\n \u662f\u4e0d\u662f\u5df2\u7ecf\u5b9e\u73b0\u4e86\u8d70\u9a6c\u706f\u4e86\uff1f<\/p>\n <\/p>\n \u8981\u5b9e\u73b0\u8d70\u9a6c\u706f\u52a8\uff0c\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u6211\u4eec\u53ea\u8981\u5728piece-box<\/span>\u4e0a\u52a0\u4e0a\u65cb\u8f6c\u52a8\u753b\u5c31\u884c\u4e86,5s\u5b8c\u6210\u52a8\u753b\uff0c\u4ece0\u5ea6\u65cb\u8f6c\u5230360\u5ea6<\/p>\n \u8fd9\u91cc\u5c31\u4e0d\u653egif\u4e86~hhh\u662f\u4e0d\u662f\u5b9e\u73b0\u4e86\u9177\u70ab\u7684\u6548\u679c\uff0c\u8fd8\u6ca1\u7ed3\u675f\u54e6~\u66f4\u9177\u70ab\u7684\u6b63\u65b9\u4f53\u7ec4\u88c5<\/p>\n \u6b63\u65b9\u4f53\uff0c\u5176\u5b9e\u4e5f\u4e0d\u96be\u5b9e\u73b0\uff0c\u6211\u8fd9\u91cc\u5c31\u4e0d\u5f88\u8be6\u7ec6\u8bf4\u4e86\uff0c\u4f60\u9996\u5148\u53ef\u4ee5\u60f3\u8c61\u4e00\u4e2a\u9762\uff0c\u7136\u540e\u53bb\u62d3\u5c55\u5176\u4ed6\u9762\u5982\u4f55\u53bb\u5b9e\u73b0\uff0c\u6bd4\u5982\u6211\u4eec\u628a\u6b63\u65b9\u4f53\u7684\u524d\u9762translateZ(100px\uff09<\/span>\u8ba9\u5b83\u9760\u8fd1\u6211\u4eec100px,\u7136\u540e\u540e\u9762translateZ(-100px\uff09<\/span>\u8ba9\u5b83\u8fdc\u79bb\u6211\u4eec100px,\u5de6\u8fb9\u662f\u5148translateX(-100px<\/span>\u518drotateY(90deg)<\/span>,\u53f3\u8fb9\u5c31\u662ftranslateX(100px)<\/span>\u518drotateY(90deg)<\/span>,\u4e0a\u9762\u662f\u5148translateY(-100px)<\/span>\uff0crotateX(90deg)<\/span>\uff0c\u4e0b\u9762\u662f\u5148translateY(100px)<\/span>\uff0crotateX(90deg)<\/span>\uff0c\u53ea\u8981\u6211\u4eec\u5199\u8fdb\u52a8\u753b\uff0c\u4e00\u5207\u5c31\u5927\u529f\u544a\u6210\u3002<\/p><\/blockquote>\n css\u5c31\u4e3a\u5982\u4e0b\uff0c\u4ee5\u4e0b\u5c31\u53ea\u653epiece1<\/span>\uff0c\u5176\u4ed6\u8bfb\u8005\u53ef\u4ee5\u81ea\u5df1\u7c7b\u6bd4\u5b9e\u73b0\uff0c\u6216\u8005\u770b\u6211github\u7684\u6e90\u7801<\/p>\n \u7ec6\u5fc3\u7684\u8bfb\u8005\u53ef\u4ee5\u53d1\u73b0\u6211\u7528\u4e86\u4e00\u4e2aanimation-fill-mode: forwards;<\/span>,\u8fd9\u4e2a\u5176\u5b9e\u5c31\u662f\u8ba9\u8fd9\u4e9bpiece<\/span>\u4fdd\u6301\u52a8\u753b\u6700\u540e\u7684\u6548\u679c\uff0c\u4e5f\u5c31\u662f\u6b63\u65b9\u4f53\u7684\u6548\u679c\uff0c\u8bfb\u8005\u53ef\u4ee5\u4e0d\u52a0\u8bd5\u8bd5\u770b\uff0c\u90a3\u8fd8\u662f\u4f1a\u6062\u590d\u539f\u6837\u3002<\/p><\/blockquote>\n \u6700\u540e\u5c31\u662f\u6b63\u65b9\u4f53\u7684\u65cb\u8f6c\u4e86\uff0c\u524d\u9762\u6211\u4eec\u7684\u5bb9\u5668\u5df2\u7ecf\u7528\u8fc7animation<\/span>\u4e86,\u8bfb\u8005\u53ef\u80fd\u4f1a\u60f3\u6211\u518d\u52a0\u4e2aclass\u653eanimaiton<\/span>\u4e0d\u5c31\u884c\u4e86\uff0chhh\uff0canimaiton<\/span>\u4f1a\u8986\u76d6\u6389\u524d\u9762\u7684\uff0c\u90a3\u524d\u9762\u7684\u8d70\u9a6c\u706f\u7684\u52a8\u753b\u5c31\u6ca1\u4e86\uff0c\u6240\u4ee5\u5728html\u7ed3\u6784\u4e2d\uff0c\u6211\u518d\u52a0\u4e86\u4e00\u4e2abox<\/span>\u5305\u88f9piece<\/span>, \u5982\u4e0b<\/p>\n \u5728\u52a8\u753b\u4e0a\u6211\u4eec\u53ef\u4ee5\u63a7\u5236\u6b63\u65b9\u4f53\u52a8\u753b\u7684\u5ef6\u65f6\u65f6\u95f4\uff0c\u5c31\u662f\u7b49\u5230\u6b63\u65b9\u4f53\u7ec4\u88c5\u5b8c\u6210\u540e\u518d\u5f00\u59cb\u52a8\u753b<\/p>\n animation: boxRotate 5s 10s infinite;<\/span>\u7b2c\u4e00\u4e2a5s\u662f\u52a8\u753b\u65f6\u957f\uff0c\u7b2c\u4e8c\u4e2a10s\u662f\u5ef6\u65f6\u65f6\u95f4\uff0c\u7136\u540e\u6211\u4eec\u8ba9\u6b63\u65b9\u4f53\u7684\u65cb\u8f6c\uff0c\u7ed5X\u8f74\u4ece0\u5ea6\u5230360\u5ea6,\u7ed5Y\u8f74\u4e5f0\u5230Y\u8f74360\u5ea6\u3002<\/p>\n \u6700\u540e\u6548\u679c\uff0c\u5927\u529f\u544a\u6210\uff01<\/p>\n <\/p>\n \u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.codeceo.com\/article\/css3-3d-learn.html<\/a><\/p>\n\n
\n<\/li>\n
\n<\/li>\n
\n<\/li>\n<\/ul>\n<div class=\"container\">\r\n <div class=\"piece-box\">\r\n <div class=\"piece piece-1\"><\/div>\r\n <div class=\"piece piece-2\"><\/div>\r\n <div class=\"piece piece-3\"><\/div>\r\n <div class=\"piece piece-4\"><\/div>\r\n <div class=\"piece piece-5\"><\/div>\r\n <div class=\"piece piece-6\"><\/div>\r\n <\/div>\r\n<\/div><\/pre>\n
\/*\u5bb9\u5668*\/\r\n.container {\r\n -webkit-perspective: 1000px;\r\n -moz-perspective: 1000px;\r\n -ms-perspective: 1000px;\r\n perspective: 1000px;\r\n}\r\n\/*piece\u76d2\u5b50*\/\r\n .piece-box {\r\n perspective-origin: 50% 50%;\r\n -webkit-transform-style: preserve-3d;\r\n -moz-transform-style: preserve-3d;\r\n -ms-transform-style: preserve-3d;\r\n transform-style: preserve-3d;\r\n}<\/pre>\n
\/*\u5bb9\u5668*\/\r\n.container {\r\n -webkit-perspective: 1000px;\r\n -moz-perspective: 1000px;\r\n -ms-perspective: 1000px;\r\n perspective: 1000px;\r\n}\r\n\/*piece\u76d2\u5b50*\/\r\n.piece-box {\r\n position: relative;\r\n width: 200px;\r\n height: 200px;\r\n margin: 300px auto;\r\n perspective-origin: 50% 50%;\r\n -webkit-transform-style: preserve-3d;\r\n -moz-transform-style: preserve-3d;\r\n -ms-transform-style: preserve-3d;\r\n transform-style: preserve-3d;\r\n}\r\n\/*piece\u901a\u7528\u6837\u5f0f*\/\r\n.piece {\r\n position: absolute;\r\n width: 200px;\r\n height: 200px;\r\n background: red;\r\n opacity: 0.5;\r\n\r\n}\r\n.piece-1 {\r\n background: #FF6666;\r\n\r\n}\r\n.piece-2 {\r\n background: #FFFF00;\r\n}\r\n.piece-3 {\r\n background: #006699;\r\n}\r\n.piece-4 {\r\n background: #009999;\r\n}\r\n.piece-5 {\r\n background: #FF0033;\r\n}\r\n.piece-6 {\r\n background: #FF6600;\r\n}<\/pre>\n
\n\u5982\u4f55\u628a\u4ed6\u4eec\u4ece\u4e2d\u5fc3\u62c9\u5f00\u5462\uff1f<\/p>\n.piece-1 {\r\n background: #FF6666;\r\n -webkit-transform: rotateY(0deg) translateZ(173.2px);\r\n -ms-transform: rotateY(0deg) translateZ(173.2px);\r\n -o-transform: rotateY(0deg) translateZ(173.2px);\r\n transform: rotateY(0deg) translateZ(173.2px);\r\n\r\n}\r\n.piece-2 {\r\n background: #FFFF00;\r\n -webkit-transform: rotateY(60deg) translateZ(173.2px);\r\n -ms-transform: rotateY(60deg) translateZ(173.2px);\r\n -o-transform: rotateY(60deg) translateZ(173.2px);\r\n transform: rotateY(60deg) translateZ(173.2px);\r\n}\r\n.piece-3 {\r\n background: #006699;\r\n -webkit-transform: rotateY(120deg) translateZ(173.2px);\r\n -ms-transform: rotateY(120deg) translateZ(173.2px);\r\n -o-transform: rotateY(120deg) translateZ(173.2px);\r\n transform: rotateY(120deg) translateZ(173.2px);\r\n}\r\n.piece-4 {\r\n background: #009999;\r\n -webkit-transform: rotateY(180deg) translateZ(173.2px);\r\n -ms-transform: rotateY(180deg) translateZ(173.2px);\r\n -o-transform: rotateY(180deg) translateZ(173.2px);\r\n transform: rotateY(180deg) translateZ(173.2px);\r\n}\r\n.piece-5 {\r\n background: #FF0033;\r\n -webkit-transform: rotateY(240deg) translateZ(173.2px);\r\n -ms-transform: rotateY(240deg) translateZ(173.2px);\r\n -o-transform: rotateY(240deg) translateZ(173.2px);\r\n transform: rotateY(240deg) translateZ(173.2px);\r\n}\r\n.piece-6 {\r\n background: #FF6600;\r\n -webkit-transform: rotateY(300deg) translateZ(173.2px);\r\n -ms-transform: rotateY(300deg) translateZ(173.2px);\r\n -o-transform: rotateY(300deg) translateZ(173.2px);\r\n transform: rotateY(300deg) translateZ(173.2px);\r\n}<\/pre>\n
\/*piece\u76d2\u5b50*\/\r\n.piece-box {\r\n position: relative;\r\n width: 200px;\r\n height: 200px;\r\n margin: 300px auto;\r\n perspective-origin: 50% 50%;\r\n -webkit-transform-style: preserve-3d;\r\n -moz-transform-style: preserve-3d;\r\n -ms-transform-style: preserve-3d;\r\n transform-style: preserve-3d;\r\n animation: pieceRotate 5s;\r\n -moz-animation: pieceRotate 5s; \/* Firefox *\/\r\n -webkit-animation: pieceRotate 5s; \/* Safari and Chrome *\/\r\n -o-animation: pieceRotate 5s ; \/* Opera *\/\r\n}\r\n\/*\u8d70\u9a6c\u706f\u52a8\u753b*\/\r\n@keyframes pieceRotate\r\n{\r\n0% {-webkit-transform: rotateY(0deg);\r\n -ms-transform: rotateY(0deg);\r\n -o-transform: rotateY(0deg);\r\n transform: rotateY(0deg);}\r\n100% {-webkit-transform: rotateY(360deg);\r\n -ms-transform: rotateY(360deg);\r\n -o-transform: rotateY(360deg);\r\n transform: rotateY(360deg);}\r\n}\r\n\/* Firefox *\/\r\n@-moz-keyframes pieceRotate\r\n{\r\n0% {-webkit-transform: rotateY(0deg);\r\n -ms-transform: rotateY(0deg);\r\n -o-transform: rotateY(0deg);\r\n transform: rotateY(0deg);}\r\n100% {-webkit-transform: rotateY(360deg);\r\n -ms-transform: rotateY(360deg);\r\n -o-transform: rotateY(360deg);\r\n transform: rotateY(360deg);}\r\n}\r\n\/* Safari and Chrome *\/\r\n@-webkit-keyframes pieceRotate\r\n{\r\n0% {-webkit-transform: rotateY(0deg);\r\n -ms-transform: rotateY(0deg);\r\n -o-transform: rotateY(0deg);\r\n transform: rotateY(0deg);}\r\n100% {-webkit-transform: rotateY(360deg);\r\n -ms-transform: rotateY(360deg);\r\n -o-transform: rotateY(360deg);\r\n transform: rotateY(360deg);}\r\n}\r\n\/* Opera *\/\r\n@-o-keyframes pieceRotate\r\n{\r\n0% {-webkit-transform: rotateY(0deg);\r\n -ms-transform: rotateY(0deg);\r\n -o-transform: rotateY(0deg);\r\n transform: rotateY(0deg);}\r\n100% {-webkit-transform: rotateY(360deg);\r\n -ms-transform: rotateY(360deg);\r\n -o-transform: rotateY(360deg);\r\n transform: rotateY(360deg);}\r\n}<\/pre>\n
.piece-1 {\r\n background: #FF6666;\r\n -webkit-transform: rotateY(0deg) translateZ(173.2px);\r\n -ms-transform: rotateY(0deg) translateZ(173.2px);\r\n -o-transform: rotateY(0deg) translateZ(173.2px);\r\n transform: rotateY(0deg) translateZ(173.2px);\r\n animation: piece1Rotate 5s 5s;\r\n -moz-animation: piece1Rotate 5s 5s; \/* Firefox *\/\r\n -webkit-animation: piece1Rotate 5s 5s; \/* Safari and Chrome *\/\r\n -o-animation: piece1Rotate 5s 5s; \/* Opera *\/\r\n -webkit-animation-fill-mode: forwards; \/* Chrome, Safari, Opera *\/\r\n animation-fill-mode: forwards;\r\n }\r\n\/*front*\/\r\n @keyframes piece1Rotate\r\n {\r\n 0% {-webkit-transform: rotateY(0deg) translateZ(173.2px);\r\n -ms-transform: rotateY(0deg) translateZ(173.2px);\r\n -o-transform: rotateY(0deg) translateZ(173.2px);\r\n transform: rotateY(0deg) translateZ(173.2px);}\r\n 100% {-webkit-transform: rotateY(0deg) translateZ(100px);\r\n -ms-transform: rotateY(0deg) translateZ(100px);\r\n -o-transform: rotateY(0deg) translateZ(100px);\r\n transform: rotateY(0deg) translateZ(100px);}\r\n }\r\n \/* Firefox *\/\r\n @-moz-keyframes piece1Rotate\r\n {\r\n 0% {-webkit-transform: rotateY(0deg) translateZ(173.2px);\r\n -ms-transform: rotateY(0deg) translateZ(173.2px);\r\n -o-transform: rotateY(0deg) translateZ(173.2px);\r\n transform: rotateY(0deg) translateZ(173.2px);}\r\n 100% {-webkit-transform: rotateY(0deg) translateZ(100px);\r\n -ms-transform: rotateY(0deg) translateZ(100px);\r\n -o-transform: rotateY(0deg) translateZ(100px);\r\n transform: rotateY(0deg) translateZ(100px);}\r\n }\r\n \/* Safari and Chrome *\/\r\n @-webkit-keyframes piece1Rotate\r\n {\r\n 0% {-webkit-transform: rotateY(0deg) translateZ(173.2px);\r\n -ms-transform: rotateY(0deg) translateZ(173.2px);\r\n -o-transform: rotateY(0deg) translateZ(173.2px);\r\n transform: rotateY(0deg) translateZ(173.2px);}\r\n 100% {-webkit-transform: rotateY(0deg) translateZ(100px);\r\n -ms-transform: rotateY(0deg) translateZ(100px);\r\n -o-transform: rotateY(0deg) translateZ(100px);\r\n transform: rotateY(0deg) translateZ(100px);}\r\n }\r\n \/* Opera *\/\r\n @-o-keyframes piece1Rotate\r\n {\r\n 0% {-webkit-transform: rotateY(0deg) translateZ(173.2px);\r\n -ms-transform: rotateY(0deg) translateZ(173.2px);\r\n -o-transform: rotateY(0deg) translateZ(173.2px);\r\n transform: rotateY(0deg) translateZ(173.2px);}\r\n 100% {-webkit-transform: rotateY(0deg) translateZ(100px);\r\n -ms-transform: rotateY(0deg) translateZ(100px);\r\n -o-transform: rotateY(0deg) translateZ(100px);\r\n transform: rotateY(0deg) translateZ(100px);}\r\n }<\/pre>\n
<div class=\"container\">\r\n <div class=\"piece-box\">\r\n <div class=\"piece-box2\"><!--\u65b0\u52a0\u7684\u5bb9\u5668-->\r\n <div class=\"piece piece-1\"><\/div>\r\n <div class=\"piece piece-2\"><\/div>\r\n <div class=\"piece piece-3\"><\/div>\r\n <div class=\"piece piece-4\"><\/div>\r\n <div class=\"piece piece-5\"><\/div>\r\n <div class=\"piece piece-6\"><\/div>\r\n <\/div>\r\n <\/div>\r\n<\/div><\/pre>\n
.piece-box2 {\r\n -webkit-transform-style: preserve-3d;\r\n -moz-transform-style: preserve-3d;\r\n -ms-transform-style: preserve-3d;\r\n transform-style: preserve-3d;\r\n animation: boxRotate 5s 10s infinite;\r\n -moz-animation: boxRotate 5s 10s infinite; \/* Firefox *\/\r\n -webkit-animation: boxRotate 5s 10s infinite; \/* Safari and Chrome *\/\r\n -o-animation: boxRotate 5s 10s infinite; \/* Opera *\/\r\n}\r\n\/*\u6b63\u65b9\u4f53\u65cb\u8f6c\u52a8\u753b*\/\r\n@keyframes boxRotate\r\n{\r\n0% {-webkit-transform: rotateX(0deg) rotateY(0deg););\r\n -ms-transform: rotateX(0deg) rotateY(0deg););\r\n -o-transform: rotateX(0deg) rotateY(0deg););\r\n transform: rotateX(0deg) rotateY(0deg););}\r\n100% {-webkit-transform: rotateX(360deg) rotateY(360deg);\r\n -ms-transform: rotateX(360deg) rotateY(360deg);\r\n -o-transform: rotateX(360deg) rotateY(360deg);\r\n transform: rotateX(360deg) rotateY(360deg);}\r\n}\r\n\/* Firefox *\/\r\n@-moz-keyframes boxRotate\r\n{\r\n0% {-webkit-transform: rotateX(0deg) rotateY(0deg););\r\n -ms-transform: rotateX(0deg) rotateY(0deg););\r\n -o-transform: rotateX(0deg) rotateY(0deg););\r\n transform: rotateX(0deg) rotateY(0deg););}\r\n100% {-webkit-transform: rotateX(360deg) rotateY(360deg);\r\n -ms-transform: rotateX(360deg) rotateY(360deg);\r\n -o-transform: rotateX(360deg) rotateY(360deg);\r\n transform: rotateX(360deg) rotateY(360deg);}\r\n}\r\n\/* Safari and Chrome *\/\r\n@-webkit-keyframes boxRotate\r\n{\r\n0% {-webkit-transform: rotateX(0deg) rotateY(0deg););\r\n -ms-transform: rotateX(0deg) rotateY(0deg););\r\n -o-transform: rotateX(0deg) rotateY(0deg););\r\n transform: rotateX(0deg) rotateY(0deg););}\r\n100% {-webkit-transform: rotateX(360deg) rotateY(360deg);\r\n -ms-transform: rotateX(360deg) rotateY(360deg);\r\n -o-transform: rotateX(360deg) rotateY(360deg);\r\n transform: rotateX(360deg) rotateY(360deg);}\r\n}\r\n\/* Opera *\/\r\n@-o-keyframes boxRotate\r\n{\r\n0% {-webkit-transform: rotateX(0deg) rotateY(0deg););\r\n -ms-transform: rotateX(0deg) rotateY(0deg););\r\n -o-transform: rotateX(0deg) rotateY(0deg););\r\n transform: rotateX(0deg) rotateY(0deg););}\r\n100% {-webkit-transform: rotateX(360deg) rotateY(360deg);\r\n -ms-transform: rotateX(360deg) rotateY(360deg);\r\n -o-transform: rotateX(360deg) rotateY(360deg);\r\n transform: rotateX(360deg) rotateY(360deg);}\r\n}<\/pre>\n
\n