Added link to my github profile

It works !
This commit is contained in:
2024-01-11 23:30:46 +01:00
parent 938b16d4b1
commit 8d948d0874
5 changed files with 52 additions and 16 deletions

Binary file not shown.

View File

@@ -6,6 +6,11 @@
<style> <style>
body { margin: 0; overflow: hidden;} body { margin: 0; overflow: hidden;}
a {
text-decoration: none;
color: #2E86AB;
}
#notification_bar { #notification_bar {
position: absolute; position: absolute;
top:20px; top:20px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

@@ -334,6 +334,18 @@ export async function addAssetsOnScene(scene){
nameplateModel.scene.position.z += 0.2; nameplateModel.scene.position.z += 0.2;
scene.add(nameplateModel.scene); scene.add(nameplateModel.scene);
/* --------------------
DEFINING LINK PLATES
-------------------- */
// That's used for signs but may also be used elsewhere
let linkPlates = [];
const linkPlate = await loadModel('src/objects/models/linkPlate.gltf');
linkPlate.scene.scale.set(0.4,0.05,0.4);
linkPlate.scene.rotateOnWorldAxis(new THREE.Vector3(1,0,0), MathUtils.degToRad(90));
alignGround(ground, linkPlate.scene);
linkPlate.scene.position.z += 0.25;//So it can collide with player hitbox
/* -------------------- /* --------------------
ADDING SIGNS ADDING SIGNS
-------------------- */ -------------------- */
@@ -375,22 +387,32 @@ export async function addAssetsOnScene(scene){
scene.add(signPlane); scene.add(signPlane);
} }
/* -------------------- /* SOCIAL NETWORKS */
ADDING LINK PLATES signPictures = ['src/objects/textures/github.png'];
-------------------- */ const notificationsLinks = ['https://github.com/LJ5O'];
for(let i=0; i<1; i++){
const signCopy = sign.scene.clone();
signCopy.position.x = -20.3 + i*5;
signCopy.position.y = 1.36;
scene.add( signCopy );
let linkPlates = []; const signPlaneMaterial = new THREE.MeshBasicMaterial({ map:textureLoader.load(signPictures[i]) });
const signPlane = new THREE.Mesh(SignPlanegeometry, signPlaneMaterial);
signPlane.rotateOnWorldAxis(new THREE.Vector3(1,0,0), MathUtils.degToRad(90));
signPlane.position.set( signCopy.position.x + 0.06, 1.347, 1.65);//Determined by hand
scene.add(signPlane);
const linkPlate = await loadModel('src/objects/models/linkPlate.gltf'); //ADDING LINK PLATES
linkPlate.scene.scale.set(0.4,0.05,0.4); linkPlate.scene.position.y = 0.5;
linkPlate.scene.rotateOnWorldAxis(new THREE.Vector3(1,0,0), MathUtils.degToRad(90));//Must be standing up linkPlate.scene.position.x = -20.3 + i*5;
alignGround(ground, linkPlate.scene);
linkPlate.scene.position.y = 2; scene.add( linkPlate.scene );
linkPlate.scene.position.z = 1; linkPlate.onEnterHitbox = ()=>{Notifications.showNotification("Vous pouvez ouvrir ce lien avec la touche Entrée, ou en cliquant <a target=\"_blank\" href=\""+notificationsLinks[i]+"\">ici</a> !",
scene.add( linkPlate.scene ); ()=>{Notifications.openLink(notificationsLinks[i])} )};
linkPlate.onEnterHitbox = ()=>{Notifications.showNotification("Hello World !", ()=>{console.log('ok')})}; linkPlate.onLeaveHitbox = ()=>{Notifications.hideNotification()};
linkPlate.onLeaveHitbox = ()=>{Notifications.hideNotification()}; linkPlates.push(linkPlate);
linkPlates.push(linkPlate);
}
/* -------------------- /* --------------------
ADDING GRASS ADDING GRASS

View File

@@ -32,3 +32,12 @@ $(document).on('keyup', function (e) {
optionalFunction(); optionalFunction();
} }
}); });
export function openLink(link) {
if (!link) {
console.error("No link given !");
return;
}
window.open(link, '_blank');
}