jquery实现一个不可能的三叉戟错觉动画效果代码
代码语言:html
所属分类:视觉差异
代码描述:jquery实现一个不可能的三叉戟错觉动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Work+Sans:wght@300&display=swap");
:root {
--line-size: 4px;
--symbol-width: 200px;
--symbol-height: calc(var(--symbol-width) * 2);
--gradient: linear-gradient(#daa8cd, #daa8cc, #9696c8);
--yellow-color: #efc66a;
--neon-color: #fff;
--neon-glow: #fff;
--neon-shadow: 0 0 1rem var(--neon-color), inset 0 0 1rem var(--neon-color),
0 0 2rem var(--neon-glow), inset 0 0 4rem var(--neon-glow),
0 0 4rem var(--neon-glow);
--animation-time: 0.5s;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
transition: all calc(var(--animation-time) * 2) linear;
}
*:before,
*:after {
box-sizing: border-box;
margin: 0;
padding: 0;
position: absolute;
content: "";
transition: all calc(var(--animation-time) * 2) linear;
background: inherit;
}
body {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: var(--gradient);
font-family: "Bebas Neue", sans-serif;
position: relative;
}
#symbol {
width: var(--symbol-width);
height: var(--symbol-height);
position: relative;
display: flex;
flex-direction: row;
justify-content: space-between;
transform-origin: center center;
transform: skewY(-18deg);
cursor: pointer;
margin-bottom: calc(var(--line-size) * 20);
}
#symbol .line {
width: var(--line-size);
height: var(--symbol-height);
background: var(--neon-color);
position: relative;
border-radius: var(--line-size);
box-shadow: var(--neon-shadow);
}
#symbol .line h1,
#symbol .line p {
position: absolute;
color: var(--neon-color);
white-space: nowrap;
}
#symbol .line p {
right: 0;
bottom: 0;
font-size: calc(var(--line-size) * 3.5);
letter-spacing: calc(var(--line-size) * 0.8);
line-height: 1;
margin-bottom: calc(var(--line-size) * -6);
opacity: 1;
transition-delay: calc(var(--animation-time) * 1);
}
#symbol .line h1 {
right: 0;
top: 0;
font-size: calc(var(--line-size) * 6);
letter-spacing: calc(var(--line-size) * 1);
line-heig.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0