three实现4种三维模型卡片动态动画展示效果代码
代码语言:html
所属分类:三维
代码描述:three实现4种三维模型卡片动态动画展示效果代码,包含新冠病毒、蚂蚁、海象、人类心脏三维动画展示。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <script type="importmap"> { "imports": { "three": "//repo.bfw.wiki/bfwrepo/js/module/three/build/164/three.module.js", "three/addons/": "//repo.bfw.wiki/bfwrepo/js/module/three/examples/164/jsm/" } } </script> <script src="https://kit.fontawesome.com/ddff61d36a.js" crossorigin="anonymous"></script> <script src="https://unpkg.com/@dotlottie/player-component@latest/dist/dotlottie-player.mjs" type="module"></script> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/bootstrap.5.3.0.css"> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/bootstrap.bundle.5.3.2.js"></script> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet"> <style> body { font-family: Poppins; padding: 0 20px; } .hr-line { border-top: 1px solid transparent; background: linear-gradient(white, white) padding-box, linear-gradient(90deg, White, DimGrey, White) border-box; } p { font-weight: 200; } a { text-decoration: none; } /* Simple loader indicating status while 3d model is loading */ .loader { position: absolute; width: 250px; height: 250px; margin: 0; padding: 0; top: 10px; left: 15px; background-color: transparent; border: 4px dashed Dodgerblue; border-radius: 50%; font-weight: bold; color: DodgerBlue; text-align: center; } /* --- Card CSS --- */ .card-3d { min-width: 280px; max-width: 860px; margin: 0 auto; background-image: radial-gradient(#404040, black); border: 1px solid WhiteSmoke; outline: 8px solid black; border-radius: 15px; box-shadow: 0 15px 15px LightGrey; } .card-3d-body { padding: 30px 15px 30px 15px; color: Whitesmoke; } .card-3d-title { font-size: 24px; font-weight: 600; text-wrap: balance; } .object-3d { position: relative; width: 280px; height: 280px; padding: 0; } .webgl { position: relative; transition: all; cursor: grab; } #webgl-1 { filter: drop-shadow(0px 30px 20px Black); } #webgl-2 { filter: drop-shadow(0px 60px 25px Black); } #webgl-3 { filter: drop-shadow(0px 50px 35px Black); } #webgl-4 { filter: drop-shadow(0px 50px 35px Black); } dotlottie-player { position: relative; display: inline-block; top: 12px; width: 35px; height: 35px; filter: brightness(80%); } .responsive { width: 100% !important; height: 100% !important; } .animate { animation: animate 3s ease-in-out; } @keyframes animate { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 100%; } } /* Quick fix to make loader and model smaller on mobile so that there is space on the side for scrolling down*/ @media screen and (max-width: 383px) { .card-3d-title { margin-top: 20px; text-align: center; } #webgl-1 { width: 180px !important; height: 180px !important; } #webgl-2 { width: 200px !important; height: 200px !important; } #webgl-3 { width: 200px !important; height: 200px !important; } #webgl-4 { width: 200px !important; height: 200px !important; } .object-3d { width: 180px !important; height: 180px !important; } .loader { width: 180px !important; height: 180px !important; top: -2px; left: 2px; } } </style> </head> <body> <!-- partial:index.partial.html --> <h4 class="fw-bold text-center mt-4"><i class="fa-brands fa-unity fa-lg mt-5 .........完整代码请登录后点击上方下载按钮下载查看
网友评论0