-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
486 lines (431 loc) · 27.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<script>
function updateProgressBar() {
const currElem = document.getElementById('vmdcurr');
const playElem = document.getElementById('vmdplay');
if (!currElem || !playElem) {
//console.error('One or more elements are missing');
return;}
const currTime = parseTime(currElem.textContent);
const playTime = parseTime(playElem.textContent);
if (currTime === null || playTime === null) {
console.error('Invalid time format');
return;}
if (playTime === 0) {
console.error('Play time is zero');
return;}
const progress = Math.min((currTime / playTime) * 100, 100);
const progressBar = document.querySelector('.progress-bar');
if (!progressBar) {
console.error('Progress bar element is missing');
return;}
progressBar.style.width = progress + '%';
console.log(`Current time: ${currTime}s, Play time: ${playTime}s, Progress: ${progress}%`);}
function parseTime(timeStr) {
const [minutes, seconds] = timeStr.split(':').map(Number);
if (isNaN(minutes) || isNaN(seconds) || minutes < 0 || seconds < 0 || seconds >= 60) {
console.error(`Invalid time format: ${timeStr}`);
return null;}
return (minutes * 60) + seconds;}
updateProgressBar();
setInterval(updateProgressBar, 1000);
</script>
<div class="progress-container" style="width: 300px; height: 10px; border: 2px solid #ff69b4; border-radius: 10px; background-color: #fff; overflow: hidden; position: relative;">
<div class="progress-bar" style="height: 100%; width: 0; background-color: #ff69b4; transition: width 0.5s ease;"></div></div>
<!--GeneratePmx2Links-->
<script>
document.addEventListener('DOMContentLoaded', function() {
const pmx2linksContainer = document.getElementById('pmx2links');
const links = document.querySelectorAll('a[href*="?pmx="]');
links.forEach(link => {
let originalHref = link.getAttribute('href');
let newHref = originalHref.replace('?pmx=', '?pmx2=');
const newLink = document.createElement('a');
newLink.textContent = link.textContent; // Copy the text content
newLink.setAttribute('href', newHref); // Set the modified href
newLink.addEventListener('click', function(event) {
event.preventDefault(); // Prevent the default action (navigation)
let currentUrl = window.location.href;
let newUrl;
if (currentUrl.includes('?')) {
newUrl = currentUrl + '&' + newHref.split('?')[1]; // Append new query string
} else {
newUrl = currentUrl + '?' + newHref.split('?')[1]; // Append new query string
}
window.location.href = newUrl;
});
pmx2linksContainer.appendChild(newLink);
});
});
</script>
<div style="display: flex; flex-direction: row;">
<div id="readystate">...If vmd will cause keychar err, use https://www.mediafire.com/file/9olqch9pazq3fzd/AnimationSmoother.rar...</div>
<div id="error"> </div>
<b> Curr </b>
<div id="vmdcurr">0:00</div>
<b> VMDPlaytime: </b>
<div id="vmdplay">0:00</div>
<div id="xyzvalue">...</div>
</div>
<button onclick="togglePhysicsAndReload()">Toggle Physics</button>
<script>
function togglePhysicsAndReload() {
var physicsAreOn = localStorage.getItem("physicsareon");
if (physicsAreOn) {
localStorage.removeItem("physicsareon");
} else {
localStorage.setItem("physicsareon", "true");}
location.reload();}
var physicsAreOn = localStorage.getItem("physicsareon");
if (physicsAreOn) {
document.querySelector("button").textContent = "Physics On";
} else {
document.querySelector("button").textContent = "Physics Off";}
</script>
<!--<button onclick="clonePMX()">Clone PMX</button>-->
<div class="keyboard">
<button id="." onclick="togglePhysicsAndReload()" style="background-color: transparent; border: none;color: transparent;">Move L3.__</button>
<button id="moveUpButton">Move Up</button><br>
<button id="moveLeftButton">Move Left</button>
<button id="moveDownButton">Move Down</button>
<button id="moveRightButton">Move Right</button>
<button id="." style="background-color: transparent; border: none;color: transparent;">.__</button>
<button id="rotateleftButton">RotateLeft</button>
<button id="rotaterightButton">RotateRight</button>
<button id="retrieveButton" onclick="const pmxheight = localStorage.getItem('pmxheight'); document.getElementById('pmxdata').innerText = pmxheight !== null ? pmxheight : 'pmxheight not found in local storage';">pmxdata</button><div id="pmxdata"></div>
<a target="_blank" href="https://www.youtube.com/playlist?list=PLBva3abEZvyT-_ajETBGeOCGBA_AFBT5Z#https://www.reddit.com/r/mikumikudance" style=color:blue>r/MMD</a> <a target="_blank" href="https://codepen.io/ryedai1/pens/tags/?selected_tag=mikumikudance" style=color:gray>(tools)</a>
(<a target="_blank" href="https://github.com/Ry3yr/SampleWebMMD" style=color:blue>src</a>)(<a target="_blank" href="https://ry3yr.github.io/SampleWebMMD-master.zip" style=color:blue>src-DLD</a>)
<a target="_blank" href="https://www.youtube.com/playlist?list=PLK4C8g4vpj7WfT3z0037RzrEMwor007EV">Mocap</a>(<a target="_blank" href="https://sao.animetheme.com/XR_Animator.html#https://github.com/ButzYung/SystemAnimatorOnline/releases" style=color:blue>WebCamMocap</a>) (<a target="_blank" href="https://vrm-viewer.ownverse.world#https://virtual-cast.github.io/babylon-vrm-loader#https://pixiv.github.io/three-vrm/packages/three-vrm/examples/webgpu-dnd.html" style=color:blue>vrm</a>)<br> <!--<a target="_blank" href="http://10.10.10.254/data/UsbDisk1/Volume1/SampleWebMMD-master/index.html?pmx=YusakuFujiki/yusaku.pmx&stage=/livestageclub/livestageclubanimated.pmx&vmd=bts-dna" style=color:blue>Offline-TripMate</a>(<a target="_blank" href="https://alceawis.de/qrgen.html?qr=http://10.10.10.254/data/UsbDisk1/Volume1/SampleWebMMD-master/index.html?pmx=YusakuFujiki/yusaku.pmx&stage=/livestageclub/livestageclubanimated.pmx&vmd=bts-dna" style=color:blue>qr</a>)-->
</div>
<details>
<input type="text" id="buttonvmdInput" value="001" style="width: 100px;">
<button type="button" onclick="copyToClipboard()">Copy</button>
<button type="button" onclick="updateQueryStringParameter('vmd', document.getElementById('buttonvmdInput').value);checkfile();">cstm</button>
<button type="button" onclick="var value = document.getElementById('buttonvmdInput').value;updateQueryStringParameter('vmd', value);updateQueryStringParameter('vmd2', value + '_2');checkfile();">cstm(2)</button>
<button type="button" onclick="localStorage.setItem('camid', document.getElementById('buttonvmdInput').value); PoseClickEvent(document.getElementById('buttonvmdInput').value);">cstm+cam</button>
<input type="checkbox" id="checkboxSendToPHP">
<label for="checkboxSendToPHP">Send to PHP</label>
<!--CopytoClipboard---Code----->
<script>
function copyToClipboard() {
var inputText = document.getElementById("buttonvmdInput").value;
var outputText = '{ id: "' + inputText + '", pose: "' + inputText + '", VmdClip: null, AudioClip: false },';
if (document.getElementById("checkboxSendToPHP").checked) {
// Send the output text to mainvmdwrite.php
var url = "mainvmdwrite.php";
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
alert("Text sent to mainvmdwrite.php!");
}};
xhr.send("outputText=" + encodeURIComponent(outputText));
} else {
navigator.clipboard.writeText(outputText)
.then(function() {
alert("Text copied to clipboard!");})
.catch(function(error) {
console.error("Error copying text: ", error);
});}}
</script>
</details>
<script>
document.addEventListener('DOMContentLoaded', function() {
if (window.self !== window.top) {
var copyButton = document.querySelector('button[onclick="copyToClipboard()"]');
copyButton.disabled = true;
copyButton.addEventListener('mouseover', function() {
var tooltip = document.createElement('span');
tooltip.innerText = 'Disabled by CORS Policy';tooltip.style.position = 'absolute';tooltip.style.backgroundColor = '#000';tooltip.style.color = '#fff';tooltip.style.padding = '5px';
tooltip.style.borderRadius = '4px';tooltip.style.fontSize = '12px';tooltip.style.visibility = 'visible';tooltip.style.top = copyButton.offsetTop + copyButton.offsetHeight + 'px';
tooltip.style.left = copyButton.offsetLeft + 'px';document.body.appendChild(tooltip);});
copyButton.addEventListener('mouseout', function() {
var tooltip = document.querySelector('span');
tooltip.parentNode.removeChild(tooltip);});}});
</script>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
</head>
<div class="pose">
<!--<button type="button" value="001" onclick="updateQueryStringParameter('vmd', this.value); localStorage.setItem('camid', this.value);">vm1</button>-->
<!--<button type="button" value="001" onclick="updateQueryStringParameter('vmd', this.value); localStorage.setItem('camid', this.value);">vm1</button>-->
<button type="button" value="001" onclick="updateQueryStringParameters(this.value); localStorage.setItem('camid', this.value); location.reload();">vm1</button>
<button type="button" value="002" onclick="updateQueryStringParameters(this.value); localStorage.setItem('camid', this.value); location.reload();">vm2</button>
<button type="button" value="003" onclick="updateQueryStringParameters(this.value); localStorage.setItem('camid', this.value); location.reload();">vm3(camoff)</button>
<button type="button" value="004walknthink" onclick="updateQueryStringParameters(this.value); localStorage.setItem('camid', this.value); location.reload();">vm4</button>
<button type="button" value="005hard-carry" onclick="updateQueryStringParameters(this.value); localStorage.setItem('camid', this.value); location.reload();">tst(audio)</button>
<button type="button" value="bts-bestofme" onclick="updateQueryStringParameters(this.value); localStorage.setItem('camid', this.value); location.reload();">best(audio)</button>
<button type="button" value="bts-bestofme" value2="bts-bestofme" onclick="updateQueryStringParameters(this.value, this.getAttribute('value2')); localStorage.setItem('camid', this.value); location.reload();">TwoVMD</button>
</div>
<details><summary>All Motions</summary><div class="file-buttons" id="file-buttons"></div></details>
<script>
function updateQueryStringParameters(vmdValue, vmd2Value) {
var url = new URL(window.location.href);
console.log('Initial URL:', url.toString());
url.searchParams.set('vmd', vmdValue);
console.log('After setting vmd:', url.toString());
if (vmd2Value !== undefined && vmd2Value !== null && vmd2Value !== '') {
url.searchParams.set('vmd2', vmd2Value);
console.log('After setting vmd2:', url.toString());
} else {
url.searchParams.delete('vmd2');
console.log('After deleting vmd2:', url.toString());
}
window.history.replaceState(null, null, url.toString());
console.log('Final URL:', url.toString());
}
</script>
<!--<button id="loadButton" value="./vmd/002.vmd">Load VMD File</button>-->
<a href="?pmx=YusakuFujiki/yusaku.pmx">Yu</a>
<a href="?pmx=AoiZaizen/AoiZaizen.pmx">Aoi</a>
<a href="?pmx=Xion/xion.pmx">Xion</a>
<a href="?pmx=9s/9s.pmx">9s</a>
<a href="?pmx=2b/na_2b_0418n.pmx">2B</a>
<a href="?pmx=TLoZ_Zelda_(Scholar)/zelda_scholar.pmx">BOTW Zelda</a>
<a href="?pmx=TLoZ_Zelda_(Skyward_Sword)/Zelda_(Skyward_Sword).pmx">SW Zelda</a>
<a href="?pmx=TLoZ_Link_BOTW)/linkbotw.pmx">BOTW Link</a>
<a href="?pmx=Roxas/roxas.pmx">Roxas</a>
<a href="?pmx=off/off.pmx">-[OFF]-</a>
<a href="javascript:var spoiler = document.getElementById('search'); spoiler.open = !spoiler.open;" style="display: inline-block; padding: 1px 2px; background-color: #007BFF; color: white; text-decoration: none; border-radius: 4px; font-family: Arial, sans-serif;">(xtras)</a>
</div>
<details><summary>2ndChara</summary><div id="pmx2links"></div></details>
<details id="search"><summary style="display: none;">-</summary>
<button class="off-button" onclick="window.location.href='?pmx=YusakuFujiki/yusaku.pmx&pmx2=AoiZaizen/AoiZaizen.pmx';" style="background-color: #ffcccc; border: #ff9999; border-radius: 8px; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; transition-duration: 0.4s;">yusaao</button>
<button class="off-button" onclick="window.location.href='?pmx=Xion%2Fxion.pmx&pmx2=Roxas%2Froxas.pmx';" style="background-color: #ffcccc; border: #ff9999; border-radius: 8px; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; transition-duration: 0.4s;">Xion&Rox</button>
<button class="off-button" onclick="window.location.href='?pmx=IshizuIshtar/IshizuIshtar.pmx&pmx2=SetoKaiba/SetoKaiba.pmx';" style="background-color: #ffcccc; border: #ff9999; border-radius: 8px; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; transition-duration: 0.4s;">Ishi&Kaiba</button>
-
<button onclick="window.location.href='?pmx=YusakuFujiki%2Fyusaku.pmx&pmx2=AoiZaizen%2FAoiZaizen.pmx&stage=%2Flivestageclub%2Flivestageclubanimated.pmx&vmd=30sechug&vmd2=30sechug_2';">yusao-hug</button>
<button onclick="window.location.href='?pmx=AoiZaizen%2Fkimono%2FAoiZaizen.pmx&pmx2=off%2Foff.pmx&vmd=teamo-duet&stage=/livestageclub/livestageclubanimated.pmx';">(kimono)</button>
</details>
<!--Extra--Elements-->
<div style="display: flex; flex-direction: row;">
<button id="play" onclick="renderer.domElement.requestFullscreen()" style="background-color: pink; background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.25) 50%, rgba(255, 255, 255, 0.25) 75%, transparent 75%, transparent); background-size: 20px 20px; border: none; color: white; padding: 10px 20px; font-size: 16px; font-weight: bold; border-radius: 5px; box-shadow: 0 0 10px rgba(255, 105, 180, 0.5); cursor: pointer; transition: transform 0.3s;" title="Spacebar">Play Animation and Audio</button> <button id="fullscreenButton" title="F10" style="opacity: 0.2; transition: opacity 0.3s; background-color: #007BFF; border: none; padding: 10px 20px; border-radius: 5px;">Fullscreen</button>
<label class="switch"><input type="checkbox" id="toggleSwitch" title="extras yes/no"><span class="slider"></span></label>Face/Lips/Extras: <span id="statusValue">Unknown</span>
</div>
<!---Toggle-extraz--localstorage-value-between-yes-and-no-->
<style>
.switch{position:relative;display:inline-block;width:60px;height:34px}.slider,.slider:before{position:absolute;transition:.4s}.switch input{opacity:0;width:0;height:0}.slider{cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;border-radius:34px}.slider:before{content:"";height:26px;width:26px;border-radius:50%;left:4px;bottom:4px;background-color:#fff}input:checked+.slider{background-color:#2196f3}input:checked+.slider:before{transform:translateX(26px)}
</style>
<script>
function updateStatus(isChecked) {
const statusValue = isChecked ? 'yes' : 'no';
localStorage.setItem('extraz', statusValue);
document.getElementById('statusValue').textContent = statusValue;}
function loadStatus() {
const storedValue = localStorage.getItem('extraz');
const isChecked = storedValue === 'yes';
document.getElementById('toggleSwitch').checked = isChecked;
updateStatus(isChecked);}
document.getElementById('toggleSwitch').addEventListener('change', (event) => {
updateStatus(event.target.checked);
});
// Ensure the function is called after the DOM is fully loaded
document.addEventListener('DOMContentLoaded', loadStatus);
</script>
<!----Check VMD File--Existance--->
<!--<button id="checkFileButton" onclick="checkfile()">Check File</button>-->
<script>
function getQueryStringParameter(name) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(name);}
async function checkFileExistence(filePath) {
try {
const response = await fetch(filePath, { method: 'HEAD' });
if (response.ok) {
console.log(`File exists: ${filePath}`);
document.getElementById('readystate').textContent = `File exists: ${filePath}`;
location.reload();
} else {
console.log(`File does not exist (404): ${filePath}`);
document.getElementById('readystate').textContent = `File doesn't exist: ${filePath}`;}
} catch (error) {
console.error(`Error fetching file: ${error}`);
document.getElementById('readystate').textContent = `Error fetching file: ${error}`;}}
function checkfile() {
const vmd = getQueryStringParameter('vmd');
if (vmd) {
const filePath = `./vmd/${vmd}.vmd`;
checkFileExistence(filePath);
} else {
console.log('No vmd parameter found in the query string.');
document.getElementById('readystate').textContent = 'No vmd parameter found in the query string.';}}
const domContentLoadedHandler = () => {
checkfile();
};
</script>
<!--AudioPlayback--ThreeJS-ver-->
<script>
async function playAnimationAndAudio() {
const urlParams = new URLSearchParams(window.location.search);
const vmdValue = urlParams.get('vmd');
if (!vmdValue) {
console.log('No vmd parameter found in the URL');
return false;
}
console.log('vmdValue from URL:', vmdValue);
const audioPath = `audio/${vmdValue}.mp3`;
const audioListener = new THREE.AudioListener();
const audio = new THREE.Audio(audioListener);
const audioLoader = new THREE.AudioLoader();
// Load audio file
try {
const audioBuffer = await new Promise((resolve, reject) => {
audioLoader.load(audioPath, resolve, onAudioLoadProgress, reject);
});
audio.setBuffer(audioBuffer);
audio.setLoop(true); // Set to true if audio should loop
audio.setVolume(1.0); // Adjust volume as needed
audio.play();
console.log('Audio loaded and playing:', audioPath);
} catch (error) {
console.error('Error loading audio:', error);
return false;
}
// Function to handle audio load progress (optional)
function onAudioLoadProgress(xhr) {
if (xhr.lengthComputable) {
const percentComplete = (xhr.loaded / xhr.total) * 100;
console.log('Audio load progress:', percentComplete.toFixed(2) + '%');
}
}
const clock = new THREE.Clock();
function update() {
const delta = clock.getDelta();
}
update();
return true;
}
</script>
<!--AudioPlayback--non-ThreeJS-ver-->
<!--
<script>
function playAnimationAndAudio() {
var urlParams = new URLSearchParams(window.location.search);
var vmdValue = urlParams.get('vmd');
if (vmdValue) {
var audioPath = 'audio/' + vmdValue + '.mp3';
if (window.audioElement && !window.audioElement.paused) {
window.audioElement.currentTime = 0;
} else {
setTimeout(500);
window.audioElement = new Audio(audioPath);
audioElement.loop = true;
}
window.audioElement.play();
console.log('Animation triggered');
} else {
console.log('No vmd parameter found in the URL');}}
</script>
-->
<div class="stage">
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/herogarden/herogarden.pmx';window.location.href = updatedUrl;})()">herogarden</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/parkavenue/parkavenue.pmx';window.location.href = updatedUrl;})()">parkavenue</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/livestageclub/livestageclubanimated.pmx';window.location.href = updatedUrl;})()">(anim)LiveStage</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/changeme/changeme.pmx';window.location.href = updatedUrl;})()">(anim)ChangeMe</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/satisfcation/satisfcation.pmx';window.location.href = updatedUrl;})()">(anim)SatisFactionary</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/h2cu09/h2cu09.pmx';window.location.href = updatedUrl;})()">h2cu09</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/SciFi_Cube/SciFi_Cube.pmx';window.location.href = updatedUrl;})()">SciFi_Cube</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/kh_twilighttown/kh_station_plaza/Station_Plaza.pmx';window.location.href = updatedUrl;})()">TwilightTownStation</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/([?&])stage=[^&]*/g, '$1').replace(/(&|\?)$/, '');var newStageParam = encodeURIComponent('/kh_twtnw/Memory\'s_Skyscraper/Memory\'s_Skyscraper.pmx');updatedUrl += (updatedUrl.indexOf('?') > -1 ? '&' : '?') + 'stage=' + newStageParam;window.location.href = updatedUrl;})()">TWTNW Skyscraper</a>
<a href="javascript:(function() {var currentUrl = window.location.href;var updatedUrl = currentUrl.replace(/(\?|&)stage=([^&]*)/g, '') + (currentUrl.indexOf('?') > -1 ? '&' : '?') +'stage=/palette_stage/palette_stage.pmx';window.location.href = updatedUrl;})()">palette_stage</a>
<a href target="_blank" ="#" onclick="redirectToTargetURL();"><b>[TestStageCoordinates]</b></a>
<a href="javascript:void(0)" onclick="window.open('modelloader.html' + window.location.search, '_blank')">Open Model Loader</a>
</div>
<!--redirect--coordinates--for--stage-->
<script>
function redirectToTargetURL() {
var currentURL = window.location.href;
var targetURL = "stageloader.html";
var queryParams = currentURL.split("?")[1];
var finalURL = targetURL + "?" + queryParams;
window.open(finalURL, "_blank");
}
</script>
<script src="./libs/three.js"></script>
<script src="./libs/mmdparser.min.js"></script>
<script src="./libs/ammo.min.js"></script>
<script src="./libs/TGALoader.js"></script>
<script src="./libs/MMDLoader.js"></script>
<script src="./libs/MMDAnimationHelper.js"></script>
<script src="./libs/mmd-loader.min.js"></script>
<script src="./libs/CCDIKSolver.js"></script>
<script src="./libs/MMDPhysics.js"></script>
<!--<script src="./libs/Vmd.js"></script>
<script src="./postprocessing/EffectComposer.js"></script>
<script src="./postprocessing/RenderPass.js"></script>
<script src="./postprocessing/ShaderPass.js"></script>
<script src="./postprocessing/FXAAShader.js"></script>
<script src="./postprocessing/BloomPass.js"></script>
<script src="./postprocessing/Pass.js"></script>
<script src="./shaders/ConvolutionShader.js"></script>
<script src="./shaders/LuminosityShader.js"></script>
<script src="./libs/VmdFileParser.js"></script>-->
<!--<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r106/build/three.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r106/examples/js/libs/mmdparser.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/ammo.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r106/examples/js/loaders/TGALoader.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r106/examples/js/loaders/MMDLoader.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r106/examples/js/animation/MMDAnimationHelper.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r106/examples/js/animation/CCDIKSolver.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r106/examples/js/animation/MMDPhysics.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/jsm/controls/OrbitControls.js"></script>-->
<script src="./js/main.js"></script>
</body>
</html>
<!----Mark--used-button--green-->
<script>
window.addEventListener('load', function() {
const urlParams = new URLSearchParams(window.location.search);
var vmdValue = urlParams.get('vmd');
var buttons = document.querySelectorAll("button");
for (var i = 0; i < buttons.length; i++) {if (buttons[i].value === vmdValue) {buttons[i].style.backgroundColor = "lightgreen";}}
});
</script>
<!--AllMotions-show---onlineCompOnly--->
<script>
const fileDir = './vmd';
function listFiles() {
const fileButtonsContainer = document.getElementById('file-buttons');
fetch(fileDir)
.then(response => response.text())
.then(data => {
const doc = new DOMParser().parseFromString(data, 'text/html');
const files = [...doc.getElementsByTagName('a')];
files
.map(file => file.textContent.trim())
.filter(fileName => fileName.endsWith('.vmd'))
.forEach(fileName => {
const button = document.createElement('button');
button.type = 'button';
button.value = fileName;
button.textContent = fileName.replace('.vmd', '');
button.onclick = () => {
updateQueryStringParameter('vmd', fileName.replace('.vmd', ''));
location.reload();};
fileButtonsContainer.appendChild(button);});})
.catch(error => {
console.error('Error listing files:', error);
});}
function updateQueryStringParameter(key, value) {
const url = new URL(window.location.href);
url.searchParams.set(key, value);
window.history.replaceState({}, '', url.toString());}
window.addEventListener('load', listFiles);
</script>
<!--keyboard-shortcuts--f10--spacebar-->
<script>
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('keydown', function(event) {
if (event.key === 'F10') {
event.preventDefault(); // Prevent default action (fullscreen mode)
renderer.domElement.requestFullscreen()}});
document.addEventListener('keydown', function(event) {
if (event.key === ' ') { // Spacebar key
event.preventDefault(); // Prevent default action (scrolling the page)
document.getElementById('play').click();}});});
</script>