css实现简单点击旋转播放按钮效果代码
代码语言:html
所属分类:表单美化
代码描述:css实现简单点击旋转播放按钮效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> *, *::before, *::after { padding: 0; margin: 0 auto; box-sizing: border-box; } body { background-color: #000; color: #fff; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; } input[type=checkbox] { -webkit-appearance: none; -moz-appearance: none; appearance: none; position: fixed; top: -100%; left: -100%; } input[type=checkbox]:checked + .playButton { --ry: 90deg; --clr: maroon; } .playButton { position: relative; width: 160px; height: 80px; border-radius: 10%/20%; background-color: var(--clr, red); perspective: 320px; cursor: pointer; margin: 1em auto; transition: background-color 0.5s; } .icon { position: absolute; top: 50%; left: 50%; transform: rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform 0.5s; } .icon.pause > div { position: absolute; background-color: .........完整代码请登录后点击上方下载按钮下载查看
网友评论0