45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
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')
|