滚动响应式变形动画效果

代码语言:html

所属分类:响应式

代码描述:滚动响应式变形动画效果,滚动鼠标试试

代码标签: 变形 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
body {
	background-color: #424242;
	width: 100%;
	margin: 0px;
	font-family: Arial;
	margin: 0;
	padding: 0;
	position: relative;
}

.spacer {
	height: 300px;
}

#showcase {
	position: relative;
}

#showcase > .deviceWrapper {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 3;
}

#showcase > .deviceWrapper > .device {
	position: sticky;
	top: 5vh;
	width: 80vw;
	height: 80vh;
	margin: auto;
}

#showcase > .deviceWrapper > .device img {
	top: 3%;
	opacity: 0.5;
	height: 100%;
	width: 100%;
}

#showcase > .deviceWrapper > .device * {
	position: absolute;
	will-change: transform;
}

.border {
	background-color: black;
	--border-top-width: 3%;
	--border-left-width: 3%;
	z-index: 3;
}

.border.top,
.border.bottom {
	left: 0%;
	right: 0%;
	height: var(--border-top-width);
}

.border.left,
.border.right {
	width: var(--border-left-width);
	top: 13%;
	bottom: 30%;
	border-radius: 4px;
}

.border.top {
	top: 13%;
	border-radius: 4px;
}

.border.left {
}

.border.right {
	right: 0;
}

.border.bottom {
	bottom: 30%;
}

.display {
	background-color: #eee;
	top: 15%;
	left: 2%;
	right: 2%;
	bottom: 32%;
	z-index: 4;
	border-radius: 3px;
}

.text {
	z-index: 5;
	background: linear-gradient(
		130deg,
		rgba(3, 104, 184, 1) 0%,
		rgba(0, 212, 255, 1) 100%
	);
	border-radius: 100px;
}

.nav.background {
	left: 2%;
	right: 2%;
	height: 6%;
	background-color: white;
	border-radius: 2px;
	z-index: 5;
	transform-origin: top;
}

