This commit is contained in:
2024-01-12 02:05:28 +08:00
parent 18706e3371
commit b3e7e4c049
4 changed files with 61 additions and 0 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
package-lock.json
# ---> Node # ---> Node
# Logs # Logs
logs logs

2
index.html Normal file
View File

@ -0,0 +1,2 @@
<!DOCTYPE html>
<script defer type="module" src="main.js"></script>

44
main.js Normal file
View File

@ -0,0 +1,44 @@
export class div {
static w(width) {
console.log(`Width: ${width}`)
return this
}
static h(height) {
console.log(`Height: ${height}`)
return this
}
static get onclick() {
console.log('onclick event')
return {
stop: function(event) {
console.log(`Stop event: ${event}`)
return div
}
}
}
static get onkeydown() {
console.log('onkeydown event')
return {
esc: function() {
console.log('esc event')
return {
keydown: function() {
console.log('keydown event')
return div
}
}
}
}
}
static classList(classes) {
console.log(`Classes: ${classes}`)
return this
}
}
div.w(12).h(14).onclick.stop('click').onkeydown.esc().keydown().classList(['mdui-btn', 'mdui-btn-icon'])
div.w('auto').h(32).classList('mdui-btn mdui-btn-icon')

13
package.json Normal file
View File

@ -0,0 +1,13 @@
{
"name": "chain-depict",
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^5.0.8"
}
}