- added JS detection of window.innerHeight to index.html

- changed all vh and vw to svh and svw
This commit is contained in:
RossAscends
2023-04-10 01:51:50 +09:00
parent 2385e6f980
commit 21cab0b4a6
2 changed files with 48 additions and 40 deletions

View File

@@ -16,6 +16,15 @@
<link rel="apple-touch-icon" sizes="114x114" href="img/apple-icon-114x114.png" /> <link rel="apple-touch-icon" sizes="114x114" href="img/apple-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="img/apple-icon-144x144.png" /> <link rel="apple-touch-icon" sizes="144x144" href="img/apple-icon-144x144.png" />
<script>
const documentHeight = () => {
const doc = document.documentElement
doc.style.setProperty('--doc-height', `${window.innerHeight}px`)
}
window.addEventListener('resize', documentHeight)
documentHeight()
</script>
<script src="scripts/jquery-3.5.1.min.js"></script> <script src="scripts/jquery-3.5.1.min.js"></script>
<script src="scripts/jquery.transit.min.js"></script> <script src="scripts/jquery.transit.min.js"></script>
<script src="scripts/jquery-cookie-1.4.1.min.js"></script> <script src="scripts/jquery-cookie-1.4.1.min.js"></script>

View File

@@ -1,6 +1,7 @@
@charset "UTF-8"; @charset "UTF-8";
:root { :root {
--doc-height: 100%;
--transparent: rgba(0, 0, 0, 0); --transparent: rgba(0, 0, 0, 0);
--black30a: rgba(0, 0, 0, 0.3); --black30a: rgba(0, 0, 0, 0.3);
@@ -55,7 +56,10 @@ body {
margin: 0; margin: 0;
padding: 0; padding: 0;
width: 100%; width: 100%;
height: 100%; /*fallback for JS load*/
height: 100svh;
/*defaults as 100%, then reassigned via JS as pixels*/
height: var(--doc-height);
background-color: var(--greyCAIbg); background-color: var(--greyCAIbg);
background-repeat: no-repeat; background-repeat: no-repeat;
background-attachment: fixed; background-attachment: fixed;
@@ -546,7 +550,7 @@ textarea {
font-size: 1rem; font-size: 1rem;
line-height: 1.5rem; line-height: 1.5rem;
min-height: calc(1.5em + 0.75rem + 2px); min-height: calc(1.5em + 0.75rem + 2px);
max-height: 50vh; max-height: 50svh;
word-wrap: break-word; word-wrap: break-word;
height: 40px; height: 40px;
resize: vertical; resize: vertical;
@@ -938,7 +942,7 @@ input[type=search]:focus::-webkit-search-cancel-button {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
width: calc(var(--sheldWidth) - 100px); width: calc(var(--sheldWidth) - 100px);
max-width: 100vw; max-width: 100svw;
justify-content: space-evenly; justify-content: space-evenly;
} }
@@ -1113,7 +1117,7 @@ input[type=search]:focus::-webkit-search-cancel-button {
left: 0; left: 0;
right: 0; right: 0;
text-align: center; text-align: center;
margin-top: 36vh; margin-top: 36svh;
box-shadow: 0 0 2px var(--black50a); box-shadow: 0 0 2px var(--black50a);
padding: 4px; padding: 4px;
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
@@ -1231,7 +1235,7 @@ input[type=search]:focus::-webkit-search-cancel-button {
opacity: 0.0; opacity: 0.0;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100vh; height: 100svh;
z-index: 9999; z-index: 9999;
top: 0; top: 0;
} }
@@ -1244,14 +1248,14 @@ input[type=search]:focus::-webkit-search-cancel-button {
opacity: 1.0; opacity: 1.0;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100vh; height: 100svh;
z-index: 2298; z-index: 2298;
} }
#bgtest { #bgtest {
display: none; display: none;
width: 100vw; width: 100svw;
height: 100vh; height: 100svh;
position: absolute; position: absolute;
z-index: -100; z-index: -100;
background-color: red; background-color: red;
@@ -1819,7 +1823,7 @@ input[type="range"]::-webkit-slider-thumb {
opacity: 0.0; opacity: 0.0;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100vh; height: 100svh;
z-index: 2055; z-index: 2055;
background-color: var(--black70a); background-color: var(--black70a);
} }
@@ -1927,7 +1931,7 @@ input[type="range"]::-webkit-slider-thumb {
opacity: 1.0; opacity: 1.0;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100vh; height: 100svh;
z-index: 2058; z-index: 2058;
} }
@@ -1939,7 +1943,7 @@ input[type="range"]::-webkit-slider-thumb {
grid-template-rows: 50px 100px 100px 100px auto; grid-template-rows: 50px 100px 100px 100px auto;
grid-gap: 10px; grid-gap: 10px;
max-width: var(--sheldWidth); max-width: var(--sheldWidth);
height: calc(100vh - 40px); height: calc(100svh - 40px);
position: absolute; position: absolute;
z-index: 3002; z-index: 3002;
margin-left: auto; margin-left: auto;
@@ -2023,7 +2027,7 @@ input[type="range"]::-webkit-slider-thumb {
opacity: 1.0; opacity: 1.0;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100vh; height: 100svh;
z-index: 3001; z-index: 3001;
top: 0; top: 0;
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
@@ -2035,7 +2039,7 @@ input[type="range"]::-webkit-slider-thumb {
grid-template-rows: auto auto; grid-template-rows: auto auto;
max-width: var(--sheldWidth); max-width: var(--sheldWidth);
height: min-content; height: min-content;
max-height: calc(100vh - 40px); max-height: calc(100svh - 40px);
min-height: 100px; min-height: 100px;
position: absolute; position: absolute;
z-index: 2066; z-index: 2066;
@@ -2691,9 +2695,9 @@ a {
/* ############################################################# */ /* ############################################################# */
#right-nav-panel { #right-nav-panel {
width: calc((100vw - var(--sheldWidth) - 2px) /2); width: calc((100svw - var(--sheldWidth) - 2px) /2);
/* min-width: 450px; */ /* min-width: 450px; */
height: 100vh; height: 100svh;
position: fixed; position: fixed;
top: 0; top: 0;
margin: 0; margin: 0;
@@ -2709,7 +2713,7 @@ a {
border: 0; border: 0;
border-left: 1px solid var(--grey30a); border-left: 1px solid var(--grey30a);
border-bottom: 1px solid var(--grey30a); border-bottom: 1px solid var(--grey30a);
max-height: 100vh; max-height: 100svh;
box-shadow: none; box-shadow: none;
border-radius: 0 0 0 20px; border-radius: 0 0 0 20px;
overflow-y: hidden; overflow-y: hidden;
@@ -3017,9 +3021,9 @@ label[for="extensions_autoconnect"] {
} }
.fillLeft { .fillLeft {
max-width: calc((100vw - var(--sheldWidth) - 2px) /2); max-width: calc((100svw - var(--sheldWidth) - 2px) /2);
height: 100vh; height: 99.9svh;
max-height: 100vh; max-height: 99.9svh;
position: fixed; position: fixed;
top: 0; top: 0;
margin: 0; margin: 0;
@@ -3148,15 +3152,12 @@ label[for="extensions_autoconnect"] {
position: fixed; position: fixed;
touch-action: none; touch-action: none;
overflow: hidden; overflow: hidden;
height: 100vh;
width: 100vw;
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
} }
.drawer-content { .drawer-content {
min-width: unset; min-width: unset;
width: 100vw; width: 100svw;
max-height: calc(100vh - 45px); max-height: calc(100svh - 45px);
position: fixed; position: fixed;
left: 0; left: 0;
top: 5px; top: 5px;
@@ -3170,7 +3171,7 @@ label[for="extensions_autoconnect"] {
} }
#top-settings-holder { #top-settings-holder {
width: 100vw; width: 100svw;
position: fixed; position: fixed;
} }
@@ -3185,7 +3186,7 @@ label[for="extensions_autoconnect"] {
#world_popup { #world_popup {
/*margin around the sides, and a larger one on bottom to avoid iOS Home bar*/ /*margin around the sides, and a larger one on bottom to avoid iOS Home bar*/
height: calc(100svh - 45px); height: calc(100svh - 45px);
width: 100vw; width: 100svw;
margin: 0 auto; margin: 0 auto;
margin-left: 0px; margin-left: 0px;
position: fixed; position: fixed;
@@ -3218,8 +3219,8 @@ label[for="extensions_autoconnect"] {
#left-nav-panel { #left-nav-panel {
height: calc(100svh - 45px); height: calc(100svh - 45px);
min-width: 0px; min-width: 0px;
width: 100vw; width: 100svw;
max-width: 100vw; max-width: 100svw;
overflow-y: auto; overflow-y: auto;
border-left: 1px solid var(--grey30); border-left: 1px solid var(--grey30);
border-right: 1px solid var(--grey30); border-right: 1px solid var(--grey30);
@@ -3246,10 +3247,10 @@ label[for="extensions_autoconnect"] {
} }
#character_popup { #character_popup {
width: calc(100vw - 5px); width: calc(100svw - 5px);
border-radius: 0 0 0 20px; border-radius: 0 0 0 20px;
margin-top: -35px; margin-top: -35px;
height: calc(100vh - 30px); height: calc(100svh - 30px);
} }
@@ -3295,14 +3296,12 @@ label[for="extensions_autoconnect"] {
position: fixed; position: fixed;
touch-action: none; touch-action: none;
overflow: hidden; overflow: hidden;
height: 100vh;
width: 100vw;
} }
.drawer-content { .drawer-content {
min-width: unset; min-width: unset;
width: 100vw; width: 100svw;
max-height: calc(100vh - 45px); max-height: calc(100svh - 45px);
position: fixed; position: fixed;
left: 0; left: 0;
top: 5px; top: 5px;
@@ -3316,7 +3315,7 @@ label[for="extensions_autoconnect"] {
} }
#top-settings-holder { #top-settings-holder {
width: 100vw; width: 100svw;
position: fixed; position: fixed;
} }
@@ -3331,7 +3330,7 @@ label[for="extensions_autoconnect"] {
#world_popup { #world_popup {
/*margin around the sides, and a larger one on bottom to avoid iOS Home bar*/ /*margin around the sides, and a larger one on bottom to avoid iOS Home bar*/
height: calc(100svh - 45px); height: calc(100svh - 45px);
width: 100vw; width: 100svw;
margin: 0 auto; margin: 0 auto;
margin-left: 0px; margin-left: 0px;
position: fixed; position: fixed;
@@ -3364,8 +3363,8 @@ label[for="extensions_autoconnect"] {
#left-nav-panel { #left-nav-panel {
height: calc(100svh - 45px); height: calc(100svh - 45px);
min-width: 0px; min-width: 0px;
width: 100vw; width: 100svw;
max-width: 100vw; max-width: 100svw;
overflow-y: auto; overflow-y: auto;
border-left: 1px solid var(--grey30); border-left: 1px solid var(--grey30);
border-right: 1px solid var(--grey30); border-right: 1px solid var(--grey30);
@@ -3392,10 +3391,10 @@ label[for="extensions_autoconnect"] {
} }
#character_popup { #character_popup {
width: calc(100vw - 5px); width: calc(100svw - 5px);
border-radius: 0 0 0 20px; border-radius: 0 0 0 20px;
margin-top: -35px; margin-top: -35px;
height: calc(100vh - 30px); height: calc(100svh - 30px);
} }