HTML+CSS+JS实现 ❤️3D方块弹跳动画特效❤️

效果演示:  

代码目录:

主要代码实现:

部分CSS样式:

*,
*::before,
*::after {padding: 0;margin: 0 auto;box-sizing: border-box;transform-style: preserve-3d;
}body {background-color: black;min-height: 100vh;display: flex;justify-content: center;align-items: center;font-size: 50px;perspective: 16em;
}.scene {position: relative;-webkit-animation: sceneRotate 30s infinite linear;animation: sceneRotate 30s infinite linear;
}@-webkit-keyframes sceneRotate {to {transform: rotateY(360deg);}
}@keyframes sceneRotate {to {transform: rotateY(360deg);}
}.cube {position: absolute;width: 2em;height: 2em;-webkit-animation: cubeBounce 4s infinite ease-out, cubeLeft 4s infinite linear, cubeHeight 4s infinite ease-out;animation: cubeBounce 4s infinite ease-out, cubeLeft 4s infinite linear, cubeHeight 4s infinite ease-out;
}.cube:nth-child(2) {-webkit-animation-delay: -2s;animation-delay: -2s;
}.cube:nth-child(2)>* {background-color: lightgreen;
}@-webkit-keyframes cubeBounce {0%,40% {bottom: calc(-3em + 2px);transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);}70% {bottom: 1em;-webkit-animation-timing-function: ease-in;animation-timing-function: ease-in;}100% {bottom: calc(-3em + 2px);transform: rotateX(90deg) rotateY(180deg) rotateZ(180deg);}
}@keyframes cubeBounce {0%,40% {bottom: calc(-3em + 2px);transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);}70% {bottom: 1em;-webkit-animation-timing-function: ease-in;animation-timing-function: ease-in;}100% {bottom: calc(-3em + 2px);transform: rotateX(90deg) rotateY(180deg) rotateZ(180deg);}
}@-webkit-keyframes cubeHeight {0%,10%,30%,40%,100% {height: 2em;}5%,35% {height: 1.5em;-webkit-animation-timing-function: ease-in;animation-timing-function: ease-in;}
}@keyframes cubeHeight {0%,10%,30%,40%,100% {height: 2em;}5%,35% {height: 1.5em;-webkit-animation-timing-function: ease-in;animation-timing-function: ease-in;}
}@-webkit-keyframes cubeLeft {0%,100% {left: -4em;}40% {left: 2em;-webkit-animation-timing-function: ease-in;animation-timing-function: ease-in;}
}@keyframes cubeLeft {0%,100% {left: -4em;}40% {left: 2em;-webkit-animation-timing-function: ease-in;animation-timing-function: ease-in;}
}.cube>* {position: absolute;width: 100%;height: 100%;background-color: lightblue;opacity: 0.9;box-shadow: 0 0 1em #000 inset;
}.cube .front {transform: translateZ(1em);
}.cube .right {transform: rotateY(90deg) translateZ(1em);
}.cube .back {transform: rotateY(180deg) translateZ(1em);
}.cube .left {transform: rotateY(270deg) translateZ(1em);
}.cube .top {width: 2em;height: 2em;background-image: linear-gradient(90deg, #0000, #0009 25% 75%, #0000);background-size: 4em 2em;background-repeat: no-repeat;transform: rotateX(90deg) translateZ(1em);-webkit-animation: topShadow 4s infinite linear;animation: topShadow 4s infinite linear;-webkit-animation-delay: inherit;animation-delay: inherit;
}@-webkit-keyframes topShadow {0%,10% {background-position-x: 2em;}40%,100% {background-position-x: -6em;}
}@keyframes topShadow {0%,10% {background-position-x: 2em;}40%,100% {background-position-x: -6em;}
}.cube .bottom {width: 2em;height: 2em;bottom: 0;transform: rotateX(270deg) translateZ(1em);
}.cubeShadow {position: absolute;top: 50%;width: 2em;height: 2em;background-color: #0007;box-shadow: 0 0 1em #000;-webkit-animation: cubeShadow 4s infinite ease-out, shadowLeft 4s infinite linear;animation: cubeShadow 4s infinite ease-out, shadowLeft 4s infinite linear;
}.cubeShadow:nth-child(2) {-webkit-animation-delay: -2s;animation-delay: -2s;
}@-webkit-keyframes cubeShadow {0%,40% {opacity: 0.8;transform: translateY(-50%) rotate(90deg) translateZ(1px) scale(1);}70% {opacity: 0.3;transform: translateY(-50%) rotate(30deg) translateZ(1px) scale(2);-webkit-animation-timing-function: ease-in;animation-timing-function: ease-in;}

HTML代码 :

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><title> Tikal Demo</title><link rel="stylesheet" href="css/style.css"></head><body><div class="scene"><!--   <div class="ball"></div> --><div class="cube"><div class="top"></div><div class="front"></div><div class="back"></div><div class="right"></div><div class="left"></div><div class="bottom"></div></div><div class="cube"><div class="top"></div><div class="front"></div><div class="back"></div><div class="right"></div><div class="left"></div><div class="bottom"></div></div><div class="floor"><!--     <div class="ballShadow"></div> --><div class="cubeShadow"></div><div class="cubeShadow"></div></div></div></body></html>

源码获取

查看博主主页或私信博主获取

精彩推荐更新中:

HTML5大作业实战100套

  打卡 文章 更新  40  /  100天

大家可以点赞、收藏、关注、评论我啦 、需要完整文件随时联系我或交流哟~!

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/562061.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

HTML+CSS+JS实现 ❤️520爱心背景表白网页动画特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; 部分HTML代码 : <!DOCTYPE html> <html><head><meta http-equiv"Content-Type" content"text/html; charsetUTF-8"><title>好朋友-相册</title&…

HTML+CSS+JS实现 ❤️three 3D铅笔绘图工具特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; 部分CSS样式&#xff1a; #mfPreviewBar {display: none !important; }html, body {position: fixed;overflow: hidden;touch-action: none; }body {background-color: #f7f4f0;cursor: url("http…

mysql linux改密码忘记了怎么办_linux上mysql改密码忘了怎么办?

解决方法&#xff1a;1、在my.cnf中&#xff0c;增加“[mysqld]”和“skip-grant-tables”2行代码&#xff0c;用于登录时跳过密码验证&#xff1b;2、启动mysql服务&#xff0c;并登录mysql&#xff1b;3、连接mysql数据库&#xff0c;使用UPDATE命令修改用户密码即可。linux上…

HTML+CSS+JS实现 ❤️透明的水滴文字背景特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; 部分CSS样式&#xff1a; import url(https://fonts.googleapis.com/css2?familyMontserrat:wght100&displayswap); import url(https://fonts.googleapis.com/css2?familyPoppins:wght900&d…

HTML+CSS+JS实现 ❤️3D旋转魔方图片相册特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; 部分CSS样式&#xff1a; background: url(../img/s3.jpg);background-size: 100% 100%;opacity: 0.8;transform: rotateY(90deg) translateZ(200px); }.box .box1 .left {background: url(../img/s4.jp…

HTML+CSS+JS实现 ❤️响应式的幸运大转盘❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; 部分CSS样式&#xff1a; .winnerBox {max-width: 40rem;padding: 30px;margin: 30px auto;/*height: calc(100vh - 98px);*//*background-color: #fd6504 #9470fd;*/background: linear-gradient(to b…

maya python 开根号_maya python

胡泳滨MayaPython简易教程&#xff0c;如需转载&#xff0c;请标明出处地址&#xff1a;http://huyongbin.blogbus.com/c3363976/谢谢配合&#xff01;MayaPython第一篇 - 介绍大家好&#xff0c;这是一个简易的MAYA PYTHON学习教程。简易教程的目的是可以让更多的人快速掌握这…

HTML+CSS+JS实现 ❤️发光的线条爱心形状动画特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; 部分CSS样式&#xff1a; body {background-color: #000;margin: 0;overflow: hidden;background-repeat: no-repeat; } HTML代码 : <!DOCTYPE html> <html lang"en"><head…

mysql 钩子_面试官: 什么是 Hook (钩子) 线程以及应用场景?

一、Hook 线程介绍通常情况下&#xff0c;我们可以向应用程序注入一个或多个 Hook (钩子) 线程&#xff0c;这样&#xff0c;在程序即将退出的时候&#xff0c;也就是 JVM 程序即将退出的时候&#xff0c;Hook 线程就会被启动执行。先看一段示例代码&#xff1a;①&#xff1a;…

HTML+CSS+JS实现 ❤️H5 3D传送带视差照片特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; 部分CSS样式&#xff1a; html, body, .stage, .ring, .img {width: 100%;height: 100%;transform-style: preserve-3d;user-select: none; }html, body, .stage {overflow: hidden;background: #000; …

HTML+CSS+JS实现 ❤️h5酷炫的天体木星动画特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; 部分CSS样式&#xff1a; body {margin: 0;overflow: hidden;position: relative;width: 100vw;height: 100vh;background-image: url("../img/bg.jpg");background-size: cover; }canvas {d…

HTML+CSS+JS实现 ❤️彩色3D线条动画特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; HTML代码 : <!doctype html> <html><head><meta charset"utf-8"><title>彩带特效</title></head><body><script id"fs" type…

HTML+CSS+JS实现 ❤️卡通人物吃水果游戏❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; HTML代码 : <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial…

py哪个函数可以返回输入的变量类型_[Python基础]二、pycharm,python变量

2.1 Python简介Life is short,you need Python (人生苦短&#xff0c;我用Python)解释器&#xff1a;将其他语言翻译成机器语言的工具&#xff0c;称为编译器编译器的翻译方法有两种&#xff1a;编译解释Python的设计哲学优雅明确简单Python开发者哲学&#xff1a;用一种方法&a…

HTML+CSS+JS实现 贪吃蛇游戏源码

效果演示&#xff1a; 文末获取源码 代码目录&#xff1a; 主要代码实现&#xff1a; 部分代码 : <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><meta http-equiv&qu…

HTML+CSS+JS实现 ❤️个人相册封面卡片❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; CSS样式&#xff1a; charset "utf-8"; import url("https://s2.pstatp.com/cdn/expire-1-M/font-awesome/4.7.0/css/font-awesome.min.css"); body {background-color: #1F1F1F;o…

HTML+CSS+JS实现 ❤️swiper倾斜图片特效❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; CSS样式&#xff1a; .img_swiper {width: 800px;margin: 0 auto;position: relative; }.img {width: 100%;height: 100%; }.img_swiper .swiper-button-prev {width: 40px;height: 40px;background-im…

如何将c语言程序封装供python调用_C++调用python

C调用python在C/C中嵌入Python&#xff0c;可以使用Python提供的强大功能&#xff0c;通过嵌入Python可以替代动态链接库形式的接口&#xff0c;这样可以方便地根据需要修改脚本代码&#xff0c;而不用重新编译链接二进制的动态链接库。至少你可以把它当成文本形式的动态链接库…

HTML+CSS+JS实现 ❤️touchSlider图片滚动图片轮播❤️

效果演示&#xff1a; 代码目录&#xff1a; 主要代码实现&#xff1a; CSS样式&#xff1a; charset "utf-8"; * {margin: 0;padding: 0;list-style: none;border: 0; }body {width: 100%;margin: 0 auto;overflow: hidden }/* main_image */.main_visual {heigh…

win10配置mysql8.0_Win10下mysql 8.0.20 安装配置方法图文教程

Win10系统下MySQL 8.0.20安装和配置超详细教程MySQL下载MySQL直接去官网下载就行&#xff0c;选择community版本(免费)下载&#xff0c;链接。在select operating system中选择Microsoft Windows&#xff0c;下方对应出现最新版本的MySQL&#xff0c;目前是MySQL 8.0.20&#x…