Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
Mosaica
css
@import url("https://fonts.googleapis.com/css?family=Montserrat:200"); * { box-sizing: border-box; } body { padding: 0; margin: 0; background: #212121; overflow: hidden; } .mosaica { position: fixed; left: 2px; bottom: 2px; padding: 4px 6px; color: #FFFFFF; font-family: "Montserrat"; font-size: 11px; letter-spacing: 0.06em; } .container { position: absolute; width: 0; height: 0; left: 50%; top: 50%; perspective: 1200px; transform-origin: center center; cursor: move; } .plane { position: absolute; display: block; width: 900px; height: 700px; border: 0; margin: -350px 0 0 -450px; transform-style: preserve-3d; } .plane:before { content: ""; position: absolute; left: 0; top: 0; background: rgba(0, 0, 0, 0.3); width: 100%; height: 100%; z-index: -1; transform: translateZ(-1px); } .items { position: relative; background: red; transform-style: preserve-3d; } .item { background-color: #3B93EA; position: absolute; overflow: hidden; border: 1px solid #2785db; } @keyframes animate { 0% { transform: translate3d(0px, 0px, 0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale3d(1, 1, 1); transform-origin: 50% 50% 0; opacity: 1; } 100% { transform: translate3d(0px, 0px, 1200px) rotateX(180deg) rotateY(360deg) rotateZ(180deg) scale3d(0, 0, 0); transform-origin: 50% 50% 0; opacity: 1; } } .item.animate { transform: translate3d(0px, 0px, 0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale3d(1, 1, 1); transform-origin: 50% 50% 0; animation: animate 3s forwards; }
JavaScript
class Orbit { constructor(target, dumping=10, from={ x: 0, y: 0 }, to={ x: 0, y: 0 }) { this.__target = target this.dumping = dumping; this.desire_rotateZ = -to.y; this.desire_rotateX = -to.x; this.rz = from.y; this.rx = from.x; this.isDragging = false; this.previousMousePosition = { x: 0, y: 0 }; this.behaviours(); } behaviours(){ $(document).on("mousedown", this.handleDown.bind(this)) $(document).on("mouseup", this.handleUp.bind(this)) $(document).on("mousemove", this.handleMove.bind(this)) window.requestAnimationFrame(this.update.bind(this)); } handleDown(e){ this.isDragging = true; if( !this.firstDrag ){ this.previousMousePosition = { x: e.pageX, y: e.pageY } this.firstDrag = true; } } handleUp(e){ this.isDragging = false; } handleMove(e){ let deltaMove = { x: e.pageX-this.previousMousePosition.x, y: e.pageY-this.previousMousePosition.y }; if(this.isDragging){ this.desire_rotateZ += deltaMove.x; this.desire_rotateX += deltaMove.y; } this.previousMousePosition = { x: e.pageX, y: e.pageY }; } rotation(x, y){ this.desire_rotateZ = x; this.desire_rotateX = y; } update(){ this.rz += (( (this.desire_rotateZ*-1) - this.rz) / this.dumping); this.rx += (( (this.desire_rotateX*-1) - this.rx) / this.dumping); this.__target.css({ "transform": "translateZ(-300px) rotateX("+this.rx+"deg) rotateZ("+this.rz+"deg)" }) window.requestAnimationFrame(this.update.bind(this)); } } let orbit1 = new Orbit( $("#plane1"), 40, { x: 0, y: 0 }, { x: 40, y: 30 } ) function animate(){ $(".item").removeClass("animate") setTimeout(function(){ $(".item").addClass("animate") }, 250) setTimeout(animate, 6000); } animate()
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Mosaica 3D css-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号