Tone+skrollr实现滚动鼠标弹奏钢琴效果代码
代码语言:html
所属分类:其他
代码描述:Tone+skrollr实现滚动鼠标弹奏钢琴效果代码,利用skrollr来捕获滚动,利用Tone来模拟钢琴发声。
代码标签: Tone skrollr 滚动 鼠标 弹奏 钢琴
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background: #000;
}
body .background {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-image: url(//repo.bfw.wiki/bfwrepo/icon/62abac9d2c755.gif);
background-size: cover;
background-position: center;
opacity: 0.15;
}
.mask {
position: fixed;
top: calc(50% - 0.1rem);
left: 0;
height: 0.2rem;
width: 100%;
background: rgba(255, 255, 255, 0.05);
z-index: 7;
}
#container {
padding: 50vh 0 60vh;
box-sizing: border-box;
position: relative;
z-index: 8;
}
#autoscroll,
#current-chord {
font-weight: light;
position: fixed;
bottom: 1rem;
line-height: 1;
z-index: 10;
font-size: 20px;
font-weight: 100;
}
#autoscroll {
cursor: pointer;
text-decoration: none;
transition: opacity 500ms ease-out, color 500ms ease-out;
color: white;
left: 50%;
transform: trnaslateX(-50%);
}
#autoscroll::after {
position: absolute;
left: 50%;
bottom: 0;
width: 200px;
text-align: center;
display: block;
transform: translateX(-50%);
content: "Enable Auto Scroll";
}
#autoscroll.active {
color: rgba(255, 255, 255, 0.2);
}
#autoscroll.active::after {
content: "Enable Manual Scroll";
}
#autoscroll:hover {
color: rgba(255, 255, 255, 0.5);
}
#current-chord {
color: rgba(255, 255, 255, 0.5);
right: 1rem;
}
section {
position: relative;
margin: 2rem auto;
width: 98%;
}
section.active span {
transform: scaleX(1.4);
}
section._1_32 {
height: 7vh;
}
section._2_32 {
height: 14vh;
}
section._3_32 {
height: 21vh;
}
section._4_32 {
height: 28vh;
}
section._5_32 {
height: 35vh;
}
section._6_32 {
height: 42vh;
}
section._7_32 {
height: 49vh;
}
section._8_32 {
height: 56vh;
}
section._9_32 {
height: 63vh;
}
section._10_32 {
height: 70vh;
}
section._11_32 {
height: 77vh;
}
section._12_32 {
height: 84vh;
}
section._13_32 {
height: 91vh;
}
section._14_32 {
height: 98vh;
}
section._15_32 {
height: 105vh;
}
section._16_32 {
height: 112vh;
}
section._17_32 {
height: 119vh;
}
section._18_32 {
height: 126vh;
}
section._19_32 {
height: 133vh;
}
section._20_32 {
height: 140vh;
}
section._21_32 {
height: 147vh;
}
section._22_32 {
height: 154vh;
}
section._23_32 {
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0