vue+css实现骰子与多米诺骨牌三维旋转效果代码
代码语言:html
所属分类:动画
代码描述:vue+css实现骰子与多米诺骨牌三维旋转效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Dosis:wght@300;800&display=swap"); *, ::after, ::before { margin: 0; padding: 0; box-sizing: border-box; --black: #0e1313; --dark-black: #090909; --red: #c81116; } body { height: 100vh; display: grid; place-content: center; font-family: "Dosis", sans-serif; font-weight: 300; color: #bebebe; background-color: var(--black); } .container { width: 400px; height: 60vh; display: grid; justify-items: center; position: relative; } section { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); width: min-content; display: grid; grid-template-columns: repeat(3, min-content); gap: 0.5em; align-items: center; } section h2 { font-size: 2rem; letter-spacing: 2px; font-weight: 800; text-align: center; cursor: pointer; user-select: none; transition: color 0.3s; } section h2:nth-child(2) { font-size: 3rem; opacity: 1; cursor: default; } .active { color: var(--red); pointer-events: none; } /* DICE PIECE --------------------------------------- */ .cube-container { width: 100px; height: 100px; perspective: 1000px; } .cube { transform-style: preserve-3d; width: 100%; height: 100%; position: relative; margin-top: 6em; } .cube div { position: absolute; width: 100%; height: 100%; display: grid; place-content: center; border-radius: 8px; backface-visibility: hidden; } .cube div:nth-child(odd) { .........完整代码请登录后点击上方下载按钮下载查看
网友评论0