Skip to content

Commit e076c1f

Browse files
Update gurasuraisu-api.js
1 parent 4a5c227 commit e076c1f

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

assets/gurapp/api/gurasuraisu-api.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ const _myActiveActivities = new Set(); // Tracks this app's active activities
544544
Part 5: Merge the perfectly isolated parts.
545545
Because there is no overlap, 'lighten' works perfectly, but you could also use feMerge.
546546
-->
547-
<feBlend in="topLeft_part" in2="bottomRight_part" mode="lighten" result="blended_image"></feBlend>
547+
<feBlend in="topLeft_part" in2="bottomRight_part" mode="darken" result="blended_image"></feBlend>
548548
549549
<!-- Part 6: Adjust final opacity -->
550550
<feComponentTransfer in="blended_image">
@@ -921,6 +921,11 @@ window.addEventListener('message', async (event) => {
921921
switch (data.type) {
922922
case 'themeUpdate':
923923
document.body.classList.toggle('light-theme', data.theme === 'light');
924+
// Update Filter
925+
const feBlend = document.querySelector('#edge-refraction-only feBlend');
926+
if (feBlend) {
927+
feBlend.setAttribute('mode', data.theme === 'light' ? 'lighten' : 'darken');
928+
}
924929
break;
925930
case 'animationsUpdate':
926931
document.body.classList.toggle('reduce-animations', !data.enabled);
@@ -992,6 +997,15 @@ document.addEventListener('DOMContentLoaded', () => {
992997
// FIX: Target the <html> element for the initial high contrast check
993998
const highContrastEnabled = localStorage.getItem('highContrast') === 'true';
994999
document.documentElement.classList.toggle('gurasuraisu-high-contrast', highContrastEnabled);
1000+
1001+
// We use setTimeout to ensure the SVG injection (which happens in another listener) has completed
1002+
setTimeout(() => {
1003+
const feBlend = document.querySelector('#edge-refraction-only feBlend');
1004+
if (feBlend) {
1005+
const isLight = document.body.classList.contains('light-theme');
1006+
feBlend.setAttribute('mode', isLight ? 'lighten' : 'darken');
1007+
}
1008+
}, 0);
9951009
} catch (e) {
9961010
console.error("Gurapp: Could not access localStorage. Settings may not apply.", e);
9971011
}

0 commit comments

Comments
 (0)