diff --git a/src/popup.css b/src/popup.css index adbd557..22f8c51 100644 --- a/src/popup.css +++ b/src/popup.css @@ -9,7 +9,11 @@ } .ob-enable-span { - @apply m-1.5 relative w-16 h-8 bg-gray-200 rounded-full after:content-[''] after:absolute after:top-0.5 after:start-[4px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-7 after:w-7 after:transition-all; + @apply m-1.5 relative w-16 h-8 bg-gray-200 rounded-full after:content-[''] after:absolute after:top-0.5 after:start-[4px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-7 after:w-7; +} + +.ob-enable-span-transition { + @apply after:transition-all; } .ob-button-link { diff --git a/src/popup.ts b/src/popup.ts index 94be6eb..729e7d4 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -4,10 +4,15 @@ import "./popup.css" console.debug("OpenBlur popup script loaded") const checkbox = document.getElementById("enabled") as HTMLInputElement +const checkboxSpan = document.getElementById("enabled-span") as HTMLInputElement chrome.storage.sync.get(null, (data) => { console.debug("OpenBlur got data from storage", data) const config = data as StoredConfig checkbox.checked = !(config.mode?.id === "off") + // Once we set the checkbox to its initial value, enable transition animation for it + setTimeout(() => { + checkboxSpan.classList.add("ob-enable-span-transition") + }, 500) const mode = config.mode ?? MODES[1] void chrome.action.setIcon({ path: MODES[mode.index].icon }) const literals: string[] = config.literals ?? [] diff --git a/static/popup.html b/static/popup.html index 2ff5223..d5458b5 100644 --- a/static/popup.html +++ b/static/popup.html @@ -6,6 +6,7 @@ diff --git a/webpack.common.ts b/webpack.common.ts index e93323f..e37a335 100644 --- a/webpack.common.ts +++ b/webpack.common.ts @@ -10,7 +10,7 @@ const config: Configuration = { popup: "./src/popup.ts", }, resolve: { - extensions: [".ts", ".css"], + extensions: [".ts"], }, module: { rules: [