Skip to content

Commit

Permalink
Fix bad merge with d.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed Aug 10, 2024
1 parent effe3bb commit ee24a6d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
17 changes: 17 additions & 0 deletions src/viewer/change-mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class MaskManager {
}
}

/** @type {HTMLElement} */
const container = document.querySelector('.icon__grid');
/** @type {NodeListOf<HTMLElement>} All elements to change the mask of. */
const masked = document.querySelectorAll('.masked');
/** @type {NodeListOf<HTMLElement>} */
Expand All @@ -50,3 +52,18 @@ maskManager.container.addEventListener('change', (evt) => {
applyMask(masked, icons, radio.value);
}
});
document.querySelector('.controls').addEventListener('change', (evt) => {
const checkbox = /** @type {HTMLInputElement} */ (evt.target);
switch (checkbox.name) {
case 'shrink': {
// Shrink the icon to 1/4 size
const size = checkbox.checked ? '0.25' : '1';
container.style.transform = `scale(${size})`;
break;
}
case 'ghost':
// Show ghost image behind icon
container.classList.toggle('icon--ghost', checkbox.checked);
break;
}
});
18 changes: 0 additions & 18 deletions src/viewer/upload-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,3 @@ if (demoLinks) {
}
});
}

/** @type {HTMLElement} */
const container = document.querySelector('.icon__grid');
document.querySelector('.controls').addEventListener('change', (evt) => {
const checkbox = /** @type {HTMLInputElement} */ (evt.target);
switch (checkbox.name) {
case 'shrink': {
// Shrink the icon to 1/4 size
const size = checkbox.checked ? '0.25' : '1';
container.style.transform = `scale(${size})`;
break;
}
case 'original':
// Show ghost image behind icon
container.classList.toggle('icon--original', checkbox.checked);
break;
}
});

0 comments on commit ee24a6d

Please sign in to comment.