Notifications can now be removed
Added the corresponding method
This commit is contained in:
@@ -4,11 +4,11 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>My first three.js app</title>
|
<title>My first three.js app</title>
|
||||||
<style>
|
<style>
|
||||||
body { margin: 0; }
|
body { margin: 0; overflow: hidden;}
|
||||||
|
|
||||||
#notification_bar {
|
#notification_bar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top:0;
|
top:20px;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
||||||
height: 80px;
|
height: 80px;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import * as THREE from 'three';
|
|||||||
import * as MathUtils from 'three/src/math/MathUtils.js';
|
import * as MathUtils from 'three/src/math/MathUtils.js';
|
||||||
import { createGround } from '../objects/ground.js';
|
import { createGround } from '../objects/ground.js';
|
||||||
import {loadModel} from './import.js';
|
import {loadModel} from './import.js';
|
||||||
|
import * as Notifications from '../utils/notification.js';
|
||||||
const textureLoader = new THREE.TextureLoader();
|
const textureLoader = new THREE.TextureLoader();
|
||||||
|
|
||||||
|
|
||||||
@@ -387,7 +388,8 @@ export async function addAssetsOnScene(scene){
|
|||||||
linkPlate.scene.position.y = 2;
|
linkPlate.scene.position.y = 2;
|
||||||
linkPlate.scene.position.z = 1;
|
linkPlate.scene.position.z = 1;
|
||||||
scene.add( linkPlate.scene );
|
scene.add( linkPlate.scene );
|
||||||
linkPlate.onEnterHitbox = ()=>{console.log('"Hello World !"')};
|
linkPlate.onEnterHitbox = ()=>{Notifications.showNotification("Hello World !")};
|
||||||
|
linkPlate.onLeaveHitbox = ()=>{Notifications.hideNotification()};
|
||||||
linkPlates.push(linkPlate);
|
linkPlates.push(linkPlate);
|
||||||
|
|
||||||
/* --------------------
|
/* --------------------
|
||||||
|
|||||||
@@ -6,3 +6,9 @@ export function showNotification(HTMLText){
|
|||||||
width:320
|
width:320
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function hideNotification(){
|
||||||
|
$("#notification_bar").animate({
|
||||||
|
width:0
|
||||||
|
}, 500, function(){ $(this).css( 'opacity', 0 ) });
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user