js+css实现可调参数的3d倾斜图片卡片幻灯片效果代码
代码语言:html
所属分类:幻灯片
代码描述:js+css实现可调参数的3d倾斜图片卡片幻灯片效果代码,可修改光线颜色、密度、xyz轴。
代码标签: js css 调 参数 3d 倾斜 图片 卡片 幻灯片
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style>
*,
::after,
::before {
border-style: solid;
border-width: 0;
box-sizing: border-box;
}
body {
background-color: #121212;
color: #fff;
font-family: "Roboto", sans-serif;
height: 100vh;
overflow: hidden;
}
body,
img {
margin: 0;
}
img {
border: 0;
color: transparent;
display: block;
font: 0/0 a;
height: auto;
outline: none;
padding: 0;
text-shadow: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.wrapper,
img {
position: relative;
}
.wrapper {
align-items: center;
height: 100%;
justify-items: center;
perspective: 1500px;
width: 100%;
}
.stack {
display: grid;
grid-template-areas: "stack";
}
.stack > * {
grid-area: stack;
}
.parallax-layer {
aspect-ratio: 16/9;
background: radial-gradient(
circle,
hsla(0, 0%, 100%, 0.1) 0,
hsla(0, 0%, 100%, 0) 70%
),
repeating-linear-gradient(
45deg,
hsla(0, 0%, 100%, 0.1),
hsla(0, 0%, 100%, 0.1) 0.625rem,
rgba(0, 0, 0, 0.1) 0,
rgba(0, 0, 0, 0.1) 1.25rem
);
border: 0.0625rem solid hsla(0, 0%, 100%, 0.1);
border-radius: 1rem;
display: block;
max-width: 80rem;
pointer-events: none;
position: relative;
transform-style: preserve-3d;
transition: filter 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
width: 100%;
}
.parallax-content {
align-self: start;
height: 100%;
justify-self: start;
opacity: 0.8;
place-self: start;
transform-origin: center center;
width: 100%;
}
.parallax-content img {
margin-left: 5%;
margin-top: 5%;
width: 30%;
}
.ambient-light-layer {
display: block;
height: 100%;
mix-blend-mode: screen;
pointer-events: none;
position: relative;
transition: background 0.2s ea.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0