Skip to content

Commit

Permalink
auto load
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed Jun 24, 2024
1 parent b62a25e commit 206f3e2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

<body>
<div id="overlay">
<button id="loadingButton">Play</button>
<button>~ Wait'a minute! ~</button>
</div>
<div id="info">
You trying to access restricted area!<br />
This is global point for
<a href="https://orzklv.uz/" target="_blank" rel="noopener">orzklv</a>'s
<a href="https://orzklv.uz/" target="_blank" rel="noopener" id="anchor">orzklv</a>'s
personal internet space.
<br />
However, you may enjoy Hatsune Miku dance while being here.
Expand Down
25 changes: 10 additions & 15 deletions libs/personal/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,11 @@ import { OutlineEffect } from "three/addons/effects/OutlineEffect.js";
import { MMDLoader } from "three/addons/loaders/MMDLoader.js";
import { MMDAnimationHelper } from "three/addons/animation/MMDAnimationHelper.js";

let mesh, camera, scene, renderer, effect;
let helper;

let mesh, camera, scene, renderer, effect, helper;
let ready = false;

const clock = new THREE.Clock();

// const loadingButton = document.getElementById("loadingButton");
// loadingButton.addEventListener("click", function () {
// Ammo().then(function () {
// init();
// animate();
// });
// });

function init() {
const overlay = document.getElementById("overlay");
// overlay.remove();
Expand Down Expand Up @@ -126,18 +116,25 @@ function init() {

// Remove the overlay
overlay.remove();
expose();

window.addEventListener("resize", onWindowResize);
}

function expose() {
document.body.style.color = "#d5d5d5";
const anchor = document.getElementById("anchor");
anchor.style.color = "#08f";
}

function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();

effect.setSize(window.innerWidth, window.innerHeight);
}

//
// Animation loop

function animate() {
requestAnimationFrame(animate);
Expand All @@ -152,10 +149,8 @@ function render() {
effect.render(scene, camera);
}

console.log("Animation loaded!");

// Automatically start the animation
Ammo().then(function () {
init();
animate();
});
});
6 changes: 4 additions & 2 deletions styles/priority.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
body {
color: #d5d5d5;
/* #d5d5d5 */
color: #000;
background: #000;
}

a {
color: #08f;
/* #08f */
color: #000;
}

0 comments on commit 206f3e2

Please sign in to comment.