MCPcopy Create free account
hub / github.com/AyushSaini00/60minuteJavaScript / handleUpdate

Function handleUpdate

Box-Shadow-Generator/app.js:4–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2const inputsNodeList = document.querySelectorAll('.property input');
3
4function handleUpdate(){
5 // DOM Elements
6
7 const box = document.querySelector('.box');
8 const hOffset = document.getElementById('h-offset').value;
9 const vOffset = document.getElementById('v-offset').value;
10 const blurRadius = document.getElementById('blur').value;
11 const spread = document.getElementById('spread').value;
12 const color = document.getElementById('color').value;
13 const moz = document.querySelector('.moz');
14 const webkit = document.querySelector('.webkit');
15 const normal = document.querySelector('.normal');
16
17 //updating styles of box
18 let boxShadowValue = box.style.boxShadow;
19 box.style.boxShadow = `${hOffset}px ${vOffset}px ${blurRadius}px ${spread}px ${color}`;
20
21 //updating css value to be copied
22 moz.textContent = `-moz-box-shadow: ${boxShadowValue}`;
23 webkit.textContent = `-webkit-box-shadow: ${boxShadowValue}`;
24 normal.textContent = `box-shadow: ${boxShadowValue}`;
25
26}
27
28
29//Event listeners

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected