Skip to content

Commit

Permalink
Merge pull request #2 from janarosmonaliev/v1.0.1
Browse files Browse the repository at this point in the history
Wrap the unsupported library with a try/catch block
  • Loading branch information
Zhanarbek Osmonaliev authored Aug 27, 2021
2 parents c33d1c2 + e3d37e9 commit 10e2fe1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
3 changes: 2 additions & 1 deletion main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main.js.map

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"author": "Zhanarbek Osmonaliev",
"license": "ISC",
"dependencies": {
"three": "^0.124.0",
"three-globe": "^2.18.6",
"three": "^0.128.0",
"three-globe": "^2.18.8",
"three-glow-mesh": "^0.1.2"
},
"devDependencies": {
Expand Down
10 changes: 7 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,19 @@ function initGlobe() {
power: 6,
coefficient: 0.3,
};
var glowMesh = createGlowMesh(new SphereGeometry(100, 75, 75), options);
Globe.add(glowMesh);
try {
var glowMesh = createGlowMesh(new SphereGeometry(100, 75, 75), options);
Globe.add(glowMesh);
} catch (err) {
console.log("Your threeJS version does not support three-glow-mesh");
}
scene.add(Globe);
}

function onMouseMove(event) {
mouseX = event.clientX - windowHalfX;
mouseY = event.clientY - windowHalfY;
console.log("x: " + mouseX + " y: " + mouseY);
// console.log("x: " + mouseX + " y: " + mouseY);
}

function onWindowResize() {
Expand Down

0 comments on commit 10e2fe1

Please sign in to comment.