From 6f96e37434dbd46e8945fe054a81dacc097e4a95 Mon Sep 17 00:00:00 2001 From: mctaylors Date: Fri, 5 Jul 2024 10:18:06 +0500 Subject: [PATCH] Get rid of getStyleProperty() Signed-off-by: mctaylors --- assets/js/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 92f7608..9053bf5 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,4 +1,3 @@ -const root = document.documentElement; const dialogElement = document.getElementById('dialog'); const detailsElement = document.getElementById('details'); const dialogContentElement = document.getElementById('dialog-content'); @@ -11,8 +10,6 @@ window.onload = function() { }, 1000) } -const getStyleProperty = (s, p) => getComputedStyle(s).getPropertyValue(p); - function close_button(href) { clickSoundElement.play(); window.location.href = href; @@ -25,8 +22,8 @@ function details_button() { dialogElement.animate([ { opacity: 0, - width: getStyleProperty(root, '--keyframe-hide-dialog-width'), - paddingBottom: getStyleProperty(root, '--keyframe-hide-dialog-padding-bottom'), + width: 'var(--keyframe-hide-dialog-width)', + paddingBottom: 'var(--keyframe-hide-dialog-padding-bottom)', } ], { fill: 'forwards',