start modularisation and breaking down the monofile

This commit is contained in:
Alphons Joseph
2025-03-12 21:45:23 +08:00
parent 3c65e6d6c5
commit c9f0f9cf16
25 changed files with 2284 additions and 2192 deletions
@@ -0,0 +1,26 @@
export function CreateElement(
type: string,
class_?: any,
id?: any,
innerText?: string,
innerHTML?: string,
style?: string,
) {
let element = document.createElement(type)
if (class_ !== undefined) {
element.classList.add(class_)
}
if (id !== undefined) {
element.id = id
}
if (innerText !== undefined) {
element.innerText = innerText
}
if (innerHTML !== undefined) {
element.innerHTML = innerHTML
}
if (style !== undefined) {
element.style.cssText = style
}
return element
}