Skip to content

Commit 1caa866

Browse files
v1.1.8
1 parent 134bb1b commit 1caa866

File tree

33 files changed

+38501
-255
lines changed

33 files changed

+38501
-255
lines changed

dist/admin/add-project/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@
8787
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>
8888
</svg>
8989
</a>
90+
<a href="../games/index.html" class="app-sidebar-link" style="display: block;padding: 8px;">
91+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-joystick" viewBox="0 0 24 24">
92+
<path d="M10 2a2 2 0 0 1-1.5 1.937v5.087c.863.083 1.5.377 1.5.726 0 .414-.895.75-2 .75s-2-.336-2-.75c0-.35.637-.643 1.5-.726V3.937A2 2 0 1 1 10 2z"/>
93+
<path d="M0 9.665v1.717a1 1 0 0 0 .553.894l6.553 3.277a2 2 0 0 0 1.788 0l6.553-3.277a1 1 0 0 0 .553-.894V9.665c0-.1-.06-.19-.152-.23L9.5 6.715v.993l5.227 2.178a.125.125 0 0 1 .001.23l-5.94 2.546a2 2 0 0 1-1.576 0l-5.94-2.546a.125.125 0 0 1 .001-.23L6.5 7.708l-.013-.988L.152 9.435a.25.25 0 0 0-.152.23z"/>
94+
</svg>
95+
</a>
9096
<a href="../settings/index.html" class="app-sidebar-link">
9197
<svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="feather feather-settings" viewBox="0 0 24 24">
9298
<defs />
@@ -110,7 +116,7 @@
110116
</header>
111117
<div class="main-layout">
112118
<div class="result">
113-
<iframe data-tab="html" src="./"></iframe>
119+
<iframe data-tab="html" src="./results/index.html"></iframe>
114120
</div>
115121

116122
<div class="splitter" data-splitter="yes"></div>
@@ -128,6 +134,9 @@
128134
<!--the world is your oyster-->
129135
<!--add your HTML here & watch the magic happen!-->
130136
<!-- still under development -->
137+
&lt;div class="test"&gt;
138+
&lt;h1&gt;Test&lt;/h1&gt;
139+
&lt;/div&gt;
131140
</textarea>
132141

133142
</div>

dist/admin/add-project/results/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
<meta http-equiv="X-UA-Compatible" content="IE=edge">
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
99
<title>Test</title>
10+
<link rel="stylesheet" href="./styles.css" />
1011
</head>
1112
<body>
1213
<div class="test">
1314
<h1>Test</h1>
1415
</div>
1516
</body>
17+
<script src="./script.js"></script>
1618
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
var test = '';
142 KB
Loading
217 KB
Loading

dist/admin/games/assets/derby.png

