@figliolia/ripples
Version:
WebGL ripples based on the clever work of Pim Schreurs
30 lines (29 loc) • 882 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StyleCache = void 0;
class StyleCache extends Map {
constructor() {
super([
["zIndex", ""],
["position", ""],
["backgroundWidth", 0],
["backgroundHeight", 0],
["originalInlineCSS", ""],
["originalCSSBackgroundImage", ""],
]);
}
initialize(target) {
const { position, zIndex, backgroundImage } = window.getComputedStyle(target);
this.set("zIndex", zIndex);
this.set("position", position);
this.set("originalCSSBackgroundImage", backgroundImage);
this.set("originalInlineCSS", target.style.backgroundImage);
}
get(key) {
return super.get(key);
}
evict(key) {
return super.set(key, "");
}
}
exports.StyleCache = StyleCache;