Added link to my github profile
It works !
This commit is contained in:
Binary file not shown.
@@ -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 |
@@ -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
|
||||||
-------------------- */
|
-------------------- */
|
||||||
@@ -374,23 +386,33 @@ export async function addAssetsOnScene(scene){
|
|||||||
signPlane.position.set( signCopy.position.x + 0.06, 1.347, 1.65);//Determined by hand
|
signPlane.position.set( signCopy.position.x + 0.06, 1.347, 1.65);//Determined by hand
|
||||||
scene.add(signPlane);
|
scene.add(signPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* SOCIAL NETWORKS */
|
||||||
|
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 );
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
//ADDING LINK PLATES
|
||||||
|
linkPlate.scene.position.y = 0.5;
|
||||||
|
linkPlate.scene.position.x = -20.3 + i*5;
|
||||||
|
|
||||||
/* --------------------
|
scene.add( linkPlate.scene );
|
||||||
ADDING LINK PLATES
|
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> !",
|
||||||
-------------------- */
|
()=>{Notifications.openLink(notificationsLinks[i])} )};
|
||||||
|
linkPlate.onLeaveHitbox = ()=>{Notifications.hideNotification()};
|
||||||
|
linkPlates.push(linkPlate);
|
||||||
|
|
||||||
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));//Must be standing up
|
|
||||||
alignGround(ground, linkPlate.scene);
|
|
||||||
linkPlate.scene.position.y = 2;
|
|
||||||
linkPlate.scene.position.z = 1;
|
|
||||||
scene.add( linkPlate.scene );
|
|
||||||
linkPlate.onEnterHitbox = ()=>{Notifications.showNotification("Hello World !", ()=>{console.log('ok')})};
|
|
||||||
linkPlate.onLeaveHitbox = ()=>{Notifications.hideNotification()};
|
|
||||||
linkPlates.push(linkPlate);
|
|
||||||
|
|
||||||
/* --------------------
|
/* --------------------
|
||||||
ADDING GRASS
|
ADDING GRASS
|
||||||
|
|||||||
@@ -31,4 +31,13 @@ $(document).on('keyup', function (e) {
|
|||||||
if (e.which === 13 && optionalFunction) {
|
if (e.which === 13 && optionalFunction) {
|
||||||
optionalFunction();
|
optionalFunction();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export function openLink(link) {
|
||||||
|
if (!link) {
|
||||||
|
console.error("No link given !");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.open(link, '_blank');
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user