Adding Group

This commit is contained in:
metacryst
2024-09-12 15:08:51 -05:00
parent 9432c65fa4
commit cfdf67998d
10 changed files with 54 additions and 26 deletions

View File

@@ -0,0 +1,18 @@
window.testSuites.push( class testGroup {
BasicDivs() {
let divs = Group(() => {
div()
div()
div()
})
if(!(divs instanceof HTMLElement)) {
return `Did not receive an element!`
}
if(!(divs.children.length === 3)) {
return `Incorrect amount of children!`
}
}
})

View File

@@ -0,0 +1,41 @@
window.testSuites.push( class testStacks {
NestedChildren() {
register(class File extends Shadow {
$name
render = () => {
p(this.name)
VStack(() => {
p("Learn to code inside of a startup")
p("➵")
.position("absolute")
.fontSize(30)
.left("50%")
.top("50%")
.transformOrigin("center")
.transform("translate(-50%, -50%) rotate(90deg)")
.transition("all 1s")
.userSelect("none")
.onAppear((self) => {
setTimeout(() => {
self.style.top = "88%"
}, 100)
})
})
}
constructor() {
super()
}
}, randomName("file"))
const file = File("asdf")
if(file.querySelector(".VStack")?.children.length !== 2) {
return "Incorrect amount of children inside vstack!"
}
}
})