Add height mode option to advanced settings
This commit is contained in:
@@ -550,4 +550,5 @@ export const languageEnglish = {
|
|||||||
log: "Log",
|
log: "Log",
|
||||||
popularityLevelDesc: "Popularity increases with downloads, etc. to estimate, 3.7 popularity is about 1 downloads.",
|
popularityLevelDesc: "Popularity increases with downloads, etc. to estimate, 3.7 popularity is about 1 downloads.",
|
||||||
additionalParams: "Additional Parameters",
|
additionalParams: "Additional Parameters",
|
||||||
|
heightMode: "Height Mode",
|
||||||
}
|
}
|
||||||
@@ -43,6 +43,16 @@
|
|||||||
<OptionInput value="high">High</OptionInput>
|
<OptionInput value="high">High</OptionInput>
|
||||||
</SelectInput>
|
</SelectInput>
|
||||||
|
|
||||||
|
<span class="text-textcolor mt-4">{language.heightMode}</span>
|
||||||
|
<SelectInput bind:value={$DataBase.heightMode}>
|
||||||
|
<OptionInput value="normal">Normal</OptionInput>
|
||||||
|
<OptionInput value="percent">Percent</OptionInput>
|
||||||
|
<OptionInput value="vh">VH</OptionInput>
|
||||||
|
<OptionInput value="dvh">DVH</OptionInput>
|
||||||
|
<OptionInput value="svh">SVH</OptionInput>
|
||||||
|
<OptionInput value="lvh">LVH</OptionInput>
|
||||||
|
</SelectInput>
|
||||||
|
|
||||||
<div class="flex items-center mt-4">
|
<div class="flex items-center mt-4">
|
||||||
<Check bind:check={$DataBase.useSayNothing} name={language.sayNothing}> <Help key="sayNothing"/></Check>
|
<Check bind:check={$DataBase.useSayNothing} name={language.sayNothing}> <Help key="sayNothing"/></Check>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ export function setDatabase(data:Database){
|
|||||||
data.modules ??= []
|
data.modules ??= []
|
||||||
data.enabledModules ??= []
|
data.enabledModules ??= []
|
||||||
data.additionalParams ??= []
|
data.additionalParams ??= []
|
||||||
data.heightMode ??= 0
|
data.heightMode ??= 'normal'
|
||||||
|
|
||||||
changeLanguage(data.language)
|
changeLanguage(data.language)
|
||||||
DataBase.set(data)
|
DataBase.set(data)
|
||||||
@@ -603,7 +603,7 @@ export interface Database{
|
|||||||
sideMenuRerollButton?:boolean
|
sideMenuRerollButton?:boolean
|
||||||
requestInfoInsideChat?:boolean
|
requestInfoInsideChat?:boolean
|
||||||
additionalParams:[string, string][]
|
additionalParams:[string, string][]
|
||||||
heightMode:number
|
heightMode:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface customscript{
|
export interface customscript{
|
||||||
|
|||||||
@@ -475,6 +475,7 @@ export async function loadData() {
|
|||||||
updateColorScheme()
|
updateColorScheme()
|
||||||
updateTextTheme()
|
updateTextTheme()
|
||||||
updateAnimationSpeed()
|
updateAnimationSpeed()
|
||||||
|
updateHeightMode()
|
||||||
if(db.botSettingAtStart){
|
if(db.botSettingAtStart){
|
||||||
botMakerMode.set(true)
|
botMakerMode.set(true)
|
||||||
}
|
}
|
||||||
@@ -1572,3 +1573,28 @@ export function trimNonLatin(data:string){
|
|||||||
.replace(/ +/g, ' ')
|
.replace(/ +/g, ' ')
|
||||||
.trim()
|
.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateHeightMode(){
|
||||||
|
const db = get(DataBase)
|
||||||
|
const root = document.querySelector(':root') as HTMLElement;
|
||||||
|
switch(db.heightMode){
|
||||||
|
case 'auto':
|
||||||
|
root.style.setProperty('--risu-height-size', '100%');
|
||||||
|
break
|
||||||
|
case 'vh':
|
||||||
|
root.style.setProperty('--risu-height-size', '100vh');
|
||||||
|
break
|
||||||
|
case 'dvh':
|
||||||
|
root.style.setProperty('--risu-height-size', '100dvh');
|
||||||
|
break
|
||||||
|
case 'lvh':
|
||||||
|
root.style.setProperty('--risu-height-size', '100lvh');
|
||||||
|
break
|
||||||
|
case 'svh':
|
||||||
|
root.style.setProperty('--risu-height-size', '100svh');
|
||||||
|
break
|
||||||
|
case 'percent':
|
||||||
|
root.style.setProperty('--risu-height-size', '100%');
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user