Revert "Attempting to fix stage being too big on mobile chrome"
This reverts commit d33264cb62
.
This commit is contained in:
parent
d33264cb62
commit
d90a1e158c
2 changed files with 5 additions and 21 deletions
|
@ -226,9 +226,7 @@ button.accordion:focus {
|
|||
#intro {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
height: calc(var(--vh, 1vh) * 100);
|
||||
background-color: #333c4a;
|
||||
transition: height 1s ease;
|
||||
background-color: #333c4a;
|
||||
}
|
||||
|
||||
#intro canvas {
|
||||
|
|
22
js/home.js
22
js/home.js
|
@ -21,12 +21,12 @@ function loaded() {
|
|||
// I want the puppet (who's height is 567) to be about 33% of the screen size
|
||||
let puppetScale = stage.screen.clientHeight / 2.5 / 567 / stage.puppetStage.scale.y
|
||||
stage.project.puppetScale = puppetScale
|
||||
stage.resize(null, stageElement.clientWidth, stageElement.clientHeight)
|
||||
stage.resize()
|
||||
window.onresize = () => {
|
||||
stage.resize()
|
||||
let puppetScale = stageElement.clientHeight / 2.5 / 567 / stage.puppetStage.scale.y
|
||||
let puppetScale = stage.screen.clientHeight / 2.5 / 567 / stage.puppetStage.scale.y
|
||||
stage.project.puppetScale = puppetScale
|
||||
stage.resize(null, stageElement.clientWidth, stageElement.clientHeight)
|
||||
stage.resize()
|
||||
}
|
||||
startCutscene()
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ function startCutscene() {
|
|||
let add = cut.actions.add.bind(cut)
|
||||
cut.actions.add = function(callback, name, id, position) {
|
||||
add(callback, name, id, position)
|
||||
stage.resize(null, stageElement.clientWidth, stageElement.clientHeight)
|
||||
stage.resize(null, Math.floor(stage.screen.clientWidth), Math.floor(stage.screen.clientHeight))
|
||||
}
|
||||
|
||||
cut.actions.chat = function(callback, target, chatId) {
|
||||
|
@ -97,17 +97,3 @@ function hideControls() {
|
|||
}
|
||||
|
||||
hideControls()
|
||||
|
||||
// First we get the viewport height and we multiple it by 1% to get a value for a vh unit
|
||||
let vh = window.innerHeight * 0.01;
|
||||
|
||||
// Then we set the value in the --vh custom property to the root of the document
|
||||
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
||||
|
||||
// We listen to the resize event
|
||||
window.addEventListener('resize', () => {
|
||||
|
||||
// We execute the same script as before
|
||||
let vh = window.innerHeight * 0.01;
|
||||
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue