三维悬浮首页按钮动画效果
代码语言:html
所属分类:多媒体
代码描述:三维悬浮首页按钮动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css?family=Montserrat:400,400i,700"); body { font-family: Montserrat, sans-serif; font-size: 28px; background-color: #c8bfc8; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; } .btn-challenge { color: #a5a7bb; font-family: inherit; font-size: inherit; font-weight: bold; background-color: #554d73; width: 195px; height: 75px; padding: 0; border: 0; margin: 0; outline: 0; flex-grow: 0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: 12px; position: relative; transition: background-color 180ms ease-out; } .btn-challenge > small { color: #a496a4; font-size: 0.6em; font-weight: normal; } .btn-challenge:hover { background-color: #675d8b; } .btn-challenge:active, .btn-challenge:hover:active { background-color: #433d5b; } .hover-area { width: 195px; height: 75px; display: grid; grid-template-columns: repeat(13, 15px); grid-template-rows: repeat(5, 15px); position: absolute; top: 0; left: 0; } .hover-area .hover-col { z-index: 1; } .hover-area .hover-col:nth-child(1):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(-90deg); } .hover-area .hover-col:nth-child(2):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(-75deg); } .hover-area .hover-col:nth-child(3):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(-60deg); } .hover-area .hover-col:nth-child(4):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(-45deg); } .hover-area .hover-col:nth-child(5):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(-30deg); } .hover-area .hover-col:nth-child(6):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(-15deg); } .hover-area .hover-col:nth-child(7):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(0deg); } .hover-area .hover-col:nth-child(8):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(15deg); } .hover-area .hover-col:nth-child(9):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(30deg); } .hover-area .hover-col:nth-child(10):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(45deg); } .hover-area .hover-col:nth-child(11):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(60deg); } .hover-area .hover-col:nth-child(12):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(75deg); } .hover-area .hover-col:nth-child(13):hover ~ .icon-home { transform: scale(1) rotateX(45deg) rotateY(90deg); } .hover-area .hover-col:nth-child(14):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(-90deg); } .hover-area .hover-col:nth-child(15):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(-75deg); } .hover-area .hover-col:nth-child(16):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(-60deg); } .hover-area .hover-col:nth-child(17):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(-45deg); } .hover-area .hover-col:nth-child(18):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(-30deg); } .hover-area .hover-col:nth-child(19):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(-15deg); } .hover-area .hover-col:nth-child(20):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(0deg); } .hover-area .hover-col:nth-child(21):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(15deg); } .hover-area .hover-col:nth-child(22):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(30deg); } .hover-area .hover-col:nth-child(23):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(45deg); } .hover-area .hover-col:nth-child(24):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(60deg); } .hover-area .hover-col:nth-child(25):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(75deg); } .hover-area .hover-col:nth-child(26):hover ~ .icon-home { transform: scale(1) rotateX(22.5deg) rotateY(90deg); } .hover-area .hover-col:nth-child(27):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(-90deg); } .hover-area .hover-col:nth-child(28):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(-75deg); } .hover-area .hover-col:nth-child(29):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(-60deg); } .hover-area .hover-col:nth-child(30):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(-45deg); } .hover-area .hover-col:nth-child(31):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(-30deg); } .hover-area .hover-col:nth-child(32):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(-15deg); } .hover-area .hover-col:nth-child(33):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(0deg); } .hover-area .hover-col:nth-child(34):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(15deg); } .hover-area .hover-col:nth-child(35):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(30deg); } .hover-area .hover-col:nth-child(36):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(45deg); } .hover-area .hover-col:nth-child(37):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(60deg); } .hover-area .hover-col:nth-child(38):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(75deg); } .hover-area .hover-col:nth-child(39):hover ~ .icon-home { transform: scale(1) rotateX(0deg) rotateY(90deg); } .hover-area .hover-col:nth-child(40):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(-90deg); } .hover-area .hover-col:nth-child(41):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(-75deg); } .hover-area .hover-col:nth-child(42):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(-60deg); } .hover-area .hover-col:nth-child(43):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(-45deg); } .hover-area .hover-col:nth-child(44):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(-30deg); } .hover-area .hover-col:nth-child(45):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(-15deg); } .hover-area .hover-col:nth-child(46):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(0deg); } .hover-area .hover-col:nth-child(47):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(15deg); } .hover-area .hover-col:nth-child(48):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(30deg); } .hover-area .hover-col:nth-child(49):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(45deg); } .hover-area .hover-col:nth-child(50):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(60deg); } .hover-area .hover-col:nth-child(51):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(75deg); } .hover-area .hover-col:nth-child(52):hover ~ .icon-home { transform: scale(1) rotateX(-22.5deg) rotateY(90deg); } .hover-area .hover-col:nth-child(53):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(-90deg); } .hover-area .hover-col:nth-child(54):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(-75deg); } .hover-area .hover-col:nth-child(55):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(-60deg); } .hover-area .hover-col:nth-child(56):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(-45deg); } .hover-area .hover-col:nth-child(57):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(-30deg); } .hover-area .hover-col:nth-child(58):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(-15deg); } .hover-area .hover-col:nth-child(59):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(0deg); } .hover-area .hover-col:nth-child(60):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(15deg); } .hover-area .hover-col:nth-child(61):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(30deg); } .hover-area .hover-col:nth-child(62):hover ~ .icon-home { transform: scale(1) rotateX(-45deg) rotateY(45deg); } .hover-area .hover-c.........完整代码请登录后点击上方下载按钮下载查看
网友评论0