From 14270caa1636333fa5cb80e8f6c7504320112824 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Mon, 15 May 2023 14:57:40 +0200 Subject: [PATCH] better JS-CSS --- web/assets/css/custom.css | 17 +++++++ web/assets/js/langs.js | 85 +++++++++++++-------------------- web/assets/js/util/common.js | 37 +++++++++++--- web/assets/js/util/date-util.js | 56 +++++++++++----------- 4 files changed, 107 insertions(+), 88 deletions(-) diff --git a/web/assets/css/custom.css b/web/assets/css/custom.css index b668551e..99461563 100644 --- a/web/assets/css/custom.css +++ b/web/assets/css/custom.css @@ -142,6 +142,11 @@ transform: translateY(-30px) } +.ant-list-item-meta-title { + font-weight: bold; + font-size: 16px; +} + .ant-progress-inner { background-color: #EBEEF5; } @@ -183,6 +188,18 @@ box-shadow: 0 2px 8px rgba(255,255,255,.15); } +.ant-setting-textarea { + margin-top: 1.5rem; +} + +.ant-card-dark-box-nohover{ + padding: 0 20px 20px !important; + box-shadow: 0 1px 10px -1px rgb(154 175 238 / 0%) !important; +} +.ant-card-dark-box-nohover:hover{ + box-shadow: 0 1px 10px -1px rgb(154 175 238 / 0%) !important; +} + .ant-card-dark .ant-table-thead th { color: hsla(0,0%,100%,.65); background-color: #161b22; diff --git a/web/assets/js/langs.js b/web/assets/js/langs.js index d0bdaf37..1708aed6 100644 --- a/web/assets/js/langs.js +++ b/web/assets/js/langs.js @@ -1,36 +1,41 @@ -supportLangs = [ +const supportLangs = [ { - name : "English", - value : "en-US", - icon : "🇺🇸" + name: 'English', + value: 'en-US', + icon: '🇺🇸', }, { - name : "Farsi", - value : "fa_IR", - icon : "🇮🇷" + name: 'فارسی', + value: 'fa_IR', + icon: '🇮🇷', }, { - name : "汉语", - value : "zh-Hans", - icon : "🇨🇳" + name: '汉语', + value: 'zh-Hans', + icon: '🇨🇳', }, -] + { + name: 'Русский', + value: 'ru_RU', + icon: '🇷🇺', + }, +]; -function getLang(){ - let lang = getCookie('lang') +function getLang() { + let lang = getCookie('lang'); - if (! lang){ - if (window.navigator){ + if (!lang) { + if (window.navigator) { lang = window.navigator.language || window.navigator.userLanguage; - if (isSupportLang(lang)){ - setCookie('lang' , lang , 150) - }else{ - setCookie('lang' , 'en-US' , 150) + if (isSupportLang(lang)) { + setCookie('lang', lang, 150); + } else { + setCookie('lang', 'en-US', 150); window.location.reload(); } - }else{ - setCookie('lang' , 'en-US' , 150) + } else { + setCookie('lang', 'en-US', 150); window.location.reload(); } } @@ -38,47 +43,21 @@ function getLang(){ return lang; } -function setLang(lang){ - - if (!isSupportLang(lang)){ +function setLang(lang) { + if (!isSupportLang(lang)) { lang = 'en-US'; } - setCookie('lang' , lang , 150) + setCookie('lang', lang, 150); window.location.reload(); } -function isSupportLang(lang){ - for (l of supportLangs){ - if (l.value === lang){ +function isSupportLang(lang) { + for (l of supportLangs) { + if (l.value === lang) { return true; } } return false; -} - - - -function getCookie(cname) { - let name = cname + "="; - let decodedCookie = decodeURIComponent(document.cookie); - let ca = decodedCookie.split(';'); - for(let i = 0; i