diff --git a/assets/css/lang.css b/assets/css/lang.css new file mode 100644 index 0000000..ddaef3f --- /dev/null +++ b/assets/css/lang.css @@ -0,0 +1,44 @@ +html[lang="en"] body { + direction: ltr; + text-align: left; +} + +.flags { + float: left; + margin: 10px 0 -10px 0; +} +html[lang="en"] .flags { + float: right; +} +html[lang="en"] nav, +html[lang="en"] .nav, +html[lang="en"] footer { + direction: rtl; +} +.flags li { + float: left; + list-style: none; + margin-right: 3px; +} +.flags li a { + float: left; + border: 3px solid transparent; +} +.flags li a.active { + border-color: #ccc; +} +.flags li img { + float: left; + width: 25px; + height: 15px; + object-fit: cover; +} + +html[lang="en"] .fetchIps button:first-child { + border-radius: 5px 0 0 5px; +} +html[lang="en"] .fetchIps button:last-child { + border-radius: 0 5px 5px 0; + border-right: 1px solid #adadad; + border-left: inherit; +} \ No newline at end of file diff --git a/assets/css/style.css b/assets/css/style.css index e4be9b4..ff59dbb 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -258,11 +258,11 @@ img[alt="loader"] { width: 50%; } .fetchIps button:first-child { - width: calc(100% - 100px); + width: calc(100% - 130px); border-radius: 0 5px 5px 0; } .fetchIps button:last-child { - width: 100px; + width: 130px; border-radius: 5px 0 0 5px; border-right: transparent; } @@ -432,4 +432,4 @@ footer p { margin-top: 10px; height: 70px; } -} +} \ No newline at end of file diff --git a/assets/img/flag/gb.png b/assets/img/flag/gb.png new file mode 100644 index 0000000..3b6668e Binary files /dev/null and b/assets/img/flag/gb.png differ diff --git a/assets/img/flag/ir.png b/assets/img/flag/ir.png new file mode 100644 index 0000000..d678f7c Binary files /dev/null and b/assets/img/flag/ir.png differ diff --git a/assets/js/lang.js b/assets/js/lang.js new file mode 100644 index 0000000..5c138ea --- /dev/null +++ b/assets/js/lang.js @@ -0,0 +1,51 @@ +function updateContent(langData) { + document.querySelectorAll('[data-i18n]').forEach(element => { + const key = element.getAttribute('data-i18n'); + if (key) { + element.textContent = langData[key]; + } + }); + document.querySelectorAll('[data-i18n-label]').forEach(element => { + const label = element.getAttribute('data-i18n-label'); + if (label) { + element.placeholder = langData[label]; + } + }); +} + +function setLanguagePreference(lang) { + localStorage.setItem('language', lang); + //location.reload(); +} + +async function fetchLanguageData(lang) { + const response = await fetch("assets/lang/"+lang+".json"); + return response.json(); +} + +async function changeLanguage(lang) { + await setLanguagePreference(lang); + const langData = await fetchLanguageData(lang); + updateContent(langData); + $('#flags li [data-lang]').removeClass('active'); + $('#flags li [data-lang="'+lang+'"]').addClass('active'); + $('html').attr('lang', lang); + //toggleArabicStylesheet(lang); // Toggle Arabic stylesheet +} + +window.addEventListener('DOMContentLoaded', async () => { + const userPreferredLanguage = localStorage.getItem('language') || 'fa'; + $('#flags li [data-lang]').removeClass('active'); + $('#flags li [data-lang="'+userPreferredLanguage+'"]').addClass('active'); + $('html').attr('lang', userPreferredLanguage); + console.log(userPreferredLanguage) + const langData = await fetchLanguageData(userPreferredLanguage); + updateContent(langData); + //toggleArabicStylesheet(userPreferredLanguage); +}); + +$(document).on('click', 'a[data-lang]', function(e) { + e.preventDefault(); + let lang = $(this).data('lang'); + changeLanguage(lang); +}); \ No newline at end of file diff --git a/assets/lang/en.json b/assets/lang/en.json new file mode 100644 index 0000000..1b7f1b8 --- /dev/null +++ b/assets/lang/en.json @@ -0,0 +1,26 @@ +{ + "welcome_message": "Using the Fragment tool, you can revive your dead domains!", + "config_input": "Provide a VLESS/VMESS configuration with WS type:", + "config_input_label": "Your Config", + "config_input_submit": "Check", + "config_form_ortext": "OR", + "config_form_label": "Manually complete the following settings:", + "config_form_protocol": "Protocol", + "config_form_uuid": "UUID", + "config_form_port": "PORT", + "config_form_cleanip": "CleanIP (default: zula.ir)", + "config_form_sni": "SNI", + "config_form_path": "PATH", + "config_form_submit": "Create a JSON file", + "config_form_copy": "Copy Code", + "config_swith_tls": "TLS", + "config_swith_insecure": "Insecure", + "config_swith_earlydata": "Early Data", + "config_swith_mux": "Mux", + "config_mux_label": "the value of Concurrency", + "config_mux_concurrency": "Concurrency", + "config_fragment_label": "the values for Fragments", + "config_fragment_packets": "Packets", + "config_fragment_length": "Length", + "config_fragment_interval": "Interval" +} \ No newline at end of file diff --git a/assets/lang/fa.json b/assets/lang/fa.json new file mode 100644 index 0000000..831e99f --- /dev/null +++ b/assets/lang/fa.json @@ -0,0 +1,26 @@ +{ + "welcome_message": "توسط ابزار فرگمنت می‌تونین دامنه‌های مرده‌تون رو مجدد زنده کنید!", + "config_input": "یک کانفیگ VLESS/VMESS از نوع webSocket وارد کنین:", + "config_input_label": "Your Config", + "config_input_submit": "بررسی", + "config_form_ortext": "یا", + "config_form_label": "تنظیمات زیر رو به‌صورت دستی تکمیل کنین:", + "config_form_protocol": "پروتکل", + "config_form_uuid": "UUID", + "config_form_port": "PORT", + "config_form_cleanip": "CleanIP (default: zula.ir)", + "config_form_sni": "SNI", + "config_form_path": "PATH", + "config_form_submit": "ایجاد فایل JSON", + "config_form_copy": "کپی کد", + "config_swith_tls": "TLS", + "config_swith_insecure": "Insecure", + "config_swith_earlydata": "Early Data", + "config_swith_mux": "Mux", + "config_mux_label": "مقدار Concurrency", + "config_mux_concurrency": "concurrency", + "config_fragment_label": "مقادیر فرگمنت", + "config_fragment_packets": "Packets", + "config_fragment_length": "Length", + "config_fragment_interval": "Interval" +} \ No newline at end of file diff --git a/index.html b/index.html index 1fb1466..d76daec 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,8 @@ - + + IRCF | ابزار فرگمنت @@ -53,92 +54,76 @@

اینترنت برای همه؛ یا هیچ‌کس!

+ +
-

توسط ابزار فرگمنت می‌تونین دامنه‌های مرده‌تون رو مجدد زنده کنید!

+

-

یک کانفیگ VLESS/VMESS از نوع webSocket وارد کنین:

+

- + - +
-
یا
-

یا تنظیمات زیر رو به‌صورت دستی تکمیل کنین:

+
+

- - + +
- - - + + +
-
مقادیر فرگمنت
+
- - - + + +
-
مقدار Concurrency
- +
+
- - + +
-