js+css实现电子吉他弹奏乐器效果代码
代码语言:html
所属分类:多媒体
代码描述:js+css实现电子吉他弹奏乐器效果代码,鼠标悬浮在音调按钮上可出声。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css"> <style> nav { background-color: #221C44; height: 52px; font-family: "Roboto", sans-serif; color: #969DA2; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 14px; line-height: 17px; position: relative; z-index: 2; } nav .rewind { margin-left: 28px; height: 16px; cursor: pointer; } nav .play { margin-left: 24px; height: 24px; cursor: pointer; } nav .play-icon:hover path, nav .play-icon:hover rect, nav .rewind-icon:hover path, nav .rewind-icon:hover rect, nav .pause-icon:hover path, nav .pause-icon:hover rect { fill: #566574; } nav .pause-icon { display: none; } nav .controls { display: flex; align-items: center; } nav .social a { font-size: 24px; color: #A8B5C2; margin-left: 18px; } nav .social a:hover { color: #566574; } .loading { display: flex; justify-content: center; margin-top: 24px; position: relative; z-index: 1; } .loading .progress { transition: width 0.3s linear; } .notes { display: flex; height: 0; opacity: 0; transition: opacity 1s ease; justify-content: center; position: relative; z-index: 2; overflow: hidden; } .notes .note { height: 132px; } .notes .note > div { height: 100%; width: 32px; border-radius: 16px; background-color: #D8D8D8; color: #541F5D; font-family: "Roboto", sans-serif; font-size: 20px; font-weight: 700; line-height: 23px; text-align: center; box-sizing: border-box; padding: 5px 0; box-shadow: 0 7px 8px rgba(0, 0, 0, 0.16); } .notes .note:hover div { background-color: #FF6545; color: #fff; } .notes .note.key { height: 172px; } .notes .note.key > div { background-color: #ECDCCA; } .notes .note.key:hover > div { background-color: #FF6545; color: #fff; } .notes .note:not(:first-child) > div { margin-left: 8px; } .notes .note:not(:last-child) > div { margin-right: 8px; } .notes .note span { font-size: 0.7em; } .guitar { width: 96%; min-width: 772px; position: fixed; bottom: 0; right: 0; } .guitar.visible { transition: opacity 0.5s ease; } .guitar img { width: 100%; display: block; pointer-events: none; } .guitar .circle { background-image: url(//repo.bfw.wiki/bfwrepo/sound/guitar/switch.png); background-size: 100%; background-repeat: no-repeat; width: 5vw; height: 5vw; min-width: 40px; min-height: 40px; border-radius: 50%; position: absolute; right: 44.5%; top: 33.5%; cursor: pointer; } .guitar .circle.rock { background-position: 0 100%; } .guitar .circle.rock:before { color: #FFF; } .guitar .circle.rock:after { color: #C17CA4; } .guitar .circle:before, .guitar .circle:after { font-weight: 700; font-size: 12px; line-height: 13px; text-align: center; display: block; position: relative; transition: color 0.3s ease; } .guitar .circle:before { content: "ROCK"; top: -14px; color: #C17CA4; } .guitar .circle:after { content: "BLUES"; top: 100%; color: #FFF; position: absolute; width: 100%; margin-top: 2px; } body { background-image: url(//repo.bfw.wiki/bfwrepo/sound/guitar/bluesman_background.svg), linear-gradient(-180deg, #242150 5%, #572250 91%); background-size: cover; background-position: center; margin: 0; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; font-family: "Roboto", sans-serif; } body * { user-select: none; } html, body { height: 100%; min-width: 726px; } </style> </head> <body translate="no"> <!-- design by: https://www.behance.net/vahanhovh --> <nav> <div class="controls"> Backing track: Shuffle Blues in A <a class="rewind"> <svg width="26" height="16" viewBox="160 18 26 16" xmlns="http://www.w3.org/2000/svg" class="rewind-icon"><path d="M173.3 26.143l12 6.857V18.778l-12 6.857v-6.857l-12.444 7.11L173.3 33v-6.857z" fill="#A8B5C3" fill-rule="evenodd"/></svg> </a> <a class="play"> <svg width="21" height="24" viewBox="210 14 21 24" xmlns="http://www.w3.org/2000/svg" class="play-icon"><path fill="#A8B5C2" fill-rule="evenodd" d="M230.677 25.815L210 37.63V14"/></svg> <svg width="21px" height="24px" viewBox="210 14 21 24" xmlns="http://www.w3.org/2000/svg" class="pause-icon"> <rect id="pause-1" fill="#A8B5C2" fill-rule="evenodd" x="210" y="14" width="7" height="24"></rect> <rect id="pause-2" fill="#A8B5C2" fill-rule="evenodd" x="224" y="14" width="7" height="24"></rect> </svg> </a> </div> </nav> <div class="loading"> <svg xmlns="http://www.w3.org/2000/svg" width="468" height="153" viewBox="166 91 468 153" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <path id="a" d="M55.185 12.262c-.347.79-.546 1.666-.546 2.62 0 4.574-7.84 53.744-7.84 58.546 0 4.8-2.533 11.727 0 11.727 2.534 0 7.29 1.25 11.385-4.788 4.097-6.037 17.77-29.975 19.23-29.975 1.457 0-7.587 28.44-.427 29.975 4.607.99 11.635-3.858 16.48-8.035.96 5.18 4.9 8.22 13.818 8.22 12.986 0 22.383-13.286 22.383-13.286s.418-3.898-5.88 0c-6.298 3.897-4.258 4.342-15.55 6.068-5.856.895-6.797-2.81-6.797-7.433 0-.348.01-.712.03-1.088 3.232.077 12.677-2.964 14.942-4.124 2.67-1.366 2.08-6.77.455-11.34-.923-2.6-3.263-3.09-5.11-3.03-.186-.393-.76-.63-1.858-.63-4.007 0-13.592 7.772-15.904 17.514-2.3 3.564-5.817 7.81-7.944 7.81-3.366 0 8.153-26.21-3.07-29.058-11.224-2.846-23.298 22.52-24.8 23.84-1.5 1.32 8.156-48.312 8.156-53.375 0-.72-.008-1.335-.032-1.86 23.668-3.402 43.71-5.064 47.54-5.783C118.167 3.967 124.47 0 117.77 0c-6.698 0-69.834 4.218-88.825 8.207-18.99 3.99-26.468 6.64-26.468 6.64s-4.406 2.98-1.465 7.264c2.003 2.92 14.57-.838 31.063-4.904-1.912 10.082-5.225 32.205-5.225 37.298 0 6.254-1.285 25.32 0 27.04 1.2.........完整代码请登录后点击上方下载按钮下载查看
网友评论0