@philip21/idom
npm install @philip21/idom --save
import idom from '@philip21/idom';
const popupDom = idom(document.getElementById('id')); // or idom('#id')
popupDom.css({
'position': 'fixed',
'top': 0,
'right': 0,
'bottom': 0,
'left': 0,
'background-color': 'rgba(0, 0, 0, 0.8)',
}).transition(
'transform',
'translateX(100px)',
{
duration: 1000,
timingFunction: 'ease-in-out',
},
).on({
'click': () => {
console.log('clicked!');
},
});
.on(eventName, eventHandler, life?)
.on(eventSpecification)
.once(eventName, eventHandler)
.once(eventSpecification)
.off()
.off(eventName)
.off(eventName, eventHandler)
.css(cssProperty)
.css(cssProperty, cssValue)
.css(cssMap)
.attr(attrName)
.attr(attrName, attrValue)
.attr(attrMap)
.data(dataKey)
.data(dataKey, dataValue)
.data(dataMap)
.get(index)
.find(selector)
.first()
.last()
.rect()
.text()
.text(innerText)
.html()
.html(innerHTML)
.transition(cssProperty, cssValue, transitionOption)