JavaScript30¶
I started this bcs My dom basic is not good, and pure js is not familiar to me, also pure css, I wanna use this learn by fun.
Drum Kit¶
most of them are related to DOM.
Get Element¶
const key = document.querySelector('.key')
const keys = document.querySelectorAll('.key')
Event Listener¶
window.addEventListener('keydown', function(e) {})
Add Class¶
element.classList.add('className')
element.classList.remove('className')
Clock¶
- transform: rotate(90deg)
- transform-origin: 100%
- transition: all 0.05s;
CSS Variables¶
- dataset
- includes all custom data attributes
- set style
element.style.setProperty('variableName', 'value')