css布局实现汽车行驶在冲浪海滩公路上动画效果代码

代码语言:html

所属分类:动画

代码描述:css布局实现汽车行驶在冲浪海滩公路上动画效果代码

代码标签: 汽车 行驶 冲浪 海滩 路上 动画 效果

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


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
<style>
/*
Alittle bit of chaos here... debug in progress
*/

* {
	box-sizing: border-box;
	transform-style: preserve-3d;
	/*animation: none !important;*/
}

body {
	width: 100vw;
	height: 100vh;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

.content {
	perspective: 100vmin;
	transform-style: preserve-3d;
}

.sky {
	background: radial-gradient(
			circle at 50vw 35vh,
			#ffc107 5%,
			rgb(255 193 7 / 64%) 10%,
			rgb(253 50 41 / 50%) 25%,
			rgb(243 0 0 / 40%) 30%,
			rgb(93 0 0 / 0%) 100%
		),
		linear-gradient(180deg, #673ab7, #ffb900 80%, #fff0 100%);
	width: 100vw;
	height: 35vh;
	position: absolute;
	left: 0;
	top: 0;
}
.sky:after {
	content: "";
	width: 100%;
	height: 5vmin;
	position: absolute;
	background: linear-gradient(
		to top,
		rgba(0, 25, 45, 1) 0%,
		rgba(14, 71, 117, 1) 35%,
		rgba(26, 126, 174, 1) 70%,
		rgba(62, 168, 220, 1) 100%
	);
	bottom: 0;
	box-shadow: 0 6px 6px -6px #ffc107 inset;
}

/*
.water {
  background: 
  height: 50vh;
  overflow: hidden;
  position: relative;
}
.water:before {
  content: "";
  width: 100%;
  height: 100%;
  position: absolute;
  background: repeating-linear-gradient(175deg,rgba(165,165,165,0.08) 45%, rgba(175,175,175,0.08) 47%, rgba(235,235,235,0.08) 50%, rgba(195,195,195,0.08) 54%, rgba(165,165,165,0.08) 57%), linear-gradient(to left top, rgba(0,0,0,0.0) 10%,rgba(0,0,0,0.20) 44%,rgba(0,0,0,0.65) 95%,rgba(0,0,0,0.62) 100%);
  opacity: 0.5;
  box-shadow: 0 6px 6px -6px #ffc107 inset;
  animation: ocean 15s infinite;
}
*/

.ground {
	background: linear-gradient(
		to top,
		#0a190b 0%,
		#255226 36%,
		#8bc34a 98%,
		#1e6f20b3 100%
	);
	width: 300vw;
	height: 70vh;
	position: absolute;
	left: -100vw;
	top: 30vh;
	border-radius: 100% 100% 0 0;
}

.road {
	background: linear-gradient(0deg, #6d6d6d, #eae5d6);
	width: 25vw;
	height: 70vh;
	position: absolute;
	top: 30vh;
	left: 35vw;
	transform: rotateX(90deg);
	transform-origin: center top;
	border-radius: 1% 1% 0 0;
	animation: roadview 10s ease-in-out 0s infinite alternate;
	border: 0.25vmin solid #75747470;
	border-top: 0;
	border-bottom: 0;
}

@keyframes roadview {
	0% {
		left: 49vw;
	}
	10% {
		left: 48vw;
	}

	40% {
		left: 40vw;
	}
	70% {
		left: 30vw;
	}

	90% {
		left: 19vw;
	}
	100% {
		left: 18vw;
	}
}

.road:before,
.road:after {
	content: "";
	width: 1vmin;
	height: 100%;
	background: #ffffffba;
	position: absolute;
	left: 1.25vmin;
}

.road:after {
	left: initial;
	right: 1.25vmin;
}

.line {
	width: 1vmin;
	height: 100%;
	background: repeating-linear-gradient(0deg, #fff 0 25%, transparent 0 50%);
	position: absolute;
	left: calc(50% - 0.625vmin);
	animation: gradient 2s linear 0s infinite;
	background-size: 1vmin 20vmin;
	background-position: 50% 0%;
}

@keyframes gradient {
	0% {
		background-position.........完整代码请登录后点击上方下载按钮下载查看

网友评论0