diff --git a/chromium/GIfont.woff2 b/chromium/GIfont.woff2 deleted file mode 100644 index b873924..0000000 Binary files a/chromium/GIfont.woff2 and /dev/null differ diff --git a/chromium/HSRfont.woff2 b/chromium/HSRfont.woff2 deleted file mode 100644 index 1e5145e..0000000 Binary files a/chromium/HSRfont.woff2 and /dev/null differ diff --git a/chromium/_locales/en/messages.json b/chromium/_locales/en/messages.json index c4d42a1..fcd7054 100644 --- a/chromium/_locales/en/messages.json +++ b/chromium/_locales/en/messages.json @@ -1,25 +1,34 @@ { "extensionDescription": { - "message": "Quick entry of Genshin Impact/Honkai: Star Rail promo codes | 2.2.5.1" + "message": "Quick input of promo codes for HoYoverse games | 2.2.6" + }, + "stgi": { + "message": "Submit" }, "sthsr": { "message": "Submit" }, - "stgi": { + "stzzz": { "message": "Submit" }, + "segi": { + "message": "Share" + }, "sehsr": { "message": "Share" }, - "segi": { + "sezzz": { "message": "Share" }, - "labelgi": { + "labelGi": { "message": "Genshin Impact Only" }, "labelHsr": { "message": "Honkai Star Rail Only" }, + "labelZzz": { + "message": "Zenless Zone Zero Only" + }, "options": { "message": "Settings" }, @@ -29,11 +38,17 @@ "submitHSR": { "message": "Star Rail" }, + "submitZZZ": { + "message": "Zone Zero" + }, "shareGI": { - "message": "Share GI" + "message": "GI Link" }, "shareHSR": { - "message": "Share HSR" + "message": "HSR Link" + }, + "shareZZZ": { + "message": "ZZZ Link" }, "reset": { "message": "Reset" @@ -74,6 +89,9 @@ "labelOnlyHsr": { "message": "Honkai Star Rail Mode" }, + "labelOnlyZzz": { + "message": "Zenless Zone Zero Mode" + }, "labelBirthday": { "message": "Disable character birthday customization" }, diff --git a/chromium/_locales/es/messages.json b/chromium/_locales/es/messages.json index ff3ee74..00767c6 100644 --- a/chromium/_locales/es/messages.json +++ b/chromium/_locales/es/messages.json @@ -1,25 +1,34 @@ { "extensionDescription": { - "message": "Entrada rápida de los códigos promocionales de Genshin Impact/Honkai: Star Rail | 2.2.5.1" + "message": "Entrada rápida de códigos promocionales para juegos de HoYoverse | 2.2.6" + }, + "stgi": { + "message": "Enviar" }, "sthsr": { "message": "Enviar" }, - "stgi": { + "stzzz": { "message": "Enviar" }, + "segi": { + "message": "Compartir" + }, "sehsr": { "message": "Compartir" }, - "share": { + "sezzz": { "message": "Compartir" }, - "segi": { + "labelGi": { "message": "Solo Genshin Impact" }, "labelHsr": { "message": "Solo Honkai Star Rail" }, + "labelZzz": { + "message": "Solo Zenless Zone Zero" + }, "options": { "message": "Configuración" }, @@ -29,12 +38,18 @@ "submitHSR": { "message": "Star Rail" }, + "submitZZZ": { + "message": "Zone Zero" + }, "shareGI": { "message": "Compartir GI" }, "shareHSR": { "message": "Compartir HSR" }, + "shareZZZ": { + "message": "Поделиться ZZZ" + }, "reset": { "message": "Reiniciar" }, @@ -74,6 +89,9 @@ "labelOnlyHsr": { "message": "Modo Honkai Star Rail" }, + "labelOnlyZzz": { + "message": "Modo Zenless Zone Zero" + }, "labelBirthday": { "message": "Desactivar la personalización del cumpleaños del personaje" }, diff --git a/chromium/_locales/ja/messages.json b/chromium/_locales/ja/messages.json index f8909e8..fa25c20 100644 --- a/chromium/_locales/ja/messages.json +++ b/chromium/_locales/ja/messages.json @@ -1,83 +1,101 @@ { - "sthsr": { - "message": "送信" + "stgi":{ + "message":"入力" }, - "stgi": { - "message": "送信" + "sthsr":{ + "message":"入力" }, - "sehsr": { - "message": "共有" + "stzzz":{ + "message":"入力" }, - "segi": { - "message": "共有" + "segi":{ + "message":"共有" }, - "labelgi": { - "message": "Genshin Impactのみ" + "sehsr":{ + "message":"共有" }, - "labelHsr": { - "message": "Honkai Star Railのみ" + "sezzz":{ + "message":"共有" }, - "options": { - "message": "設定" + "labelGi":{ + "message":"原神インパクトのみ" }, - "submitGI": { + "labelHsr":{ + "message":"本海スターレールのみ" + }, + "labelZzz":{ + "message":"エンドレスゾーンゼロのみ" + }, + "options":{ + "message":"設定" + }, + "submitGI":{ "message": "Genshin" }, - "submitHSR": { - "message": "Star Rail" + "submitHSR":{ + "message":"Star Rail" + }, + "submitZZZ":{ + "message":"Zenless Zone" + }, + "shareGI":{ + "message":"シェアGI" }, - "shareGI": { - "message": "GIを共有" + "shareHSR":{ + "message":"シェアHSR" }, - "shareHSR": { - "message": "HSRを共有" + "shareZZZ":{ + "message":"シェアZZZ" }, - "reset": { - "message": "リセット" + "reset":{ + "message":"リセット" }, - "labelButtonColor": { - "message": "ボタンの色" + "labelButtonColor":{ + "message":"ボタンの色" }, - "labelTextColor": { - "message": "テキストの色" + "labelTextColor":{ + "message":"テキストの色" }, - "labelBackground": { - "message": "背景の代わりに色を使用する" + "labelBackground":{ + "message":"背景の代わりに色を使用する" + }, + "labelBackgroundColor":{ + "message":"背景色(有効な場合)" }, - "labelBackgroundColor": { - "message": "背景の色(有効になっている場合)" + "displayOverlay":{ + "message":"リンクがコピーされました" }, - "displayOverlay" :{ - "message": "コピーされたリンク" + "labelGlobal":{ + "message":"グローバル設定" }, - "labelGlobal": { - "message": "グローバル設定" + "labelMainPopup":{ + "message":"メインウィンドウの設定" }, - "labelMainPopup": { - "message": "メインウィンドウの設定" + "labelRounding":{ + "message":"丸めを無効にします" }, - "labelRounding": { - "message": "丸めを無効にする" + "labelIcon":{ + "message":"アイコンの変更を無効にする" }, - "labelIcon": { - "message": "アイコンの変更を無効にする" + "labelFont":{ + "message":"フォント" }, - "labelFont": { - "message": "フォント" + "labelOnlyGi":{ + "message": "原神インパクトモード」" }, - "labelOnlyGi": { - "message": "Genshin Impactモード" + "labelOnlyHsr":{ + "message":"本海スターレールモード" }, - "labelOnlyHsr": { - "message": "Honkai Star Railモード" + "labelOnlyZzz":{ + "message":"ゼンレスゾーンゼロモード" }, - "labelBirthday": { - "message": "キャラクターの誕生日のカスタマイズを無効にする" + "labelBirthday":{ + "message":"キャラクターの誕生日のカスタマイズを無効にする" }, - "labelBirthdayPopup": { - "message": "お誕生日おめでとう、" + "labelBirthdayPopup":{ + "message":"お誕生日おめでとう" }, - "labelNotClickable": { - "message": "これは押せません" + "labelNotClickable":{ + "message":"これは押されていません" } } \ No newline at end of file diff --git a/chromium/_locales/ru/messages.json b/chromium/_locales/ru/messages.json index 7985d4e..e4a9dc5 100644 --- a/chromium/_locales/ru/messages.json +++ b/chromium/_locales/ru/messages.json @@ -1,86 +1,104 @@ -{ - "extensionDescription": { - "message": "Быстрый ввод промокодов Genshin Impact/Honkai: Star Rail | 2.2.5.1" - }, - "sthsr": { - "message": "Ввести" - }, - "stgi": { - "message": "Ввести" - }, - "sehsr": { - "message": "Поделиться" - }, - "segi": { - "message": "Поделиться" - }, - "labelGi": { - "message": "Только Genshin Impact" - }, - "labelHsr": { - "message": "Только Honkai Star Rail" - }, - "options": { - "message": "Настройки" - }, - "submitGI": { - "message": "Genshin" - }, - "submitHSR": { - "message": "Star Rail" - }, - "shareGI": { - "message": "Поделиться GI" - }, - "shareHSR": { - "message": "Поделиться HSR" - }, - "reset": { - "message": "Сбросить" - }, - "labelButtonColor": { - "message": "Цвет кнопок" - }, - "labelTextColor": { - "message": "Цвет текста" - }, - "labelBackground": { - "message": "Использовать цвет вместо фона" - }, - "labelBackgroundColor": { - "message": "Цвет фона (если включено)" - }, - "displayOverlay": { - "message": "Ссылка скопирована" - }, - "labelGlobal": { - "message": "Глобальные настройки" - }, - "labelMainPopup": { - "message": "Настройки основного окна" - }, - "labelRounding": { - "message": "Отключить закругления" - }, - "labelIcon": { - "message": "Отключить смену иконок" - }, - "labelFont": { - "message": "Шрифт" - }, - "labelOnlyGi": { - "message": "Режим Genshin Impact" - }, - "labelOnlyHsr": { - "message": "Режим Honkai Star Rail" - }, - "labelBirthday": { - "message": "Отключить кастомизацию ко дню рождения персонажа" - }, - "labelBirthdayPopup": { - "message": "С днём рождения, " - }, - "labelNotClickable": { - "message": "Это не нажимается" - } -} \ No newline at end of file + { + "extensionDescription": { + "message": "Быстрый ввод промокодов игр HoYoverse | 2.2.6" + }, + "stgi": { + "message": "Ввести" + }, + "sthsr": { + "message": "Ввести" + }, + "stzzz": { + "message": "Ввести" + }, + "segi": { + "message": "Поделиться" + }, + "sehsr": { + "message": "Поделиться" + }, + "sezzz": { + "message": "Поделиться" + }, + "labelGi": { + "message": "Только Genshin Impact" + }, + "labelHsr": { + "message": "Только Honkai Star Rail" + }, + "labelZzz": { + "message": "Только Zenless Zone Zero" + }, + "options": { + "message": "Настройки" + }, + "submitGI": { + "message": "Genshin" + }, + "submitHSR": { + "message": "Star Rail" + }, + "submitZZZ": { + "message": "Zone Zero" + }, + "shareGI": { + "message": "GI Ссылка" + }, + "shareHSR": { + "message": "HSR Ссылка" + }, + "shareZZZ": { + "message": "ZZZ Ссылка" + }, + "reset": { + "message": "Сбросить" + }, + "labelButtonColor": { + "message": "Цвет кнопок" + }, + "labelTextColor": { + "message": "Цвет текста" + }, + "labelBackground": { + "message": "Использовать цвет вместо фона" + }, + "labelBackgroundColor": { + "message": "Цвет фона (если включено)" + }, + "displayOverlay": { + "message": "Ссылка скопирована" + }, + "labelGlobal": { + "message": "Глобальные настройки" + }, + "labelMainPopup": { + "message": "Настройки основного окна" + }, + "labelRounding": { + "message": "Отключить закругления" + }, + "labelIcon": { + "message": "Отключить смену иконок" + }, + "labelFont": { + "message": "Шрифт" + }, + "labelOnlyGi": { + "message": "Режим Genshin Impact" + }, + "labelOnlyHsr": { + "message": "Режим Honkai Star Rail" + }, + "labelOnlyZzz": { + "message": "Режим Zenless Zone Zero" + }, + "labelBirthday": { + "message": "Отключить кастомизацию ко дню рождения персонажа" + }, + "labelBirthdayPopup": { + "message": "С днём рождения, " + }, + "labelNotClickable": { + "message": "Это не нажимается" + } + } \ No newline at end of file diff --git a/chromium/dailychecker.js b/chromium/dailychecker.js index 0b5dfe4..b40a8cd 100644 --- a/chromium/dailychecker.js +++ b/chromium/dailychecker.js @@ -1,15 +1,9 @@ -if (typeof browser === "undefined") { - browser = chrome; - browser.browserAction = chrome.action; -} function getCurrDay() { var now = new Date(); now.setMinutes(now.getMinutes() + now.getTimezoneOffset()); now.setHours(now.getHours() + 8); return Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0, 0); } -var HSRwork; -var GIwork; function GIrequest() { var currDay = getCurrDay(); fetch("https://sg-hk4e-api.hoyolab.com/event/sol/sign?act_id=e202102251931481", { @@ -23,17 +17,14 @@ function GIrequest() { .then(data => { if (data.retcode == 0 || data.retcode == -5003) { console.log("GIsuccess", data); - browser.storage.local.set({dc_lastCheked: currDay}); - GIwork = true; + chrome.storage.local.set({dc_lastCheked: currDay}); } else { console.log("GIwarning", data); - browser.storage.local.set({dc_lastCheked: currDay}); - GIwork = false; + chrome.storage.local.set({dc_lastCheked: currDay}); } }) .catch(error => { console.log("GIbadrequest", error); - GIwork = false; }); } function HSRrequest() { @@ -49,49 +40,52 @@ function HSRrequest() { .then(data => { if (data.retcode == 0 || data.retcode == -5003) { console.log("HSRsuccess", data); - browser.storage.local.set({dc_lastCheked: currDay}); - HSRwork = true; + chrome.storage.local.set({dc_lastCheked: currDay}); } else { console.log("HSRwarning", data); - browser.storage.local.set({dc_lastCheked: currDay}); - HSRwork = false; + chrome.storage.local.set({dc_lastCheked: currDay}); } }) .catch(error => { console.log("HSRbadrequest", error); - HSRwork = false; }); } -function icon(){ - browser.storage.local.get(['iconDisable']).then(function (result) { - if (result.iconDisable) { - browser.browserAction.setIcon({path: "/pictures/icon.png"}); +function ZZZrequest() { + var currDay = getCurrDay(); + fetch("https://sg-act-nap-api.hoyolab.com/event/luna/os/sign?act_id=e202406031448091", { + method : "POST", + headers: { + "Content-Type": "application/json" + }, + credentials: "include" + }) + .then(response => response.json()) + .then(data => { + if (data.retcode == 0 || data.retcode == -5003) { + console.log("ZZZsuccess", data); + chrome.storage.local.set({dc_lastCheked: currDay}); } else { - if (GIwork == true && HSRwork == true) { - browser.browserAction.setIcon({path: "/pictures/icon.png"}); - } else if (GIwork == true && HSRwork == false) { - browser.browserAction.setIcon({path: "/pictures/icon_warn.png"}); - } else if (GIwork == false && HSRwork == true) { - browser.browserAction.setIcon({path: "/pictures/icon_warn.png"}); - } else { - browser.browserAction.setIcon({path: "/pictures/icon_error.png"}); - } + console.log("ZZZwarning", data); + chrome.storage.local.set({dc_lastCheked: currDay}); } - }) + }) + .catch(error => { + console.log("ZZZbadrequest", error); + }); } function check() { - browser.storage.local.get({dc_lastCheked: null}).then(storage => { + chrome.storage.local.get({dc_lastCheked: null}).then(storage => { var currDay = getCurrDay(); if (storage.dc_lastCheked != currDay) { HSRrequest(); GIrequest(); - setTimeout(icon, 5000); + ZZZrequest(); } }); } -browser.alarms.onAlarm.addListener(alarm => { +chrome.alarms.onAlarm.addListener(alarm => { if (alarm.name == "daily_checker") { check(); } }); -browser.alarms.create("daily_checker", {when: Date.now(), periodInMinutes: 1}); \ No newline at end of file +chrome.alarms.create("daily_checker", {when: Date.now(), periodInMinutes: 1}); \ No newline at end of file diff --git a/chromium/manifest.json b/chromium/manifest.json index fcc9c67..8614943 100644 --- a/chromium/manifest.json +++ b/chromium/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, - "name": "Genshin/Star Rail CodeEnter", - "version": "2.2.5.1", + "name": "HoYoverse CodeEnter", + "version": "2.2.6", "description": "__MSG_extensionDescription__", "default_locale": "en", "icons": { @@ -16,7 +16,8 @@ "host_permissions": [ "*://*.hoyoverse.com/", "*://*.mihoyo.com/*", - "*://*.hoyolab.com/*" + "*://*.hoyolab.com/*", + "*://*.githubusercontent.com/*" ], "action": { "default_icon": "/pictures/icon.png", diff --git a/chromium/options.css b/chromium/options.css index d217f08..92bdef1 100644 --- a/chromium/options.css +++ b/chromium/options.css @@ -1,14 +1,14 @@ -@font-face { -font-family: 'SDK_SC_Web'; -src: url('GIfont.woff2') format('woff2'); -} +@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap'); body { background-color: #ffffff; - font-family: 'SDK_SC_Web'; + font-family: "Nunito", sans-serif; + font-optical-sizing: auto; + font-style: normal; + font-size: 15px; padding: 10px; - min-height: 50vh; + min-height: 100vh; font-size: 13px; - } +} label { display: flex; align-items: center; @@ -31,7 +31,10 @@ button { text-align: center; transition: transform 0.3s ease; border-radius: var(--border-radius); - font-family: 'SDK_SC_Web'; + font-family: "Nunito", sans-serif; + font-optical-sizing: auto; + font-style: normal; + font-size: 15px; } button:hover { transform: scale(1.05); @@ -51,54 +54,20 @@ button:hover { } @media (prefers-color-scheme: dark) { body { - background-color: #3b3b3b; - color: white; + background-color: #292a2d; + color: white; + } } - } .settings-section { display: block; } -#main-popup-settings, #onlyGi-settings, #onlyHsr-settings { +#main-popup-settings, #onlyGi-settings, #onlyHsr-settings, #onlyZzz-settings { display: none; } #settingsSectionSelector { margin-bottom: 20px; - font-family: 'SDK_SC_Web'; - font-size: 13px; -} -toggle-switch-container { - display: flex; - align-items: center; -} -.toggle-switch { - position: relative; - width: 50px; - height: 24px; -} -.toggle-switch input[type="checkbox"] { - display: none; -} -.slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; -} -.slider:before { - position: absolute; - content: "Genshin"; - height: 20px; - width: 57px; - left: 2px; - bottom: 2px; - background-color: #a89f96; - transition: 0.2s; -} -input:checked + .slider:before { - content: "Star Rail"; - transform: translateX(26px); - width: 62px; - background-color: #004080; + font-family: "Nunito", sans-serif; + font-optical-sizing: auto; + font-style: normal; + font-size: 15px; } \ No newline at end of file diff --git a/chromium/options.html b/chromium/options.html index 76ce4fe..0b6aa1b 100644 --- a/chromium/options.html +++ b/chromium/options.html @@ -11,6 +11,7 @@ +
@@ -22,33 +23,27 @@
- - + +
- - + +
+
- - -
+ + +
- - -
-
-

Font:

- + +
@@ -66,11 +61,11 @@
- +
- +
@@ -85,15 +80,35 @@
- +
- +
- +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ + \ No newline at end of file diff --git a/chromium/options.js b/chromium/options.js index 01cae51..8515f8a 100644 --- a/chromium/options.js +++ b/chromium/options.js @@ -1,37 +1,39 @@ -if (typeof browser === "undefined") { - browser = chrome; -} const labels = { 'labelGi': 'labelGi', 'labelHsr': 'labelHsr', - 'labelIcon': 'labelIcon', + 'labelZzz': 'labelZzz', 'labelRounding': 'labelRounding', 'labelBackgroundGi': 'labelBackground', - 'labelBackgroundColorGi': 'labelBackgroundColor', 'labelBackgroundHsr': 'labelBackground', + 'labelBackgroundZzz': 'labelBackground', + 'labelBackgroundColorGi': 'labelBackgroundColor', 'labelBackgroundColorHsr': 'labelBackgroundColor', + 'labelBackgroundColorZzz': 'labelBackgroundColor', 'resetpopup': 'reset', 'resetGi': 'reset', 'resetHsr': 'reset', + 'resetZzz': 'reset', 'labelButtonColor': 'labelButtonColor', 'labelButtonColorGi': 'labelButtonColor', 'labelButtonColorHsr': 'labelButtonColor', + 'labelButtonColorZzz': 'labelButtonColor', 'labelTextColor': 'labelTextColor', 'labelTextColorGi': 'labelTextColor', 'labelTextColorHsr': 'labelTextColor', + 'labelTextColorZzz': 'labelTextColor', 'labelGlobal-settings': 'labelGlobal', 'labelMainPopup-settings': 'labelMainPopup', 'labelOnlyGi-settings': 'labelOnlyGi', 'labelOnlyHsr-settings': 'labelOnlyHsr', - 'labelFont': 'labelFont', + 'labelOnlyZzz-settings': 'labelOnlyZzz', 'labelMainBirthday': 'labelBirthday', 'labelGIBirthday': 'labelBirthday' }; for (let id in labels) { - document.getElementById(id).textContent = browser.i18n.getMessage(labels[id]); + document.getElementById(id).textContent = chrome.i18n.getMessage(labels[id]); } function showSettingsSection(section) { - var sections = ['global-settings','main-popup-settings', 'onlyGi-settings', 'onlyHsr-settings']; + var sections = ['global-settings','main-popup-settings', 'onlyGi-settings', 'onlyHsr-settings', 'onlyZzz-settings']; sections.forEach(function (s) { var element = document.getElementById(s); if (element) { @@ -45,98 +47,110 @@ document.getElementById('settingsSectionSelector').addEventListener('change', fu }); document.getElementById('buttonColorMain').addEventListener('input', function() { var buttonColorMain = document.getElementById('buttonColorMain').value; - browser.storage.local.set({ + chrome.storage.local.set({ buttonColorMain: buttonColorMain } )}); document.getElementById('buttonColorGi').addEventListener('input', function() { var buttonColorGi = document.getElementById('buttonColorGi').value; - browser.storage.local.set({ + chrome.storage.local.set({ buttonColorGi: buttonColorGi }); }); document.getElementById('buttonColorHsr').addEventListener('input', function() { var buttonColorHsr = document.getElementById('buttonColorHsr').value; - browser.storage.local.set({ + chrome.storage.local.set({ buttonColorHsr: buttonColorHsr }); }); +document.getElementById('buttonColorZzz').addEventListener('input', function() { + var buttonColorZzz = document.getElementById('buttonColorZzz').value; + chrome.storage.local.set({ + buttonColorZzz: buttonColorZzz + }); +}); document.getElementById('buttonTextColorMain').addEventListener('input', function() { var buttonTextColorMain = document.getElementById('buttonTextColorMain').value; - browser.storage.local.set({ + chrome.storage.local.set({ buttonTextColorMain: buttonTextColorMain } )}); document.getElementById('buttonTextColorGi').addEventListener('input', function() { var buttonTextColorGi = document.getElementById('buttonTextColorGi').value; - browser.storage.local.set({ + chrome.storage.local.set({ buttonTextColorGi: buttonTextColorGi }); }); document.getElementById('buttonTextColorHsr').addEventListener('input', function() { var buttonTextColorHsr = document.getElementById('buttonTextColorHsr').value; - browser.storage.local.set({ + chrome.storage.local.set({ buttonTextColorHsr: buttonTextColorHsr }); }); +document.getElementById('buttonTextColorZzz').addEventListener('input', function() { + var buttonTextColorZzz = document.getElementById('buttonTextColorZzz').value; + chrome.storage.local.set({ + buttonTextColorZzz: buttonTextColorZzz + }); +}); document.getElementById('BackgroundColorGi').addEventListener('input', function() { var BackgroundColorGi = document.getElementById('BackgroundColorGi').value; - browser.storage.local.set({ + chrome.storage.local.set({ BackgroundColorGi: BackgroundColorGi }); }); document.getElementById('BackgroundColorHsr').addEventListener('input', function() { var BackgroundColorHsr = document.getElementById('BackgroundColorHsr').value; - browser.storage.local.set({ + chrome.storage.local.set({ BackgroundColorHsr: BackgroundColorHsr }); }); -document.getElementById('iconDisable').addEventListener('change', function() { - var iconDisable = document.getElementById('iconDisable').checked; - browser.storage.local.set({ - iconDisable: iconDisable +document.getElementById('BackgroundColorZzz').addEventListener('input', function() { + var BackgroundColorZzz = document.getElementById('BackgroundColorZzz').value; + chrome.storage.local.set({ + BackgroundColorZzz: BackgroundColorZzz }); }); document.getElementById('mainBirthdayDisable').addEventListener('change', function() { var mainBirthdayDisable = document.getElementById('mainBirthdayDisable').checked; - browser.storage.local.set({ + chrome.storage.local.set({ mainBirthdayDisable: mainBirthdayDisable }); }); document.getElementById('giBirthdayDisable').addEventListener('change', function() { var giBirthdayDisable = document.getElementById('giBirthdayDisable').checked; - browser.storage.local.set({ + chrome.storage.local.set({ giBirthdayDisable: giBirthdayDisable }); }); document.getElementById('roundingDisable').addEventListener('change', function() { var roundingDisable = document.getElementById('roundingDisable').checked; - browser.storage.local.set({ + chrome.storage.local.set({ roundingDisable: roundingDisable }); }); document.getElementById('BackgroundGi').addEventListener('change', function() { var BackgroundGi = document.getElementById('BackgroundGi').checked; - browser.storage.local.set({ + chrome.storage.local.set({ BackgroundGi: BackgroundGi }); }); document.getElementById('BackgroundHsr').addEventListener('change', function() { var BackgroundHsr = document.getElementById('BackgroundHsr').checked; - browser.storage.local.set({ + chrome.storage.local.set({ BackgroundHsr: BackgroundHsr }); }); -document.getElementById('mainFont').addEventListener('change', function() { - var mainFont = document.getElementById('mainFont').checked; - browser.storage.local.set({ - mainFont: mainFont +document.getElementById('BackgroundZzz').addEventListener('change', function() { + var BackgroundZzz = document.getElementById('BackgroundZzz').checked; + chrome.storage.local.set({ + BackgroundZzz: BackgroundZzz }); }); document.getElementById('resetpopup').addEventListener('click', function() { document.getElementById('buttonColorMain').value = '#9a609a'; document.getElementById('buttonTextColorMain').value = '#ffffff'; - browser.storage.local.set({ + chrome.storage.local.set({ buttonColorMain: '#9a609a', buttonTextColorMain: '#ffffff', }); @@ -145,7 +159,7 @@ document.getElementById('resetGi').addEventListener('click', function() { document.getElementById('buttonColorGi').value = '#a89f96'; document.getElementById('buttonTextColorGi').value = '#ffffff'; document.getElementById('BackgroundColorGi').value = '#4e4b54'; - browser.storage.local.set({ + chrome.storage.local.set({ buttonColorGi: '#a89f96', buttonTextColorGi: '#ffffff', BackgroundColorGi: '#4e4b54' @@ -154,12 +168,21 @@ document.getElementById('resetHsr').addEventListener('click', function() { document.getElementById('buttonColorHsr').value = '#004080'; document.getElementById('buttonTextColorHsr').value = '#ffffff'; document.getElementById('BackgroundColorHsr').value = '#1e274e'; - browser.storage.local.set({ + chrome.storage.local.set({ buttonColorHsr: '#004080', buttonTextColorHsr: '#ffffff', BackgroundColorHsr: '#1e274e' })}); -browser.storage.local.get(['roundingDisable']).then(function (result) { +document.getElementById('resetZzz').addEventListener('click', function() { + document.getElementById('buttonColorZzz').value = '#696d76'; + document.getElementById('buttonTextColorZzz').value = '#ffffff'; + document.getElementById('BackgroundColorZzz').value = '#1e274e'; + chrome.storage.local.set({ + buttonColorZzz: '#696d76', + buttonTextColorZzz: '#ffffff', + BackgroundColorZzz: '#1e274e' + })}); +chrome.storage.local.get(['roundingDisable']).then(function (result) { if (result.roundingDisable) { document.documentElement.style.setProperty('--border-radius', '10px') } @@ -167,25 +190,28 @@ browser.storage.local.get(['roundingDisable']).then(function (result) { document.documentElement.style.setProperty('--border-radius', '20px') } }); -browser.storage.local.get(['giBirthdayDisable', 'mainBirthdayDisable', 'mainFont', 'iconDisable', 'roundingDisable', 'BackgroundHsr', 'BackgroundColorHsr', 'BackgroundGi', 'BackgroundColorGi', 'buttonColorMain', 'buttonColorGi', 'buttonColorHsr', 'buttonTextColorMain', 'buttonTextColorGi', 'buttonTextColorHsr', 'onlyHsr', 'onlyGi'], function(result) { +chrome.storage.local.get(['BackgroundZzz','onlyZzz','buttonTextColorZzz','buttonColorZzz','giBirthdayDisable', 'mainBirthdayDisable', 'roundingDisable', 'BackgroundHsr', 'BackgroundColorHsr', 'BackgroundGi', 'BackgroundColorGi', 'buttonColorMain', 'buttonColorGi', 'buttonColorHsr', 'buttonTextColorMain', 'buttonTextColorGi', 'buttonTextColorHsr', 'onlyHsr', 'onlyGi'], function(result) { const defaults = { 'buttonColorMain': '#9a609a', 'buttonColorGi': '#a89f96', 'buttonColorHsr': '#004080', + 'buttonColorZzz': '#696d76', 'buttonTextColorMain': '#ffffff', 'buttonTextColorGi': '#ffffff', 'buttonTextColorHsr': '#ffffff', + 'buttonTextColorZzz': '#ffffff', 'BackgroundColorGi': '#4e4b54', 'BackgroundColorHsr': '#1e274e', - 'onlyHsr': false, + 'BackgroundColorZzz': '#1e274e', 'onlyGi': false, - 'iconDisable': false, + 'onlyHsr': false, + 'onlyZzz': false, 'mainBirthdayDisable': false, 'giBirthdayDisable': false, 'roundingDisable': false, 'BackgroundGi': false, 'BackgroundHsr': false, - 'mainFont': false + 'BackgroundZzz': false, }; for (let key in defaults) { window[key] = result[key] ? result[key] : defaults[key]; @@ -194,11 +220,15 @@ browser.storage.local.get(['giBirthdayDisable', 'mainBirthdayDisable', 'mainFont var onlyHsr = document.getElementById('onlyHsr').checked; if (onlyHsr) { document.getElementById('onlyGi').checked = false; - browser.storage.local.set({ + chrome.storage.local.set({ onlyGi: false }); + document.getElementById('onlyZzz').checked = false; + chrome.storage.local.set({ + onlyZzz: false + }); } - browser.storage.local.set({ + chrome.storage.local.set({ onlyHsr: onlyHsr }); }); @@ -206,32 +236,55 @@ browser.storage.local.get(['giBirthdayDisable', 'mainBirthdayDisable', 'mainFont var onlyGi = document.getElementById('onlyGi').checked; if (onlyGi) { document.getElementById('onlyHsr').checked = false; - browser.storage.local.set({ + chrome.storage.local.set({ onlyHsr: false }); + document.getElementById('onlyZzz').checked = false; + chrome.storage.local.set({ + onlyZzz: false + }); } - browser.storage.local.set({ + chrome.storage.local.set({ onlyGi: onlyGi }); }); + document.getElementById('onlyZzz').addEventListener('change', function() { + var onlyZzz = document.getElementById('onlyZzz').checked; + if (onlyZzz) { + document.getElementById('onlyGi').checked = false; + chrome.storage.local.set({ + onlyGi: false + }); + document.getElementById('onlyHsr').checked = false; + chrome.storage.local.set({ + onlyHsr: false + }); + } + chrome.storage.local.set({ + onlyZzz: onlyZzz + }); + }); const elements = { 'buttonColorMain': buttonColorMain, 'buttonColorGi': buttonColorGi, 'buttonColorHsr': buttonColorHsr, + 'buttonColorZzz': buttonColorZzz, 'buttonTextColorMain': buttonTextColorMain, 'buttonTextColorGi': buttonTextColorGi, 'buttonTextColorHsr': buttonTextColorHsr, + 'buttonTextColorZzz': buttonTextColorZzz, 'BackgroundColorGi': BackgroundColorGi, 'BackgroundColorHsr': BackgroundColorHsr, - 'onlyHsr': onlyHsr, + 'BackgroundColorZzz': BackgroundColorZzz, 'onlyGi': onlyGi, - 'iconDisable': iconDisable, + 'onlyHsr': onlyHsr, + 'onlyZzz': onlyZzz, 'mainBirthdayDisable': mainBirthdayDisable, 'giBirthdayDisable': giBirthdayDisable, 'roundingDisable': roundingDisable, - 'BackgroundHsr': BackgroundHsr, 'BackgroundGi': BackgroundGi, - 'mainFont': mainFont + 'BackgroundHsr': BackgroundHsr, + 'BackgroundZzz': BackgroundZzz, }; for (let id in elements) { let element = document.getElementById(id); @@ -245,6 +298,6 @@ browser.storage.local.get(['giBirthdayDisable', 'mainBirthdayDisable', 'mainFont } else if (result.buttonColorHsr) {} else if (result.buttonColorGi) {} else { - browser.storage.local.set({buttonColorGi: '#a89f96', buttonColorHsr: '#004080'}) + chrome.storage.local.set({buttonColorGi: '#a89f96', buttonColorHsr: '#004080'}) } }); \ No newline at end of file diff --git a/chromium/pictures/background.png b/chromium/pictures/background.png deleted file mode 100644 index 70aef99..0000000 Binary files a/chromium/pictures/background.png and /dev/null differ diff --git a/chromium/pictures/background.webp b/chromium/pictures/background.webp new file mode 100644 index 0000000..78d1d7d Binary files /dev/null and b/chromium/pictures/background.webp differ diff --git a/chromium/pictures/backgroundGI.png b/chromium/pictures/backgroundGI.png deleted file mode 100644 index 8d0611f..0000000 Binary files a/chromium/pictures/backgroundGI.png and /dev/null differ diff --git a/chromium/pictures/backgroundGI.webp b/chromium/pictures/backgroundGI.webp new file mode 100644 index 0000000..f36caa6 Binary files /dev/null and b/chromium/pictures/backgroundGI.webp differ diff --git a/chromium/pictures/backgroundHSR.png b/chromium/pictures/backgroundHSR.png deleted file mode 100644 index 59e8e07..0000000 Binary files a/chromium/pictures/backgroundHSR.png and /dev/null differ diff --git a/chromium/pictures/backgroundHSR.webp b/chromium/pictures/backgroundHSR.webp new file mode 100644 index 0000000..4221b9f Binary files /dev/null and b/chromium/pictures/backgroundHSR.webp differ diff --git a/chromium/pictures/backgroundZZZ.webp b/chromium/pictures/backgroundZZZ.webp new file mode 100644 index 0000000..b116336 Binary files /dev/null and b/chromium/pictures/backgroundZZZ.webp differ diff --git a/chromium/pictures/icon_error.png b/chromium/pictures/icon_error.png deleted file mode 100644 index c85bf2d..0000000 Binary files a/chromium/pictures/icon_error.png and /dev/null differ diff --git a/chromium/pictures/icon_warn.png b/chromium/pictures/icon_warn.png deleted file mode 100644 index 4428ed6..0000000 Binary files a/chromium/pictures/icon_warn.png and /dev/null differ diff --git a/chromium/popup.html b/chromium/popup.html index d6977c8..3988962 100644 --- a/chromium/popup.html +++ b/chromium/popup.html @@ -3,6 +3,7 @@