.top.nav.background {
	top: 15%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.top.nav.logo {
	top: 16.49%;
	height: 3%;
	left: 4.5%;
	width: 3%;
	z-index: 5;
	border-radius: 3px;
	background: linear-gradient(130deg, #29b6f6 0%, #81d4fa 100%);
}

.top.nav.text {
	top: 16.49%;
	height: 3%;
}

.top.nav.text.one {
	left: 11%;
	width: 14%;
}

.top.nav.text.two {
	left: 29%;
	width: 10%;
}

.top.nav.text.three {
	left: 43%;
	width: 12%;
}

.bottom.nav {
	top: auto;
	bottom: 32%;
}

.bottom.nav.background {
	box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.12), 0 -1px 2px rgba(0, 0, 0, 0.24);
}

.bottom.nav.text {
	top: auto;
	bottom: 33.5%;
	width: 3%;
	height: 3%;
	border-radius: 4px;
}

.bottom.nav.text.one {
	left: 23%;
}

.bottom.nav.text.two {
	left: 48.5%;
}

.bottom.nav.text.three {
	left: 75%;
}

.main.text {
	width: 30%;
	height: 3%;
	top: 27%;
	left: 5%;
}

.sub.text {
	width: 24%;
	height: 3%;
	top: 32%;
	left: 5%;
}

.info.text {
	height: 2%;
}

.info.text.one {
	top: 40%;
	left: 5%;
	width: 10%;
}

.info.text.two {
	top: 40%;
	left: 16%;
	width: 6%;
}

.info.text.three {
	top: 44%;
	left: 5%;
	width: 7%;
}

.info.text.four {
	top: 44%;
	left: 13%;
	width: 5%;
}

.info.text.five {
	top: 44%;
	left: 19%;
	width: 7%;
}

.info.text.six {
	top: 48%;
	left: 5%;
	width: 3%;
}

.info.text.seven {
	top: 48%;
	left: 9%;
	width: 11%;
}

.info.text.eight {
	top: 48%;
	left: 21%;
	width: 7%;
}
.img {
	background: linear-gradient(130deg, #29b6f6 10%, #81d4fa 100%);
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.34);
	z-index: 5;
	box-sizing: border-box;
}

.img.one {
	top: 27%;
	left: 45%;
	width: 15%;
	height: 32.1%;
}

.img.two {
	top: 49%;
	left: 61%;
	width: 31.1%;
	height: 10%;
}

.img.three {
	top: 27%;
	left: 77%;
	width: 15%;
	height: 21%;
}

.img.four {
	top: 27%;
	left: 61%;
	width: 15%;
	height: 10%;
}

.img.five {
	top: 38%;
	left: 61%;
	width: 15%;
	height: 10%;
}

.chin {
	background-color: #666;
	bottom: 23%;
	height: 10%;
	left: 0;
	right: 0;
	border-radius: 4px;
	z-index: 2;
}

.stand {
	background-color: #999;
	transform: perspective(10px) rotateX(1.6deg);
	bottom: 11.3%;
	left: 34%;
	right: 34%;
	height: 14%;
}

.foot {
	background-color: #bbb;
	border-radius: 20px;
	z-index: 1;
	left: 28.6%;
	right: 28.6%;
	bottom: 10%;
	height: 3.5%;
}

.phone > .border {
	--border-top-width: 8%;
	--border-left-width: 2.7%;
}

.phone > .border.top,
.phone > .border.bottom {
	left: 25.7%;
	right: 25.7%;
	border-radius: 13px;
}

.phone > .border.left,
.phone > .border.right {
	top: 5%;
	bottom: 5%;
}

.phone > .border.top {
	top: 0%;
}

.phone > .border.left {
	left: 25.7%;
}

.phone > .border.right {
	right: 25.7%;
}

.phone > .border.bottom {
	bottom: 0%;
}

.phone > .display {
	top: 7.1%;
	bottom: 7.1%;
	left: 28.5%;
	right: 28.5%;
}

.phone > .nav.background {
	left: 28.5%;
	right: 28.5%;
}

.phone > .nav.background.top {
	top: 7.1%;
}

.phone > .nav.background.bottom {
	bottom: 7.1%;
}

.phone > .top.nav.logo {
	top: 8.5%;
	height: 3%;
	left: 30%;
}

.phone > .top.nav.text {
	top: 8.5%;
}

.phone > .top.nav.text.one {
	left: 36.5%;
}

.phone > .top.nav.text.two {
	left: 54.5%;
}

.phone > .top.nav.text.three {
	left: 68.5%;
}

.phone > .bottom.nav.text {
	bottom: 8.5%;
}

.phone > .bottom.nav.text.one {
	left: 37%;
}

.phone > .bottom.nav.text.two {
	left: 48.5%;
}

.phone > .bottom.nav.text.three {
	left: 60%;
}

.phone > .main.text {
	top: 15%;
	left: 35%;
}

.phone > .sub.text {
	top: 22%;
	left: 38%;
}

.phone > .info.text.one {
	top: 35%;
	left: 41.5%;
	width: 10%;
}

.phone > .info.text.two {
	top: 35%;
	left: 52.5%;
	width: 6%;
}

.phone > .info.text.three {
	top: 39%;
	left: 39.5%;
	width: 7%;
}

.phone > .info.text.four {
	top: 39%;
	left: 47.5%;
	width: 5%;
}

.phone > .info.text.five {
	top: 39%;
	left: 53.5%;
	width: 7%;
}

.phone > .info.text.six {
	top: 43%;
	left: 39%;
	width: 3%;
}

.phone > .info.text.seven {
	top: 43%;
	left: 43%;
	width: 11%;
}

.phone > .info.text.eight {
	top: 43%;
	left: 55%;
	width: 7%;
}

.phone > .img.one {
	top: 64%;
	left: 34.5%;
	width: 15%;
	height: 21.1%;
}

.phone > .img.two {
	top: 86%;
	left: 34.5%;
	width: 31.1%;
	height: 0%;
}

.phone > .img.three {
	top: 53%;
	left: 50.5%;
	width: 15%;
	height: 21%;
}

.phone > .img.four {
	top: 53%;
	left: 34.5%;
	width: 15%;
	height: 10%;
}

.phone > .img.five {
	top: 75%;
	left: 50.5%;
	width: 15%;
	height: 10%;
}
</style>

</head>
<body translate="no">
<section id="showcase">
<div class="spacer"></div>
<div class="spacer"></div>
<div class="spacer"></div>
<div class="spacer"></div>
<div class="spacer"></div>
<div class="spacer"></div>
<div class="deviceWrapper">
<div class="device">
<div class="top border"></div>
<div class="left border"></div>
<div class="bottom border"></div>
<div class="right border"></div>
<div class="display"></div>
<div class="chin"></div>
<div class="stand"></div>
<div class="foot"></div>
<div class="top nav background"></div>
<div class="top nav logo"></div>
<div class="top nav text one"></div>
<div class="top nav text two"></div>
<div class="top nav text three">&l.........完整代码请登录后点击上方下载按钮下载查看

网友评论0