755 KB
Loading
287 KB
Loading
144 KB
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="en" >
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Baseball - Home Run </title>
6+
<link rel="stylesheet" href="./style.css">
7+
<link href="https://straight-code.github.io/assets/straight-code.png" rel="shortcut icon" />
8+
</head>
9+
<body>
10+
<!-- partial:index.partial.html -->
11+
<!-- I apologize for the janky gameplay on mobile Safari-->
12+
<div id='game_console'>
13+
<div id='ballpark'>
14+
<div id='scoreboard'></div>
15+
<div id='pitcher'></div>
16+
<div id='batter' class=''></div>
17+
<div id='ball' style='left: 43%; top: 58.5%;'></div>
18+
</div>
19+
<div id='homeruns'>0</div>
20+
<div id='outs'>0</div>
21+
<div id='start_screen'><span>T</span><span>A</span><span>P</span> <span>T</span><span>O</span> <span>P</span><span>L</span><span>A</span><span>Y</span>
22+
<p>Tap to throw pitch<br>Tap again to swing</p>
23+
</div>
24+
</div>
25+
26+
<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap" rel="stylesheet">
27+
28+
<audio src="http://contentservice.mc.reyrey.net/audio_v1.0.0/?id=d1f9b7da-033e-5f86-94e6-4500351eb570" id='back_sound' preload loop></audio>
29+
<audio src="http://contentservice.mc.reyrey.net/audio_v1.0.0/?id=4b11ab1d-fdba-569d-b932-1974bde0671a" id='bat_hit' preload></audio>
30+
<audio src="http://contentservice.mc.reyrey.net/audio_v1.0.0/?id=b916d76b-e068-55e0-bfae-5833b9c3004f" id='clapping' preload></audio>
31+
<!-- partial -->
32+
<script src="./script.js"></script>
33+
34+
</body>
35+
</html>
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
const gc = document.querySelector('#game_console')
2+
const ss = document.querySelector('#start_screen')
3+
const ball = document.querySelector('#ball')
4+
const batter = document.querySelector('#batter')
5+
const pitcher = document.querySelector('#pitcher')
6+
const bp = document.querySelector('#ballpark')
7+
const homers = document.querySelector('#homeruns')
8+
const outss = document.querySelector('#outs')
9+
const sb = document.querySelector('#scoreboard')
10+
const backingTrack = document.querySelector('#back_sound')
11+
const hitBall = document.querySelector('#bat_hit')
12+
const clapping = document.querySelector('#clapping')
13+
14+
var thrown = false;
15+
const hr = [6,7,8,14,15,16,22,23,24]
16+
var homeruns = 0
17+
var outs = 0
18+
19+
var b_loc = ball.getBoundingClientRect()
20+
var x = b_loc.x
21+
const start_x = b_loc.x
22+
var y = b_loc.y
23+
const start_y = b_loc.y
24+
25+
26+
function throwPitch() {
27+
if(thrown){
28+
bp.removeEventListener('click', throwPitch)
29+
batter.classList.add('swing')
30+
var bp_loc = bp.getBoundingClientRect()
31+
var b_loc = ball.getBoundingClientRect()
32+
var dist = Math.round(Math.hypot(0, (bp_loc.y + bp_loc.height) - (b_loc.y + (b_loc.height*.5))))
33+
// console.log(dist)
34+
35+
if(dist <= 30) {
36+
hitBall.play()
37+
ball.style.transition = '2s'
38+
ball.classList.add('hit_ball')
39+
bp.classList.add('alt_bp')
40+
41+
if(hr.includes(dist)) {
42+
clapping.play()
43+
homeruns++
44+
homers.innerHTML = homeruns
45+
sb.innerHTML = 'HOME<br>RUN'
46+
gc.classList.add('hr_sparkle')
47+
if([22,23,24].includes(dist)) {
48+
ball.style.left = (30 - dist) / 4 * 100 + '%'
49+
ball.style.top = '-600px'
50+
}
51+
if([14,15,16].includes(dist)) {
52+
ball.style.left = '800px'
53+
ball.style.top = '-400px'
54+
}
55+
if([6,7,8].includes(dist)) {
56+
ball.style.left = '1000px'
57+
ball.style.top = 100 - (dist / 4 * 100) + '%'
58+
}
59+
} else {
60+
if(dist >= 17) {
61+
ball.style.left = ((30 - dist) * 11.11) + 1 + '%'
62+
ball.style.top = Math.random() < .5 ? -Math.random()*100 + '%' : -Math.random()*100 + '%';
63+
}
64+
if(dist <= 13) {
65+
ball.style.left = Math.random()*150 + 50 + '%'
66+
ball.style.top = 99 - (dist * 11.11) + '%'
67+
}
68+
}
69+
if(!hr.includes(dist)) {
70+
outs++
71+
outss.innerHTML = outs
72+
sb.innerHTML = 'OUT'
73+
}
74+
}
75+
76+
setTimeout(function(){
77+
if(outs == 3) {
78+
ss.style.display = 'block'
79+
bp.classList.remove('alt_bp')
80+
ball.classList.remove('hit_ball')
81+
ball.style.transition = ''
82+
ball.style.left = '43%'
83+
ball.style.top = '58.5%'
84+
batter.classList.remove('swing')
85+
gc.classList.remove('hr_sparkle')
86+
} else {
87+
thrown = false
88+
bp.addEventListener('click', throwPitch)
89+
bp.classList.remove('alt_bp')
90+
ball.classList.remove('hit_ball')
91+
ball.style.transition = ''
92+
ball.style.left = '43%'
93+
ball.style.top = '58.5%'
94+
batter.classList.remove('swing')
95+
gc.classList.remove('hr_sparkle')
96+
}
97+
}, 2500)
98+
}
99+
100+
if(!thrown) {
101+
thrown = true
102+
var speed = Math.random() + 1.25
103+
ball.style.transition = speed + 's'
104+
ball.style.left = '-58px'
105+
ball.style.top = 'calc(100% + 50px)'
106+
clapping.pause()
107+
clapping.currentTime = 0
108+
}
109+
// console.log(speed)
110+
}
111+
112+
ss.addEventListener('click', function(){
113+
ss.style.display = 'none'
114+
bp.addEventListener('click', throwPitch)
115+
homeruns = 0
116+
outs = 0
117+
outss.innerHTML = outs
118+
homers.innerHTML = homeruns
119+
thrown = false
120+
back_sound.volume = .025
121+
back_sound.play()
122+
})
123+
124+
function updateBall() {
125+
if(thrown) {
126+
x--
127+
y++
128+
ball.style.left = x + 'px'
129+
ball.style.top = y + 'px'
130+
}
131+
132+
setTimeout(updateBall,1000/10)
133+
}

0 commit comments

Comments
 (0)