diff --git a/raws/projets/2022-01-01_quiz.md b/raws/projets/2022-01-01_quiz.md new file mode 100644 index 0000000..8b49ea0 --- /dev/null +++ b/raws/projets/2022-01-01_quiz.md @@ -0,0 +1,15 @@ +--- +title: Out Of Quiz +tags: rust vanillaJS jeu +date: 2022-01-01 +yearonly: true +url: quiz.html +--- + + + +git: [git.gltronic.ovh/gltron/OutOfQuiz](https://git.gltronic.ovh/gltron/OutOfQuiz) + +app: [quiz.gltronic.ovh](https://quiz.gltronic.ovh/) + +Out Of Quiz est un jeu multijoueur de type quiz de vitesse, basé sur le Out Of Context d'un serveur Discord diff --git a/raws/projets/2022-02-01_impact.md b/raws/projets/2022-02-01_impact.md new file mode 100644 index 0000000..2fd1741 --- /dev/null +++ b/raws/projets/2022-02-01_impact.md @@ -0,0 +1,15 @@ +--- +title: Deep Impact +tags: vanillaJS jeu +date: 2022-02-01 +yearonly: true +url: impact.html +--- + + + +git: [git.gltronic.ovh/gltron/DeepImpact](https://git.gltronic.ovh/gltron/DeepImpact) + +app: [impact.gltronic.ovh](https://impact.gltronic.ovh/) + +Deep Impact est un missile command musical diff --git a/resources/img/projets/impact_logo.webp b/resources/img/projets/impact_logo.webp new file mode 100644 index 0000000..c467147 Binary files /dev/null and b/resources/img/projets/impact_logo.webp differ diff --git a/resources/img/projets/quiz_logo.webp b/resources/img/projets/quiz_logo.webp new file mode 100644 index 0000000..1a11c91 Binary files /dev/null and b/resources/img/projets/quiz_logo.webp differ diff --git a/resources/js/main.js b/resources/js/main.js index e6faa35..7abe0b7 100644 --- a/resources/js/main.js +++ b/resources/js/main.js @@ -15,6 +15,7 @@ let incrementer = 0.01; let reverse = false; const rotationSpeed = 0.001; const orbitRadius = 1; +let lastRender = 0 // Helper function setupContainer (container) { @@ -84,8 +85,6 @@ async function initModels() { modelMoon.castShadow = true; modelMoon.receiveShadow = true; scene.add(modelMoon); - - animateScene(); } // Animation @@ -106,17 +105,21 @@ function easeInOut() { }; function animateScene() { + + if ((performance.now() - lastRender) > (1000 / 60)) { + modelPlanet.position.set(1, easeInOut() / 4 + 0.5, 0); + modelPlanet.rotation.y += rotationSpeed; + + // const x = Math.cos(incrementer) * orbitRadius; + // const z = Math.sin(incrementer) * orbitRadius; + modelMoon.position.set(0, 1 - easeInOut() - 2, 0); + modelMoon.rotation.y -= rotationSpeed + 0.01; + + renderer.render(scene, camera); + } + + requestAnimationFrame(animateScene); - - modelPlanet.position.set(1, easeInOut() / 4 + 0.5, 0); - modelPlanet.rotation.y += rotationSpeed; - - // const x = Math.cos(incrementer) * orbitRadius; - // const z = Math.sin(incrementer) * orbitRadius; - modelMoon.position.set(0, 1 - easeInOut() - 2, 0); - modelMoon.rotation.y -= rotationSpeed + 0.01; - - renderer.render(scene, camera); } // Main @@ -124,6 +127,7 @@ export function init() { initScene(); initLights(); initModels(); + animateScene(); } init(); diff --git a/templates/base.hbs b/templates/base.hbs index 84cc492..9cf393d 100644 --- a/templates/base.hbs +++ b/templates/base.hbs @@ -7,7 +7,5 @@ {{> submenu}} {{> article}} -