bugs + scroll bar
This commit is contained in:
parent
ba87efcb7c
commit
82561bc25a
4 changed files with 38 additions and 5 deletions
|
@ -44,7 +44,7 @@ const call = async (stear, { find, resolve, render, call }, { text, color="grey"
|
||||||
find.main._.innerText = next.text;
|
find.main._.innerText = next.text;
|
||||||
|
|
||||||
await fadein(find.main._, 200, true);
|
await fadein(find.main._, 200, true);
|
||||||
find.main._.style.transition = "";
|
//find.main._.style.transition = "";
|
||||||
|
|
||||||
async function loop(){
|
async function loop(){
|
||||||
last = next;
|
last = next;
|
||||||
|
|
25
extra/Style/scrollBar1.js
Normal file
25
extra/Style/scrollBar1.js
Normal 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));
|
||||||
|
}
|
2
main.js
2
main.js
|
@ -134,7 +134,7 @@ export class SWindow extends SFrame{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
display: "block",
|
display: "block",
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
overflow:"scroll"
|
//overflow:"scroll"
|
||||||
},
|
},
|
||||||
find:"main"
|
find:"main"
|
||||||
}, []);
|
}, []);
|
||||||
|
|
14
utils.js
14
utils.js
|
@ -5,8 +5,10 @@ export const wait = (ms) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fadeout = async (elems, ms = 200, force = false) => {
|
export const fadeout = async (elems, ms = 200, force = false) => {
|
||||||
|
var oldTrans = [];
|
||||||
if (!Array.isArray(elems)) elems = [elems];
|
if (!Array.isArray(elems)) elems = [elems];
|
||||||
for (let i = 0; i < elems.length; i++) {
|
for (let i = 0; i < elems.length; i++) {
|
||||||
|
oldTrans[i] = elems[i].style.transition;
|
||||||
elems[i].style.transition = `opacity ${ms}ms`;
|
elems[i].style.transition = `opacity ${ms}ms`;
|
||||||
if(force){
|
if(force){
|
||||||
elems[i].style.opacity = "1";
|
elems[i].style.opacity = "1";
|
||||||
|
@ -20,13 +22,16 @@ export const fadeout = async (elems, ms = 200, force = false) => {
|
||||||
await wait(ms);
|
await wait(ms);
|
||||||
for (let i = 0; i < elems.length; i++) {
|
for (let i = 0; i < elems.length; i++) {
|
||||||
elems[i].style.display = "none";
|
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];
|
if (!Array.isArray(elems)) elems = [elems];
|
||||||
for (let i = 0; i < elems.length; i++) {
|
for (let i = 0; i < elems.length; i++) {
|
||||||
|
oldTrans[i] = elems[i].style.transition
|
||||||
elems[i].style.transition = `opacity ${ms}ms`;
|
elems[i].style.transition = `opacity ${ms}ms`;
|
||||||
elems[i].style.display = "";
|
elems[i].style.display = display;
|
||||||
if (force) {
|
if (force) {
|
||||||
elems[i].style.opacity = "0";
|
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++) {
|
for (let i = 0; i < elems.length; i++) {
|
||||||
elems[i].style.opacity = "1";
|
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 = [];
|
var bStack = [];
|
||||||
|
|
Loading…
Reference in a new issue