css实现正方形点击变成纸飞机飞行动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现正方形点击变成纸飞机飞行动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap" rel="stylesheet"> <style> *, *::before, *::after { font-family: inherit; box-sizing: inherit; margin: 0; padding: 0; } html { box-sizing: border-box; font-family: 'Nunito Sans', sans-serif; font-size: 62.5%; } html body { font-size: 1.6rem; margin: 0; } ul { list-style: none; } a, a:link, a:visited { text-decoration: none; } </style> <style> body { height: 100vh; overflow: hidden; display: flex; align-items: center; justify-content: center; background-color: #666; } input[type=checkbox] { display: none; } .send { --hue: 30deg; position: relative; width: 24rem; height: 24rem; perspective: 70rem; transform-style: preserve-3d; cursor: pointer; } .send *, .send *::before, .send *::after { transition: all 1s; } .send .wrapper { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; } .send .wrapper .move { transform-style: preserve-3d; width: 100%; height: 100%; position: relative; } .send .wrapper .move .part { position: absolute; transform-style: preserve-3d; width: 100%; height: 100%; } .send .wrapper .move .part::before, .send .wrapper .move .part::after { content: "SEND"; width: 100%; height: 100%; position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background-color: hsl(var(--hue), 70%, 75%); font-size: 4.8rem; font-weight: bold; color: rgba(255, 255, 255, 0.8); } .send .wrapper .move .part.left::before { transform-origin: 50% 25%; -webkit-clip-path: polygon(0 0, 100% 0, 100% 1px, 0 calc(50% + 1px)); clip-path: polygon(0 0, 100% 0, 100% 1px, 0 calc(50% + 1px)); } .send .wrapper .move .part.left::after { -webkit-clip-path: polygon(0 50%, 100% 0, 100% 1px, 1px 100%, 0 100%); clip-path: polygon(0 50%, 100% 0, 100% 1px, 1px 100%, 0 100%); } .send .wrapper .move .part.right::before { -webkit-clip-path: po.........完整代码请登录后点击上方下载按钮下载查看
网友评论0