多种按钮悬浮点击动画特效
代码语言:html
所属分类:悬停
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css'> <style> @import url("https://fonts.googleapis.com/css?family=Montserrat&display=swap"); html, body { margin: 0px; background: #000; } .cbtn-wrap { overflow: hidden; text-align: center; margin-top: 50px; } #cbtn-title { position: relative; font-family: Montserrat; color: #fff; font-size: 24px; text-transform: uppercase; font-weight: 600; text-decoration: underline; } .cbtn-o { display: inline-block; position: relative; } .cbtn-o > .cbtn-i { position: relative; z-index: 3; cursor: pointer; margin: 40px 20px; padding: 10px 25px; border-radius: 100px; font-family: Montserrat; font-weight: 600; color: #fff; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); transition: 250ms cubic-bezier(0, 0.5, 0.5, 1); -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .cbtn-o > .cbtn-i[data-mode="0"] { background: #e96651; box-shadow: 0px 0px 0px #e96651; } .cbtn-o > .cbtn-i[data-mode="0"]:hover { transform: scale(0.9); background: #efaf60; box-shadow: 0px 0px 30px #efaf60; } .cbtn-o > .cbtn-i[data-mode="0"]:active { transform: scale(1); } .cbtn-o > .cbtn-i[data-mode="1"] { background: #3770a0; box-shadow: 0px 0px 0px #3770a0; } .cbtn-o > .cbtn-i[data-mode="1"]:hover { transform: scale(0.9); background: #77b6ea; box-shadow: 0px 0px 20px #77b6ea; } .cbtn-o > .cbtn-i[data-mode="1"]:active { transform: scale(0.6); } .cbtn-o > .cbtn-i[data-mode="2"] { background: #30a254; box-shadow: 0px 0px 0px #30a254; transition: 350ms cubic-bezier(0, 0.5, 0.5, 1); } .cbtn-o > .cbtn-i[data-mode="2"]:hover { transform: scale(0.9); background: #51e980; box-shadow: 0px 0px 30px #51e980; } .cbtn-o > .cbtn-i[data-mode="2"]:active { transform: scale(0.9) rotateX(-360deg); } .cbtn-o > .cbtn-i[data-mode="3"] { background: #8e54ff; box-shadow: 0px 0px 0px #8e54ff; } .cbtn-o > .cbtn-i[data-mode=".........完整代码请登录后点击上方下载按钮下载查看
网友评论0