Adds a more proper infinate scroller

It probally does more, but I can't remember what lol
This commit is contained in:
MathMan05 2024-07-20 14:36:19 -05:00
parent d28ccb68be
commit ec6ab101c0
22 changed files with 572 additions and 430 deletions

View file

@ -1,11 +1,14 @@
export {markdown};
function markdown(text : string|string[],{keep=false,stdsize=false} = {}){
let txt : string[];
if((typeof txt)==="string"){
if((typeof text)===(typeof "")){
txt=(text as string).split("");
}else{
txt=(text as string[]);
}
if(txt===undefined){
txt=[];
}
const span=document.createElement("span");
let current=document.createElement("span");
function appendcurrent(){
@ -378,7 +381,7 @@ function markdown(text : string|string[],{keep=false,stdsize=false} = {}){
if (parts && parts[2]) {
appendcurrent();
i=j;
console.log(typeof txt,txt);
const isEmojiOnly = txt.join("").trim()===build.join("").trim();
const emojiElem=document.createElement("img");
@ -386,7 +389,8 @@ function markdown(text : string|string[],{keep=false,stdsize=false} = {}){
emojiElem.width=isEmojiOnly ? 48 : 22;
emojiElem.height=isEmojiOnly ? 48 : 22;
emojiElem.crossOrigin="anonymous";
emojiElem.src=this.info.cdn.toString() + "/emojis/" + parts[2] + "." + (parts[1] ? "gif" : "png") + "?size=32";
//emojiElem.src=this.info.cdn.toString() + "/emojis/" + parts[2] + "." + (parts[1] ? "gif" : "png") + "?size=32";
//must uncomment later
emojiElem.alt="";
emojiElem.loading="lazy";
span.appendChild(emojiElem);