Company: Cognizant_27may
Difficulty: medium
Image Filter Configuration API Problem In the original assessment you complete a small image filter page. The page shows one image ( previewImage ) (inferred -- element id taken from the earlier text of this question) and a row of filter buttons. Each button carries a CSS filter: a filter name such as blur and a filter value such as 5px . Your script must make the buttons work: Set the box-shadow of the active filter button to 0 0 0 2px #6200ee . Apply the selected filter to the image by updating its style.filter property. Do not change the existing HTML structure or class names, and make sure every filter type is applied correctly. This offline version has no browser. The buttons and a sequence of user actions are given on standard input. You replay the actions against the page's state and answer every query action with one output line. (inferred -- offline replay format; the actions and queries below stand for clicks and for reading the page's styles) The buttons are numbered 1 to n