博客园美化 —— 旋转立方体效果
博客园美化,旋转立方体
可自行调整位置,并替换图片,示例代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>立方体效果</title>
<style type="text/css">
.wrap {
width: 120px;
height: 200px;
margin: 20px;
position: fixed;
top: 200px;
right: 600px;
display: table-cell;
vertical-align: middle;
text-align: center;
z-index: 22;
}
.cube {
width: 120px;
height: 120px;
margin: 0 auto;
transform-style: preserve-3d;
transform: rotateX(-30deg) rotateY(-80deg);
animation: rotate linear 20s infinite;
}
@-webkit-keyframes rotate {
from {
transform: rotateX(0deg) rotateY(0deg);
}
to {
transform: rotateX(360deg) rotateY(360deg);
}
}
.cube div {
position: absolute;
width: 120px;
height: 120px;
opacity: 0.8;
transition: all .4s;
}
.cube .out_front {
transform: rotateY(0deg) translateZ(60px);
}
.cube .out_back {
transform: translateZ(-60px) rotateY(180deg);
}
.cube .out_left {
transform: rotateY(-90deg) translateZ(60px);
}
.cube .out_right {
transform: rotateY(90deg) translateZ(60px);
}
.cube .out_top {
transform: rotateX(90deg) translateZ(60px);
}
.cube .out_bottom {
transform: rotateX(-90deg) translateZ(60px);
}
</style>
</head>
<body>
<div class="wrap">
<div class="cube">
<div class="out_front"><img src="https://files-cdn.cnblogs.com/files/cjsblog/cube01.bmp" class="pic"/></div>
<div class="out_back"><img src="https://files-cdn.cnblogs.com/files/cjsblog/cube02.bmp" class="pic"/></div>
<div class="out_left"><img src="https://files-cdn.cnblogs.com/files/cjsblog/cube03.bmp" class="pic"/></div>
<div class="out_right"><img src="https://files-cdn.cnblogs.com/files/cjsblog/cube04.bmp" class="pic"/></div>
<div class="out_top"><img src="https://files-cdn.cnblogs.com/files/cjsblog/cube05.bmp" class="pic"/></div>
<div class="out_bottom"><img src="https://files-cdn.cnblogs.com/files/cjsblog/cube06.bmp" class="pic"/></div>
</div>
</div>
</body>
</html>
博客设置
将CSS代码粘贴到“页面定制CSS代码”区域,将 div 放到 “博客侧边栏公告”区域
欢迎各位转载,但必须在文章页面中给出作者和原文链接!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix