Skip to content

Commit

Permalink
无阻尼模式 #11
Browse files Browse the repository at this point in the history
  • Loading branch information
itorr committed Aug 25, 2022
1 parent 501605a commit 79780e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- 添加 `?v=takina` 请求参数,可获得 [井上泷奈](https://lab.magiconch.com/sakana/?v=takina) 专属链接
- 添加 `?alpha=true` 请求参数,可获得透明背景 [](https://lab.magiconch.com/sakana/?alpha=true)
- 添加 `?background=red` 请求参数,可自定义背景 `red` `#FF00FF` `'#d77 url(chisato.png)'` 均可 [](https://lab.magiconch.com/sakana/?background=%23d77%20url(chisato.png))
- 添加 `?decay=1` 请求参数,无阻尼永续模式 [#11](https://github.com/itorr/sakana/issues/11)
## 本地调试
`document.less` 需要编译成 `.css` 样式文件 [#6](https://github.com/itorr/sakana/pull/6)

Expand Down
11 changes: 10 additions & 1 deletion html/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if(params.alpha){

// 自定义背景色
if(params.background){
htmlEl.setAttribute('data-alpha',params.alpha);
htmlEl.setAttribute('data-alpha',true);
htmlEl.style.background = params.background;
}

Expand All @@ -54,6 +54,15 @@ const Values = {
};


// 自定义衰减
if(params.decay){
let decay = +params.decay;
for(let key in Values){
Values[key].d = decay;
}
}


const voiceButton = document.querySelector('.set-voice');

const Voices = {
Expand Down

0 comments on commit 79780e3

Please sign in to comment.