From 498581d8cf57ccf10142a8d242809141f7d2ca0d Mon Sep 17 00:00:00 2001 From: CNCKitchen Date: Tue, 7 Apr 2026 09:48:45 +0200 Subject: [PATCH] feat: enhance language selection and boundary falloff features - Added a language dropdown selector to replace the previous button-based language toggle. - Integrated boundary falloff settings into the preview material, allowing for smoother transitions between masked and unmasked areas. - Updated shaders to utilize boundary falloff attributes for improved visual fidelity in bump-only previews. - Refactored related CSS styles for the new dropdown and adjusted layout for better usability. - Introduced new functions for computing boundary attributes and managing edge data textures. --- index.html | 33 +- js/displacement.js | 116 +++- js/i18n.js | 1282 +++++++++++++++++++++++++++++++++-------- js/main.js | 474 +++++++++++++-- js/previewMaterial.js | 91 ++- style.css | 31 +- 6 files changed, 1709 insertions(+), 318 deletions(-) diff --git a/index.html b/index.html index e6667d8..9455356 100644 --- a/index.html +++ b/index.html @@ -15,17 +15,6 @@ : window.matchMedia('(prefers-color-scheme: dark)').matches; if (!prefersDark) document.documentElement.setAttribute('data-theme', 'light'); })(); - // Apply saved language before first paint to avoid flash - (function() { - const l = localStorage.getItem('stlt-lang'); - if (l === 'de' || l === 'en') { - document.documentElement.setAttribute('data-lang', l); - document.documentElement.setAttribute('lang', l); - } else if (navigator.language && navigator.language.toLowerCase().startsWith('de')) { - document.documentElement.setAttribute('data-lang', 'de'); - document.documentElement.setAttribute('lang', 'de'); - } - })();