Skip to content

Commit

Permalink
2.2.3 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kajitsy authored Jan 18, 2024
1 parent af32de6 commit df94c9e
Show file tree
Hide file tree
Showing 30 changed files with 637 additions and 299 deletions.
24 changes: 21 additions & 3 deletions chromium/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "Quick entry of Genshin Impact/Honkai: Star Rail promo codes | 2.2.2.1"
"message": "Quick entry of Genshin Impact/Honkai: Star Rail promo codes | 2.2.3"
},
"submit": {
"message": "Submit"
Expand Down Expand Up @@ -32,10 +32,10 @@
"reset": {
"message": "Reset"
},
"buttonColort": {
"labelButtonColor": {
"message": "Button Color"
},
"buttonTextColort": {
"labelTextColor": {
"message": "Text Color"
},
"labelBackground": {
Expand All @@ -46,5 +46,23 @@
},
"displayOverlay" :{
"message": "Link copied"
},
"labelGlobal": {
"message": "Global settings"
},
"labelMainPopup": {
"message": "Main popup settings"
},
"labelOnlyGi": {
"message": "Popup settings, only Genshin Impact"
},
"labelOnlyHsr": {
"message": "Popup settings, Honkai Star Rail only"
},
"labelRounding": {
"message": "Disable roundings"
},
"labelSnow": {
"message": "Turn off the snowfall"
}
}
24 changes: 21 additions & 3 deletions chromium/_locales/es/messages.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extensionDescription": {
"message": "Entrada rápida de los códigos promocionales de Genshin Impact/Honkai: Star Rail | 2.2.2.1"
"message": "Entrada rápida de los códigos promocionales de Genshin Impact/Honkai: Star Rail | 2.2.3"
},
"submit": {
"message": "Enviar"
Expand Down Expand Up @@ -32,10 +32,10 @@
"reset": {
"message": "Reiniciar"
},
"buttonColort": {
"labelButtonColor": {
"message": "Color de botones"
},
"buttonTextColort": {
"labelTextColor": {
"message": "Color de texto"
},
"labelBackground": {
Expand All @@ -46,5 +46,23 @@
},
"displayOverlay" :{
"message": "Enlace copiado"
},
"labelGlobal": {
"message": "Configuración global"
},
"labelMainPopup": {
"message": "Configuración de la ventana principal"
},
"labelOnlyGi": {
"message": "Ajustes de ventana, sólo Genshin Impact"
},
"labelOnlyHsr": {
"message": "Ajustes de ventana, sólo Honkai Star Rail"
},
"labelRounding": {
"message": "Desactivar el redondeo"
},
"labelSnow": {
"message": "Apagar la nevada"
}
}
22 changes: 20 additions & 2 deletions chromium/_locales/jp/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"reset": {
"message": "リセット"
},
"buttonColort": {
"labelButtonColor": {
"message": "ボタンの色"
},
"buttonTextColort": {
"labelTextColor": {
"message": "テキストの色"
},
"labelBackground": {
Expand All @@ -43,5 +43,23 @@
},
"displayOverlay" :{
"message": "コピーされたリンク"
},
"labelGlobal": {
"message": "グローバル設定"
},
"labelMainPopup": {
"message": "メインウィンドウの設定"
},
"labelOnlyGi": {
"message": "ウィンドウの設定のみ Genshin Impact"
},
"labelOnlyHsr": {
"message": "ウィンドウの設定のみ Honkai Star Rail"
},
"labelRounding": {
"message": "丸めを無効にする"
},
"labelSnow": {
"message": "降雪のスイッチを切る"
}
}
28 changes: 23 additions & 5 deletions chromium/_locales/ru/messages.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"extensionDescription": {
"message": "Быстрый ввод промокодов Genshin Impact/Honkai: Star Rail | 2.2.2.1"
"message": "Быстрый ввод промокодов Genshin Impact/Honkai: Star Rail | 2.2.3"
},
"submit": {
"message": "Ввести"
},
"share": {
"message": "Поделиться"
},
"labelgi": {
"labelGi": {
"message": "Только Genshin Impact"
},
"labelHsr": {
Expand All @@ -32,10 +32,10 @@
"reset": {
"message": "Сбросить"
},
"buttonColort": {
"labelButtonColor": {
"message": "Цвет кнопок"
},
"buttonTextColort": {
"labelTextColor": {
"message": "Цвет текста"
},
"labelBackground": {
Expand All @@ -44,7 +44,25 @@
"labelBackgroundColor": {
"message": "Цвет фона (если включено)"
},
"displayOverlay" :{
"displayOverlay": {
"message": "Ссылка скопирована"
},
"labelGlobal": {
"message": "Глобальные настройки"
},
"labelMainPopup": {
"message": "Настройки основного окна"
},
"labelOnlyGi": {
"message": "Настройки окна, только Genshin Impact"
},
"labelOnlyHsr": {
"message": "Настройки окна, только Honkai Star Rail"
},
"labelRounding": {
"message": "Отключить закругления"
},
"labelSnow": {
"message": "Отключить снегопад"
}
}
2 changes: 1 addition & 1 deletion chromium/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Genshin/Star Rail CodeEntter",
"version": "2.2.2",
"version": "2.2.3",
"description": "__MSG_extensionDescription__",
"default_locale": "en",
"icons": {
Expand Down
24 changes: 20 additions & 4 deletions chromium/onlyGi.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
background-repeat: no-repeat;
background-position: center;
overflow: hidden;
width: 170vh;
}
#input-container {
display: flex;
Expand All @@ -32,11 +33,13 @@
box-sizing: border-box;
background-color: var(--input-color);
color: var(--input-text-color);
border-radius: var(--border-radius);
border: none;
border-radius: 10px;
padding: 10px;
width: 100%;
font-family: 'SDK_SC_Web';
z-index: 2;
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.6);
}
#buttons-container {
display: flex;
Expand All @@ -51,22 +54,24 @@
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
border: none;
border-radius: var(--border-radius);
background: var(--button-color);
color: var(--button-text-color);
padding: 10px;
transition: transform 0.3s ease;
z-index: 2;
font-family: 'SDK_SC_Web';
box-shadow: 0px 3px 7px 0px rgba(0, 0, 0, 0.5);
}
#submit:hover, #share:hover, #options:hover {
transform: scale(1.2);
transform: scale(1.05);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
border-radius: var(--border-radius);
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.5);
}
#frame {
border: none;
Expand All @@ -86,6 +91,16 @@
z-index: 2;
font-family: 'SDK_SC_Web';
}
@keyframes snowfall {
from {
transform: translateY(-100vh);
} to {
transform: translateY(100vh);
}
}
.snowflake {
z-index: 1;
}
</style>
</head>
<body>
Expand All @@ -99,5 +114,6 @@
<iframe id="frame" src="" width="756" height="550" style="display: none;"></iframe>
<div id="displayOverlay"></div>
<script src="onlyGi.js"></script>
<script src="snow.js"></script>
</body>
</html>
52 changes: 44 additions & 8 deletions chromium/onlyGi.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,26 @@ if (typeof browser === "undefined") {
const buttonElement = document.getElementById(buttonId);
if (buttonElement) {
buttonElement.textContent = browser.i18n.getMessage(buttonId);

buttonElement.addEventListener('click', function () {
const code = document.getElementById('code').value;
const locales = navigator.language.slice(0, 2);
let url;

switch (buttonId) {
case 'submit':
const locales = navigator.language.slice(0, 2);
url = `https://genshin.hoyoverse.com/${locales}/gift?code=${code}`;
document.getElementById('frame').src = url;
break;

case 'share':
const shareLocales = navigator.language.slice(0, 2);
url = `https://genshin.hoyoverse.com/${shareLocales}/gift?code=${code}`;
url = `https://genshin.hoyoverse.com/${locales}/gift?code=${code}`;
navigator.clipboard.writeText(url);
displayOverlay();
break;

default:
break;
}

if (buttonId === 'submit') {
const frame = document.getElementById('frame');
frame.style.display = 'block';
Expand All @@ -48,8 +45,32 @@ function displayOverlay() {
overlay.style.display = 'none';
}, 2000);
}

browser.storage.local.get(['buttonColorGi', 'buttonTextColorGi', 'BackgroundGi', 'BackgroundColorGi']).then(function (result) {
function createSnowflake() {
const snowflake = document.createElement('div');
snowflake.className = 'snowflake';
snowflake.innerHTML = '❄';
const size = Math.random() * 3 + 2;
const fontSize = size > 5 ? 5 : size;
snowflake.style.fontSize = fontSize + 'rem';
snowflake.style.position = 'absolute';
snowflake.style.color = 'white';
snowflake.style.pointerEvents = 'none';
const startPositionLeft = Math.random() * window.innerWidth;
const duration = Math.random() * 4 + 3 + 's';
const delay = Math.random() * 10 + 's';
snowflake.style.left = startPositionLeft + 'px';
snowflake.style.animation = `snowfall ${duration} linear ${delay} infinite`;
document.body.appendChild(snowflake);
snowflake.addEventListener('animationiteration', () => {
snowflake.style.left = Math.random() * window.innerWidth + 'px';
});
}
function generateSnowfall() {
for (let i = 0; i < 20; i++) {
createSnowflake();
}
}
browser.storage.local.get(['snowDisable', 'buttonColorGi', 'buttonTextColorGi', 'BackgroundGi', 'BackgroundColorGi']).then(function (result) {
if (result.buttonColorGi) {
document.documentElement.style.setProperty('--button-color', result.buttonColorGi);
}
Expand All @@ -67,4 +88,19 @@ browser.storage.local.get(['buttonColorGi', 'buttonTextColorGi', 'BackgroundGi',
document.body.style.backgroundPosition = 'center';
document.body.style.overflow = 'hidden';
}
if (result.snowDisable){
console.log("Snow Disable");
}
else {
console.log("Snow Enable");
generateSnowfall();
}
});
browser.storage.local.get(['roundingDisable']).then(function (result) {
if (result.roundingDisable) {
document.documentElement.style.setProperty('--border-radius', '10px')
}
else {
document.documentElement.style.setProperty('--border-radius', '20px')
}
});
Loading

0 comments on commit df94c9e

Please sign in to comment.