Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
jkcuk authored Feb 29, 2024
1 parent 18968b2 commit 94f2db5
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@ function init() {

window.addEventListener("resize", onWindowResize, false);

// see https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/change_event
screen.orientation.addEventListener("change", (event) => {
const type = event.target.type;
const angle = event.target.angle;
alert(`ScreenOrientation change: ${type}, ${angle} degrees. New window size ${window.innerWidth} x ${window.innerHeight}.`);

// see https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation
// switch (screen.orientation.type) {
// case "landscape-primary":
// console.log("That looks good.");
// break;
// case "landscape-secondary":
// console.log("Mmmh… the screen is upside down!");
// break;
// case "portrait-secondary":
// case "portrait-primary":
// console.log("Mmmh… you should rotate your device to landscape");
// break;
// default:
// console.log("The orientation API isn't supported in this browser :(");
// }
// // see https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/change_event
// screen.orientation.addEventListener("change", (event) => {
// const type = event.target.type;
// const angle = event.target.angle;
// alert(`ScreenOrientation change: ${type}, ${angle} degrees. New window size ${window.innerWidth} x ${window.innerHeight}.`);

// // see https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation
// // switch (screen.orientation.type) {
// // case "landscape-primary":
// // console.log("That looks good.");
// // break;
// // case "landscape-secondary":
// // console.log("Mmmh… the screen is upside down!");
// // break;
// // case "portrait-secondary":
// // case "portrait-primary":
// // console.log("Mmmh… you should rotate your device to landscape");
// // break;
// // default:
// // console.log("The orientation API isn't supported in this browser :(");
// // }

});
// });


addOrbitControls(); // add to outside camera
Expand Down

0 comments on commit 94f2db5

Please sign in to comment.