react实现一个音序器Sequencer代码
代码语言:html
所属分类:其他
代码描述:react实现一个音序器Sequencer代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { background: #1e1e21; } .flex { display: flex; flex-direction: row; } .Sequencer { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); padding: 1em; background: #28282c; border-radius: 4px; } .notes { list-style-type: none; position: absolute; left: -100px; top: 75px; text-align: right; color: white; line-height: 60px; opacity: 0.3; } .buttons { display: flex; padding: 0.35em 0 0.5em; } .buttons button, .buttons select { margin: 5px; outline: none; background: #36363c; color: white; padding: 1em; font-size: 12px; letter-spacing: 1px; border-radius: 4px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2); cursor: pointer; border: 2px solid transparent; } .buttons button.active, .buttons select.active { color: #0087ff; border: 2px solid #0087ff; } .buttons .select-wrapper { position: relative; } .buttons .select-wrapper span { position: absolute; color: white; top: -10px; left: 8px; font-size: 9px; letter-spacing: 1px; opacity: 0.3; } .buttons select { position: relative; height: 42px; min-width: 50px; } .pads { box-sizing: border-radius; display: flex; flex-direction: column-reverse; flex-wrap: wrap; } .pads .pad { background: #36363c; border-radius: 4px; cursor: pointer; width: calc(600px / 10 - 10px); height: calc(600px / 10 - 10px); margin: 5px; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3); transition: background 100ms ease; } .pads .pad:hover { background: #42424a; } .pads .pad.active { background: #42424a; } .pads .pad.on { background: #0087ff !important; box-shadow: 0 0 12px 0 rgba(0, 135, 255, 0.8); } @-webkit-keyframes colorize { from { background: red; } to { background: #55ff00; } } @keyframes colorize { from { background: red; } to { background: #55ff00; } } </style> </head> <body translate="no"> <div id='sequencer'></div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/babel.min.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react.15.4.2.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react-dom.15.4.2.js"></script> <script type="text/babel"> const NOTES = { "C0": 16.35,"C#0": 17.32,"D0": 18.35,"D#0": 19.45,"E0": 20.6,"F0": 21.83,"F#0": 23.12,"G0": 24.5,"G#0": 25.96,"A0": 27.5,"A#0": 29.14,"B0": 30.87,"C1": 32.7,"C#1": 34.65,"D1": 36.71,"D#1": 38.89,"E1": 41.2,"F1": 43.65,"F#1": 46.25,"G1": 49,"G#1": 51.91,"A1": 55,"A#1": 58.27,"B1": 61.74,"C2": 65.41,"C#2": 69.3,"D2": 73.42,"D#2": 77.78,"E2": 82.41,"F2": 87.31,"F#2": 92.5,"G2": 98,"G#2": 103.83,"A2": 110,"A#2": 116.54,"B2": 123.47,"C3": 130.81,"C#3": 138.59,"D3": 146.83,"D#3": 155.56,"E3": 164.81,"F3": 174.61,"F#3": 185,"G3": 196,"G#3": 207.65,"A3.........完整代码请登录后点击上方下载按钮下载查看
网友评论0