TweenMax+TimelineMax实现分割图片式鼠标滚动式图片切换幻灯片效果代码
代码语言:html
所属分类:幻灯片
代码描述:TweenMax+TimelineMax实现分割图片式鼠标滚动式图片切换幻灯片效果代码,左右切割的方式,产生视觉差异。
代码标签: TweenMax TimelineMax 分割 图片 鼠标 滚动 幻灯片
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&display=swap");
:root {
--white: rgba(255, 255, 255, 0.9);
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: "Poppins", sans-serif;
font-weight: 200;
}
.portfolio {
color: var(--white);
background: radial-gradient(rgba(43, 55, 96, 1), rgba(11, 16, 35, 1));
}
/* header */
nav {
min-height: 10vh;
width: 90%;
margin: auto;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 0;
}
.logo {
font-size: 1.25rem;
}
/* main */
.page {
min-height: 90vh;
display: grid;
grid-template-columns: 5% 1fr 1fr 1fr 5%;
}
.chef,
.hairstyle {
position: absolute;
bottom: 0%;
left: 0%;
width: 100%;
opacity: 0;
pointer-events: none;
}
.hero {
overflow: hidden;
height: 500px;
align-self: center;
justify-self: center;
display: flex;
}
.hero img {
height: 500px;
transition: transform 0.3s ease-out;
}
.model-right {
transform: translate(0%, 10%);
}
.model-left {
transform: translate(0%, -10%);
}
.hero:hover .model-right,
.hero:hover .model-left {
transform: translate(0%, 0%);
}
.details {
grid-column: 2/3;
align-self: end;
}
.details h1 {
font-size: 4rem;
font-weight: 500;
}
.details h2 {
font-size: 2.625rem;
font-weight: 400;
padding: 20px 0;
}
.details p {
font-size: 1.5rem;
padding: 20px 0 50px;
}
/* slider */
.pages {
position: absolute;
right: 5%;
top: 50%;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0