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 @@ +
Font:
- + +