木琴弹奏效果

代码语言:html

所属分类:多媒体

代码描述:木琴弹奏效果

代码标签:

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
*, *:before, *:after {
  box-sizing: border-box;
}

:root {
  --desired-size: 40;
  --coefficient: 1vmin;
  --size: calc(var(--desired-size) * var(--coefficient));
}

body {
  background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
  height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: sans-serif;
}

main {
  margin: 0;
}

.xylophone {
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: justify;
          justify-content: space-between;
  -webkit-box-align: center;
          align-items: center;
  position: relative;
  height: calc(1.2 * var(--size));
  width: calc(2.5 * var(--size));
  margin: 0 auto;
}

.xylophone > .note:before,
.xylophone > .note:after,
.xylophone:before,
.xylophone:after{
  position: absolute;
  content: '';
}

.xylophone:before,
.xylophone:after {
  height: 30px;
  z-index: -1;
  width: 100%;
  left: 0;
  background-image: -webkit-gradient(line.........完整代码请登录后点击上方下载按钮下载查看

网友评论0