原生js实现文字翻牌动画显示效果
代码语言:html
所属分类:动画
代码描述:原生js实现文字翻牌动画显示效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css?family=Fjalla+One&display=swap"); .numCounter { display: inline-block; height: 90px; line-height: 90px; text-shadow: 0 0 2px #fff; font-weight: bold; white-space: normal; font-size: 60px; } .numCounter > div { display: inline-block; vertical-align: top; height: 100%; } .numCounter > div > b { display: inline-block; width: 64.2857142857px; height: 100%; margin: 0 0.1em; border-radius: 8px; text-align: center; text-shadow: 2px 1px 3px rgba(0, 0, 0, 0.2); box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.1) inset, -2px -2px 2px rgba(255, 255, 255, 0.12) inset; overflow: hidden; } .numCounter > div > b::before { content: ' 0 1 2 3 4 5 6 7 8 9 '; display: block; word-break: break-all; word-break: break-word; -webkit-transition: 0.5s cubic-bezier(0.75, 0.15, 0.6, 1.15), text-shadow 150ms; transition: 0.5s cubic-bezier(0.75, 0.15, 0.6, 1.15), text-shadow 150ms; } .numCounter > div > b.blur { opacity: .8; text-shadow: 2px 1px 3px rgba(0, 0, 0, 0.2), 0 0.1em 2px rgba(255, 255, 255, 0.6), 0 0.3em 3px rgba(255, 255, 255, 0.3), 0 -0.1em 2px rgba(255, 255, 255, 0.6), 0 -0.3em 3.........完整代码请登录后点击上方下载按钮下载查看
网友评论0