bugs + scroll bar

This commit is contained in:
jusax23 2022-06-10 15:01:23 +02:00
parent ba87efcb7c
commit 82561bc25a
4 changed files with 38 additions and 5 deletions

View file

@ -44,7 +44,7 @@ const call = async (stear, { find, resolve, render, call }, { text, color="grey"
find.main._.innerText = next.text;
await fadein(find.main._, 200, true);
find.main._.style.transition = "";
//find.main._.style.transition = "";
async function loop(){
last = next;

25
extra/Style/scrollBar1.js Normal file
View file

@ -0,0 +1,25 @@
import { Stear } from "../../main.js";
export const scrollBarCss1 = ({ size = "5px", background = "transparent", thumbColor = "#33a", hoverColor ="#44f"}) => {
return {
"::-webkit-scrollbar":{
width: size,
height: size,
},
"::-webkit-scrollbar-track":{
background: background,
},
"::-webkit-scrollbar-thumb":{
background: thumbColor,
borderRadius: `calc(${size} / 2)`,
},
"::-webkit-scrollbar-thumb:hover":{
background: hoverColor
}
}
};
export const applyScrollBarCss1 = ({ size = "5px", background = "transparent", thumbColor = "#33a", hoverColor = "#44f" } = {}) => {
Object.entries(scrollBarCss1({ size, background, thumbColor, hoverColor })).forEach(([k,d])=>Stear.addGlobalStyleJSON(d,k));
}

View file

@ -134,7 +134,7 @@ export class SWindow extends SFrame{
width: "100%",
display: "block",
backgroundColor,
overflow:"scroll"
//overflow:"scroll"
},
find:"main"
}, []);

View file

@ -5,8 +5,10 @@ export const wait = (ms) => {
}
export const fadeout = async (elems, ms = 200, force = false) => {
var oldTrans = [];
if (!Array.isArray(elems)) elems = [elems];
for (let i = 0; i < elems.length; i++) {
oldTrans[i] = elems[i].style.transition;
elems[i].style.transition = `opacity ${ms}ms`;
if(force){
elems[i].style.opacity = "1";
@ -20,13 +22,16 @@ export const fadeout = async (elems, ms = 200, force = false) => {
await wait(ms);
for (let i = 0; i < elems.length; i++) {
elems[i].style.display = "none";
elems[i].style.transition = oldTrans[i];
}
}
export const fadein = async (elems, ms = 200, force = false) => {
export const fadein = async (elems, ms = 200, force = false, display="") => {
var oldTrans = [];
if (!Array.isArray(elems)) elems = [elems];
for (let i = 0; i < elems.length; i++) {
oldTrans[i] = elems[i].style.transition
elems[i].style.transition = `opacity ${ms}ms`;
elems[i].style.display = "";
elems[i].style.display = display;
if (force) {
elems[i].style.opacity = "0";
}
@ -35,7 +40,10 @@ export const fadein = async (elems, ms = 200, force = false) => {
for (let i = 0; i < elems.length; i++) {
elems[i].style.opacity = "1";
}
await wait(ms);
await wait(ms+1);
for (let i = 0; i < elems.length; i++) {
elems[i].style.transition = oldTrans[i];
}
}
var bStack = [];