js+css实现鼠标悬停文字炫酷ASCII码波动动画效果代码
代码语言:html
所属分类:悬停
代码描述:js+css实现鼠标悬停文字炫酷ASCII码波动动画效果代码
代码标签: js css 鼠标 悬停 文字 炫酷 ASCII码 波动 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-style: normal;
}
html {
--color-bg: #121211;
--color-text: #f9f9f7;
--color-muted: #bdbdbd;
--u-thickness: 1.1px;
--u-spacing: 0.4rem;
--u-offset: 0.2rem;
}
body {
background: var(--color-bg);
font: 14px/1.45 "Lucida Console", "Monaco", monospace;
letter-spacing: 0.01em;
}
body,
a {
color: var(--color-text);
}
::selection {
background: var(--color-text);
color: var(--color-bg);
}
main {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.ct {
margin: 0 auto;
padding: 0.6em 1.6em;
max-width: 52ch;
position: relative;
z-index: 1;
}
.ct > * {
margin: 1rem 0 0;
}
ul {
list-style: none;
padding: 0;
margin: 0 0 2em 0;
}
li {
margin: 0.6rem 0;
position: relative;
}
a {
color: var(--color-text);
text-decoration: none;
position: relative;
z-index: 1;
}
.h a::after {
content: "";
position: absolute;
bottom: calc(-1.1 * var(--u-offset));
left: 0;
right: 0;
height: var(--u-thickness);
background: repeating-linear-gradient(
to right,
var(--color-muted) 0,
var(--color-muted) 2px,
transparent 2px,
transparent var(--u-spacing)
);
transition: background 0.3s ease-out;
opacity: 0.75;
}
.h a:hover::after {
background: var(--color-muted);
height: calc(var(--u-thickness) * 0.5);
}
a:focus,
a:hover {
text-decoration: none;
}
header {
margin-bottom: 1.5em;
}
footer {
padding: 1em 0;
}
small {
color: var(--color-muted);
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0