anime实现鼠标悬浮层叠动画效果代码

代码语言:html

所属分类:悬停

代码描述:anime实现鼠标悬浮层叠动画效果代码

代码标签: 悬浮 层叠 动画 效果

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

<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
    *,
*::after,
*::before {
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

body {
	font-family: 'Overpass Mono', monospace;
	color: #edecf2;
	background: #37373e;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	text-decoration: none;
	color: #ff3d53;
	outline: none;
	transition: color 0.2s;
}

a:hover,
a:focus {
	color: #fff;
}

.hidden {
	position: absolute;
	overflow: hidden;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Icons */
.icon {
	display: block;
	width: 1.5em;
	height: 1.5em;
	margin: 0 auto;
	fill: currentColor;
}

.message-mobile {
	font-size: 0.85em;
	display: none;
	width: 100%;
	padding: 0.5em;
	text-align: center;
	background: #ff3d53;
}

/* Header */
.codrops-header {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	width: 100%;
	padding: 1.5em 1.5em 4em;
	text-align: left;
}

.codrops-header__title {
	font-size: 1.15em;
	margin: 0;
	padding: 0 0.5em;
}

.codrops-header__tagline {
	font-size: 0.85em;
	width: 100%;
	margin: 0;
	color: #b0adad;
}

.codrops-header__tagline::before {
	content: '> ';
}

.github {
	font-size: 0.85em;
	font-weight: bold;
	margin: 0 0 0 auto;
}

/* Top Navigation Style */
.codrops-links {
	position: relative;
	display: flex;
	justify-content: center;
	text-align: center;
	white-space: nowrap;
}

.codrops-links::after {
	content: '';
	position: absolute;
	top: 20%;
	left: 50%;
	width: 1px;
	height: 60%;
	background: #b0adad;
	transform: rotate3d(0, 0, 1, 22.5deg);
}

.codrops-icon {
	display: inline-block;
	margin: 0.25em 0 0.25em 0.25em;
	padding: 0.35em 0 0.35em 0.35em;
}

.codrops-icon:first-child {
	margin: 0.25em 0.25em 0.25em 0;
	padding: 0.35em 0.35em 0.35em 0;
}

/* Content */
.content {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	padding: 0 0 1em;
}

.content:not(:first-child) {
	padding: 4em 0;
}

.content.content--padded {
	padding: 4em 0 8em;
}

.content__title {
	font-size: 0.85em;
	position: absolute;
	top: 18%;
	left: 2em;
	width: 5em;
	margin: 0.75em 0;
	color: #b0adad;
}

/* Grid */
.grid {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	width: 100%;
	padding: 0 7em;
	perspective: 800px;
	perspective-origin: 50% 100%;
}

.grid__item {
	position: relative;
	display: block;
	flex: none;
	width: 250px;
	margin: 1.5em 2vw;
	cursor: default;
	transform-style: preserve-3d;
}

.grid__item:hover,
.grid__item:focus {
	outline: none;
}

.grid__item--c1,
.grid__item--c1:hover,
.grid__item--c1:focus {
	color: #52649e;
}

.grid__item--c2,
.grid__item--c2:hover,
.grid__item--c2:focus {
	color: #ee7074;
}

.grid__item--c3,
.grid__item--c3:hover,
.grid__item--c3:focus {
	color: #f7f295;
}

.stack {
	position: relative;
	width: 100%;
	height: 200px;
	transform-style: preserve-3d;
}

.stack__deco {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: currentColor;
	transform-origin: 50% 100%;
}

.stack__deco:first-child {
	opacity: 0.2;
}

.stack__deco:nth-child(2) {
	opacity: 0.4;
}

.stack__deco:nth-child(3) {
	opacity: 0.6;
}

.stack__deco:nth-child(4) {
	opacity: 0.8;
}

.stack__figure {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
	width: 100%;
	height: 100%;
	cursor: pointer;
	transform-origin: 50% 100%;
}

.stack__img {
	position: relative;
	display: block;
	flex: none;
}

.grid__item-caption {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	transform-style: preserve-3d;
}

.grid__item-title {
	font-size: 1.15em;
	width: 100%;
	margin: 1em 0;
	text-align: left;
	color: #fff;
}

.column {
	width: 50%;
	padding: 0 0.5em;
	opacity: 0;
}

.column--left {
	text-align: right;
}

.column--right {
	text-align: left;
}

.column__text {
	font-size: 0.85em;
	display.........完整代码请登录后点击上方下载按钮下载查看

网友评论0