T19 - js - generate element styles
Fri Nov 12 2021 07:50:59 GMT+0000 (UTC)
Saved by
@patriciamolnar
#javascript
const configureWideElement = (newEle) => {
const [width, height, color] = createRandomNumbers();
newEle.style.width = largeNums[width] + 'px';
newEle.style.height = smallNums[height] + 'px';
newEle.style.backgroundColor = backgrounds[color];
newEle.classList.add('line', 'line-wide');
}
const configureTallElement = (newEle) => {
const [width, height, color] = createRandomNumbers();
newEle.style.width = smallNums[width] + 'px';
newEle.style.height = largeNums[height] + 'px';
newEle.style.backgroundColor = backgrounds[color];
newEle.classList.add('line', 'line-high');
}
content_copyCOPY
Comments