-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
318 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | ||
<link href="./static/css/index.css" rel="stylesheet" /> | ||
<title>木鱼-功德版</title> | ||
</head> | ||
|
||
<body> | ||
<div class="muyu"> | ||
<div class="gongde"> | ||
<!-- 功德+1 --> | ||
</div> | ||
<img id="muyu-img" src="./static/img/muyubai.png" /> | ||
</div> | ||
</body> | ||
<script src="./static/js/index.js"></script> | ||
</html> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
background-color: black; | ||
width: 100vw; | ||
height: 100vh; | ||
overflow: hidden; | ||
} | ||
|
||
.muyu { | ||
position: absolute; | ||
margin: auto 0; | ||
display: flex; | ||
bottom: 0px; | ||
top: 0px; | ||
width: 100%; | ||
height: 300px; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
} | ||
|
||
.muyu>img { | ||
width: 150px; | ||
height: 100px; | ||
user-select: none; | ||
transition: all 0.2s; | ||
} | ||
|
||
.gongde { | ||
position: relative; | ||
color: #fff; | ||
height: 10px; | ||
} | ||
|
||
.gongde-item { | ||
position: absolute; | ||
left: -50vw; | ||
width: 100vw; | ||
font-size: 18px; | ||
font-weight: 600; | ||
text-align: center; | ||
transform: translateY(0px); | ||
animation: move 2s; | ||
} | ||
|
||
@keyframes move { | ||
0% { | ||
transform: translateY(0px); | ||
opacity: 1; | ||
} | ||
|
||
100% { | ||
transform: translateY(-100px); | ||
opacity: 0; | ||
} | ||
} | ||
|
||
.setting { | ||
position: relative; | ||
left: 15px; | ||
top: 15px; | ||
} | ||
|
||
.clickDown { | ||
transform: scale(0.9); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* @description: | ||
* @Date: 2022-09-30 13:10:46 | ||
* @LastEditTime: 2022-09-30 13:27:10 | ||
*/ | ||
const muyu = document.querySelector("#muyu-img"); | ||
const listBox = document.querySelector(".gongde"); | ||
const setting = document.querySelector(".setting"); | ||
var gd = 1; | ||
//声音素材 | ||
const audio = new Audio(); | ||
audio.src = "./static/audio.mp3" | ||
audio.volume = 1; | ||
|
||
//动态创建功德弹窗 | ||
const createAlert = () => { | ||
audio.pause() | ||
audio.play() | ||
const div = document.createElement("div"); | ||
div.className = "gongde-item" | ||
div.innerText = `功德 ${gd > 0 ? '+' : ''}${gd}` | ||
setTimeout(() => { | ||
listBox.removeChild(div); | ||
}, 1900); | ||
listBox.append(div) | ||
} | ||
|
||
//木鱼点击后的效果 | ||
const muyuScale = () => { | ||
muyu.className = 'clickDown' | ||
setTimeout(_ => { | ||
muyu.className = '' | ||
}, 200) | ||
} | ||
|
||
let lastTime = new Date().getTime(); | ||
|
||
//木鱼图片按下事件 | ||
muyu.onclick = () => { | ||
if (new Date().getTime() - 500 > lastTime) { | ||
createAlert() | ||
muyuScale(); | ||
lastTime = new Date().getTime(); | ||
} | ||
} | ||
//监听空格键按下事件 | ||
window.addEventListener("keydown", function (event) { | ||
const { code } = event; | ||
if (code == 'Space') { | ||
if (new Date().getTime() - 500 > lastTime) { | ||
muyuScale(); | ||
createAlert() | ||
lastTime = new Date().getTime(); | ||
} | ||
} | ||
}) | ||
|
||
//设置按钮 | ||
setting.onclick = () => { | ||
const gdNumber = prompt("请输入功德值:") | ||
gd = Number(gdNumber) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
body { | ||
background-color: black; | ||
width: 100vw; | ||
height: 100vh; | ||
overflow: hidden; | ||
} | ||
.muyu { | ||
position: absolute; | ||
margin: auto 0; | ||
display: flex; | ||
bottom: 0px; | ||
top: 0px; | ||
width: 100%; | ||
height: 300px; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
> img { | ||
width: 300px; | ||
height: 200px; | ||
user-select: none; | ||
transition: all 0.3s; | ||
} | ||
} | ||
|
||
.gongde { | ||
position: relative; | ||
color: #fff; | ||
height: 10px; | ||
} | ||
.gongde-item { | ||
position: absolute; | ||
left: -50vw; | ||
width: 100vw; | ||
font-size: 18px; | ||
font-weight: 600; | ||
text-align: center; | ||
transform: translateY(0px); | ||
animation: move 2s; | ||
} | ||
|
||
@keyframes move { | ||
0% { | ||
transform: translateY(0px); | ||
opacity: 1; | ||
} | ||
100% { | ||
transform: translateY(-100px); | ||
opacity: 0; | ||
} | ||
} | ||
|
||
.setting { | ||
position: relative; | ||
left: 15px; | ||
top: 15px; | ||
} | ||
|
||
.clickDown{ | ||
transform: scale(0.9); | ||
} |
Oops, something went wrong.