1 Star 0 Fork 19

tsalita/blog网页特效源码

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
css3D分层图像悬停效果.html 2.71 KB
一键复制 编辑 原始数据 按行查看 历史
北极光之夜 提交于 2021-09-27 22:19 . 'before-code'
<!--
* @Author: your name
* @Date: 2021-04-19 18:56:07
* @LastEditTime: 2021-04-19 22:37:48
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \undefinedd:\练习\3D分层图像悬停效果.html
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Night</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: rgb(9, 22, 37);
}
.container{
position: relative;
perspective: 2000px;
}
.box{
position: relative;
width: 220px;
height: 360px;
transition: all 0.5s;
transform-style: preserve-3d;
}
.box:hover{
transform: rotateX(50deg) rotateZ(-50deg);
}
.box img{
position: absolute;
width: 100%;
height: 100%;
box-shadow: 0 0 3px rgb(61, 138, 226);
transition: all 1.5s;
transform: translateZ(0px);
}
.box:hover img:nth-child(2){
transform: translateX(-10px) translateY(10px) translateZ(-10px);
opacity: 0.8;
}
.box:hover img:nth-child(3){
transform: translateX(-20px) translateY(20px) translateZ(-20px);
opacity: 0.6;
}
.box:hover img:nth-child(4){
transform: translateX(-30px) translateY(30px) translateZ(-30px);
opacity: 0.4;
}
.box:hover img:nth-child(5){
transform: translateX(-40px) translateY(40px) translateZ(-40px);
opacity: 0.2;
}
.box span{
position: absolute;
width: 100%;
height: 100%;
transition: all 1.5s;
opacity: 0.1;
}
.box:hover span{
transform: translateX(-50px) translateY(50px) translateZ(-50px);
box-shadow: 0 0 40px rgb(41, 151, 253);
background-color: rgb(41, 151, 253);
}
</style>
</head>
<body>
<div class="container">
<div class="box">
<img src="img/photo.jpg" alt="x" >
<img src="img/photo.jpg" alt="x" >
<img src="img/photo.jpg" alt="x" >
<img src="img/photo.jpg" alt="x" >
<img src="img/photo.jpg" alt="x" >
<span></span>
</div>
</div>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tsalita/blog.git
git@gitee.com:tsalita/blog.git
tsalita
blog
blog网页特效源码
master

搜索帮助