div+css实现科技感充电式按钮悬浮动画效果代码

代码语言:html

所属分类:悬停

代码描述:div+css实现科技感充电式按钮悬浮动画效果代码

代码标签: div css 科技 充电式 按钮 悬浮 动画

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    :root {
	--primary: hsl(43, 83%, 72%);
	--secondary: hsl(224, 20%, 17%);
}

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@800&display=swap");

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	height: 100vh;
	width: 100%;
	display: grid;
	place-items: center;
	font-size: 15px;
	background: var(--secondary);
}

.stripe-btn {
	--text-shadow-thickness: 0.05ch;
	--text-shadow-negative-thickness: calc(-1 * var(--text-shadow-thickness));
	position: relative;
	padding: 1rem 2rem;
	border: 2px solid var(--primary);
	font-size: 3rem;
	font-family: "Poppins", sans-serif;
	font-weight: 800;
	color: var(--primary);
	text-transform: uppercase;
	text-shadow:
		var(--text-shadow-thickness) var(--text-shadow-thickness) 0px var(--secondary),
		var(--text-shadow-thickness) var(--text-shadow-negative-thickness) 0px var(--secondary),
		var(--text-shadow-negative-thickness) var(--text-shadow-thickness) 0px var(--secondary),
		var(--text-shadow-negative-thickness) var(--text-shadow-negative-thickness) 0px	var(--secondary);
}

.corners {
	--corner-dimension: 0.7ch;
	--corner-thickness: 3px;
	--corner-negative-thickness: calc(-1 * var(--corner-thickness));
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.corners > i {
	content: "";
	position: absolute;
	width: var(--corner-dimension);
	height: var(--corner-dimension);
}

.corners > i:nth-child(1) {
	top: 0;
	left: 0;
	box-shadow: inset var(--corner-thickness) var(--corner-thickness) 0	var(--primary);
}

.corners > i:nth-child(2) {
	top: 0;
	right: 0;
	box-shadow: inset var(--corner-negative-thickness) var(--corner-thickness) 0 var(--primary);
}

.corners > i:nth-child(3) {
	bottom: 0;
	right: 0;
	box-shadow: inset var(--corner-negative-thickness) var(--corner-negative-thickness) 0 var(--primary);
}

.corners > i:nth-child(4) {
	bottom: 0;
	left: 0;
	box-shadow: inset var(--corner-thickness) var(--corner-negative-thickness) 0 var(--primary);
}

.stripes {
	--stripes-position: 0.3ch;
	content: "";
	position: absolute;
	display: flex;
	justify-content: space-between;
	height: calc(100% - var(--stripes-position) * 2);
	width: calc.........完整代码请登录后点击上方下载按钮下载查看

网友评论0