From fc3ea2dd4bb81bd5a09fcae8bcc8d4958818eda4 Mon Sep 17 00:00:00 2001 From: Tara Rostami <132676256+TaraRostami@users.noreply.github.com> Date: Thu, 22 Feb 2024 22:50:38 +0330 Subject: [PATCH] Ultra Dark Theme for 3X-UI (#1871) --- web/assets/codemirror/xq.css | 4 +- web/assets/css/custom.css | 144 ++++++++------ .../persian-datepicker.min.css | 25 +-- web/html/common/qrcode_modal.html | 8 +- web/html/common/text_modal.html | 4 +- web/html/login.html | 179 +++++++++++++++++- web/html/xui/fakedns_modal.html | 2 +- web/html/xui/index.html | 36 ++-- web/html/xui/settings.html | 8 +- 9 files changed, 304 insertions(+), 106 deletions(-) diff --git a/web/assets/codemirror/xq.css b/web/assets/codemirror/xq.css index 4f7c54cf..3b2dbf73 100644 --- a/web/assets/codemirror/xq.css +++ b/web/assets/codemirror/xq.css @@ -45,8 +45,8 @@ THE SOFTWARE. .cm-s-xq .CodeMirror-activeline-background { background: #e8f2ff; } .cm-s-xq .CodeMirror-matchingbracket { outline:1px solid grey;color:black !important;background:yellow; } -.dark .cm-s-xq.CodeMirror { background-color: #222D42; border-color: #2c3950; color: rgb(255 255 255 / 65%); } -.dark .cm-s-xq.CodeMirror:hover { background-color: rgb(0 50 42 / 30%); border-color: #008771; transition: all .3s; } +.dark .cm-s-xq.CodeMirror { background-color: #000000; border-color: #25272a; color: rgb(255 255 255 / 85%); } +.dark .cm-s-xq.CodeMirror:hover { background-color: rgb(0 50 42 / 20%); border-color: #008771; transition: all .3s; } .dark .cm-s-xq div.CodeMirror-selected { background: rgba(0, 0, 0, 0.5); } .dark .cm-s-xq .CodeMirror-line::selection, .dark .cm-s-xq .CodeMirror-line > span::selection, .dark .cm-s-xq .CodeMirror-line > span > span::selection { background: rgba(39, 0, 122, 0.99); } .dark .cm-s-xq .CodeMirror-line::-moz-selection, .dark .cm-s-xq .CodeMirror-line > span::-moz-selection, .dark .cm-s-xq .CodeMirror-line > span > span::-moz-selection { background: rgba(39, 0, 122, 0.99); } diff --git a/web/assets/css/custom.css b/web/assets/css/custom.css index 8eb5037f..f4a13b51 100644 --- a/web/assets/css/custom.css +++ b/web/assets/css/custom.css @@ -1,3 +1,18 @@ +:root { + --dark-color-background: #21242a; + --dark-color-surface-100: #0c0e12; + --dark-color-surface-200: #222327; + --dark-color-surface-300: #32353b; + --dark-color-surface-400: rgba(255, 255, 255, 0.1); + --dark-color-surface-500: #3b404b; + --dark-color-surface-600: #505663; + --dark-color-text-primary: rgb(255 255 255 / 85%); + --dark-color-stroke: #202025; + --dark-color-btn-danger: #cd3838; + --dark-color-btn-danger-border: transparent; + --dark-color-btn-danger-hover: #e94b4b; +} + html, body { height: 100vh; @@ -502,13 +517,13 @@ style attribute { .dark .ant-table, .dark .ant-collapse-content, .dark .ant-tabs { - background-color: #151f31; - color: #ffffffa6; + background-color: var(--dark-color-surface-100); + color: var(--dark-color-text-primary); } .dark .ant-card-hoverable:hover, .dark .ant-space-item > .ant-tabs:hover { - box-shadow: 0 1px 10px -1px rgb(154 175 238 / 80%); + box-shadow: 0 2px 8px transparent; } .dark > .ant-layout, @@ -518,8 +533,8 @@ style attribute { .dark .ant-table-expanded-row:hover, .dark .ant-table-expanded-row .ant-table-tbody, .dark .ant-calendar { - background-color: #101828; - color: rgb(255 255 255 /65%); + background-color: var(--dark-color-background); + color: var(--dark-color-text-primary); } .dark .ant-table-expanded-row .ant-table-thead > tr:first-child > th { @@ -528,7 +543,7 @@ style attribute { .dark .ant-calendar, .dark .ant-card-bordered { - border-color: #151f31; + border-color: var(--dark-color-background); } .dark .ant-table-bordered, @@ -540,7 +555,7 @@ style attribute { .dark .ant-table-bordered .ant-table-thead > tr:not(:last-child) > th, .dark .ant-table-bordered .ant-table-tbody > tr > td, .dark .ant-table-bordered .ant-table-thead > tr > th { - border-color: #2c3950; + border-color: var(--dark-color-surface-400); } .dark .ant-table-tbody > tr > td, @@ -553,7 +568,7 @@ style attribute { .dark .ant-popover-title, .dark .ant-calendar-header, .dark .ant-calendar-input-wrap { - border-bottom-color: #2c3950; + border-bottom-color: var(--dark-color-surface-400); } .dark .ant-modal-footer, @@ -561,7 +576,7 @@ style attribute { .dark .ant-calendar-footer, .dark .ant-divider-horizontal.ant-divider-with-text-center:before, .dark .ant-divider-horizontal.ant-divider-with-text-center:after { - border-top-color: #2c3950; + border-top-color: var(--dark-color-surface-300); } .dark .ant-progress-text, @@ -597,7 +612,7 @@ style attribute { .dark .ant-calendar-year-panel-year, .dark .ant-calendar-month-panel-month, .dark .ant-calendar-decade-panel-decade { - color: rgba(255, 255, 255, 0.65); + color: rgba(255, 255, 255, 0.85); } .dark .ant-list-item-meta-description { @@ -623,13 +638,12 @@ style attribute { .dark .ant-select-dropdown li, .dark .ant-select-dropdown-menu-item, .dark .ant-divider:not(.ant-divider-with-text-center), -.dark .ant-calendar-input, .dark .client-table-header, .dark .ant-select-selection--multiple .ant-select-selection__choice, .dark .ant-calendar-time-picker-inner { - background-color: #222d42; - border-color: #2c3950; - color: rgba(255, 255, 255, 0.65); + background-color: var(--dark-color-surface-200); + border-color: var(--dark-color-surface-300); + color: rgba(255, 255, 255, 0.85); } .dark .ant-select-selection:hover, @@ -643,7 +657,7 @@ style attribute { } .dark .ant-btn:not(.ant-btn-primary):not(.ant-btn-danger) { - color: rgba(255, 255, 255, 0.65); + color: rgba(255, 255, 255, 0.85); background-color: rgb(10 117 87 / 30%); border: 1px solid #008771; } @@ -666,7 +680,7 @@ style attribute { .dark .ant-btn-danger[disabled], .dark .ant-calendar-ok-btn-disabled { color: rgb(255 255 255 / 35%); - background-color: #2c3950; + background-color: var(--dark-color-surface-300); border-color: #42516c; } @@ -675,7 +689,7 @@ style attribute { > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, .dark .client-table-odd-row { - background-color: #00877122; + background-color: rgb(89 89 89 / 15%); } .dark .ant-table-row-expand-icon { @@ -692,31 +706,31 @@ style attribute { .dark .ant-switch:not(.ant-switch-checked), .dark .ant-progress-line .ant-progress-inner { - background-color: #2c3950; + background-color: var(--dark-color-surface-500); } .dark .ant-progress-circle-trail { - stroke: #2c3950 !important; + stroke: var(--dark-color-stroke) !important; } .ant-dropdown-menu-dark, .dark .ant-popover-inner { - background-color: #222d42; + background-color: var(--dark-color-surface-500); } .dark > .ant-popover-content > .ant-popover-arrow { - border-color: #222d42; + border-color: var(--dark-color-surface-500); } .ant-dropdown-menu-dark .ant-dropdown-menu-item:hover, .dark .ant-select-dropdown-menu-item-selected, .dark .ant-select-dropdown-menu-item:hover, .dark .ant-calendar-time-picker-select-option-selected { - background-color: #313f5a; + background-color: var(--dark-color-surface-600); } .ant-menu-dark .ant-menu-item:hover { - background-color: #2c3950; + background-color: var(--dark-color-surface-300); } .dark .ant-alert-message { @@ -724,9 +738,9 @@ style attribute { } .dark .ant-tag { - color: rgba(255, 255, 255, 0.65); - background-color: #ffffff0a; - border-color: #344461; + color: rgba(255, 255, 255, 0.85); + background-color: rgba(255, 255, 255, 0.08); + border-color: rgba(255, 255, 255, 0.15); } .dark .ant-tag-blue { @@ -737,38 +751,38 @@ style attribute { .dark .ant-tag-red, .dark .ant-alert-error { - background-color: #291515; - border-color: #5c2626; - color: #e04141; + background-color: #2a1215; + border-color: #58181c; + color: #e84749; } .dark .ant-tag-orange, .dark .ant-alert-warning { - background-color: #312313; - border-color: #593914; - color: #ffa031; + background-color: #2b1d11; + border-color: #593815; + color: #e89a3c; } .dark .ant-tag-green { background-color: #112421; - border-color: #144840; - color: #33bca5; + border-color: #195544; + color: #59cbac; } .dark .ant-tag-purple { - background-color: #2c1e32; - border-color: #49394e; - color: #cfb9cc; + background-color: #241121; + border-color: #5a2969; + color: #d686ca; } .dark .ant-modal-content, .dark .ant-modal-header { - background-color: #181f2c; + background-color: #101113; } .dark .ant-calendar-next-month-btn-day .ant-calendar-date, .dark .ant-calendar-last-month-cell .ant-calendar-date { - color: #2c3950; + color: var(--dark-color-surface-300); } .dark .ant-calendar-selected-day .ant-calendar-date { @@ -778,7 +792,7 @@ style attribute { .dark .ant-calendar-date:hover, .dark .ant-calendar-time-picker-select li:hover { - background-color: #313f5a; + background-color: var(--dark-color-surface-300); color: #fff; } @@ -796,7 +810,7 @@ style attribute { } .dark .ant-calendar-time-picker-select { - border-right-color: #2c3950; + border-right-color: var(--dark-color-surface-300); } .has-warning .ant-input, @@ -957,7 +971,7 @@ li.ant-select-dropdown-menu-item:empty:after { } .dark .ant-calendar-year-panel-header { - border-bottom: 1px solid #222d42; + border-bottom: 1px solid var(--dark-color-surface-200); } .dark .ant-calendar-year-panel-last-decade-cell .ant-calendar-year-panel-year, @@ -968,7 +982,7 @@ li.ant-select-dropdown-menu-item:empty:after { .dark .ant-calendar-year-panel-year:hover, .dark .ant-calendar-month-panel-month:hover, .dark .ant-calendar-decade-panel-decade:hover { - background-color: #222d42; + background-color: var(--dark-color-surface-600); } .dark .ant-calendar-header a:hover { @@ -976,13 +990,13 @@ li.ant-select-dropdown-menu-item:empty:after { } .dark .ant-calendar-month-panel-header { - background-color: #101828; - border-bottom: 1px solid #222d42; + background-color: var(--dark-color-background); + border-bottom: 1px solid var(--dark-color-surface-200); } .dark .ant-calendar-year-panel, .dark .ant-calendar table { - background-color: #101828; + background-color: var(--dark-color-background); } .dark .ant-calendar-year-panel-selected-cell .ant-calendar-year-panel-year, @@ -1028,8 +1042,8 @@ li.ant-select-dropdown-menu-item:empty:after { } .dark .ant-calendar-decade-panel-header { - border-bottom: 1px solid #222d42; - background-color: #101828; + border-bottom: 1px solid var(--dark-color-surface-200); + background-color: var(--dark-color-background); } .dark .ant-checkbox-inner { @@ -1043,19 +1057,14 @@ li.ant-select-dropdown-menu-item:empty:after { } .dark .ant-calendar-input { - background-color: #101828; + background-color: var(--dark-color-background); + color: var(--dark-color-text-primary); } .dark .ant-calendar-input::placeholder { color: rgba(255, 255, 255, 0.25); } -.dark .ant-message-notice-content { - background-color: #222d42; - border: 1px solid #2c3950; - color: rgba(255, 255, 255, 0.65); -} - .ant-input-group.ant-input-group-compact-addon:not(:first-child):not( :last-child ), @@ -1105,11 +1114,10 @@ li.ant-select-dropdown-menu-item:empty:after { background-color: rgb(232 244 242); } -.dark .ant-dropdown-menu-item:hover, .dark .ant-dropdown-menu-submenu-title:hover, .dark .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled), .dark .ant-select-dropdown-menu-item:hover:not(.ant-select-dropdown-menu-item-disabled) { - background-color: #313f5a; + background-color: var(--dark-color-surface-300); } .ant-select-dropdown, @@ -1122,6 +1130,8 @@ li.ant-select-dropdown-menu-item:empty:after { } .qr-bg { + width: 100%; + height: 100%; background-color: #fff; display: flex; justify-content: center; @@ -1141,3 +1151,23 @@ li.ant-select-dropdown-menu-item:empty:after { b, strong { font-weight: 500; } + +.ant-collapse>.ant-collapse-item>.ant-collapse-header { + padding: 10px 16px 10px 40px; +} + +.dark .ant-message-notice-content { + background-color: #000000; + border: 1px solid #303134; + color: rgba(255, 255, 255, 0.85); +} + +.ant-btn-danger { + background-color: var(--dark-color-btn-danger); + border-color: var(--dark-color-btn-danger-border); +} + +.ant-btn-danger:focus, .ant-btn-danger:hover { + background-color: var(--dark-color-btn-danger-hover); + border-color: var(--dark-color-btn-danger-hover); +} diff --git a/web/assets/persian-datepicker/persian-datepicker.min.css b/web/assets/persian-datepicker/persian-datepicker.min.css index 9e99974a..2681d6a4 100644 --- a/web/assets/persian-datepicker/persian-datepicker.min.css +++ b/web/assets/persian-datepicker/persian-datepicker.min.css @@ -33,7 +33,8 @@ jdp-container :before { } jdp-container .jdp-icon-minus, jdp-container .jdp-icon-plus { - border: 1px solid rgb(232 244 242); + outline: 1px solid rgb(232 244 242); + outline-offset: -1px; border-radius: 6px; cursor: pointer; display: flex; @@ -368,26 +369,26 @@ jdp-container .jdp-time-container.jdp-only-time .jdp-time:after { } .dark jdp-container .jdp-days { - border-color: #313f5a; + border-color: #32353b; } .dark jdp-overlay { background-color: #181f2c; } .dark jdp-container { - background: #101828; + background: #000000; border-color: #2c3950; box-shadow: 0 2px 8px rgba(0,0,0,.15); color: #fff; } .dark jdp-container .jdp-icon-minus, .dark jdp-container .jdp-icon-plus { - border-color: #313f5a; + outline-color: #32353b; } .dark jdp-container .jdp-icon-minus:hover, .dark jdp-container .jdp-icon-plus:hover { - background-color: #313f5a; + background-color: #32353b; } .dark jdp-container .jdp-months, @@ -404,13 +405,13 @@ jdp-container .jdp-time-container.jdp-only-time .jdp-time:after { .dark jdp-container .jdp-year, .dark jdp-container .jdp-year input, .dark jdp-container .jdp-year select { - background: #101828; - color: rgb(255 255 255 / 65%); + background: #000000; + color: rgba(255, 255, 255, 0.85); } .dark jdp-container .jdp-day, .dark jdp-container .jdp-day-name { border: 1px solid transparent; - color: rgba(255, 255, 255, 0.65); + color: rgba(255, 255, 255, 0.85); } .dark jdp-container .jdp-day-name.today, .dark jdp-container .jdp-day.today { @@ -420,11 +421,11 @@ jdp-container .jdp-time-container.jdp-only-time .jdp-time:after { opacity: 0.15; } .dark jdp-container .jdp-day:not(.disabled-day):hover { - background-color: #313f5a; + background-color: #32353b; color: #fff; } .dark jdp-container .jdp-footer { - border-color: #313f5a; + border-color: #32353b; } .dark jdp-container .jdp-btn-close, .dark jdp-container .jdp-btn-empty, @@ -445,10 +446,10 @@ jdp-container .jdp-time-container.jdp-only-time .jdp-time:after { } .dark jdp-container .jdp-time-container .jdp-time select:hover { - background-color: #313f5a; + background-color: #32353b; color: #fff; } .dark jdp-container .jdp-time-container .jdp-time select { - border: 1px solid rgb(49 63 90); + border: 1px solid #32353b; } diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index 7cc317ef..3fcfdfc1 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -11,7 +11,7 @@ {{ i18n "pages.settings.subSettings"}} + class="qr-bg"> {{ i18n "pages.settings.subSettings"}} Json {{ i18n "pages.inbounds.client" }} @@ -110,4 +110,4 @@ }); -{{end}} \ No newline at end of file +{{end}} diff --git a/web/html/common/text_modal.html b/web/html/common/text_modal.html index 68387be2..d668c792 100644 --- a/web/html/common/text_modal.html +++ b/web/html/common/text_modal.html @@ -9,7 +9,7 @@ {{ i18n "copy" }} - @@ -53,4 +53,4 @@ }); -{{end}} \ No newline at end of file +{{end}} diff --git a/web/html/login.html b/web/html/login.html index b622a080..4605a4fd 100644 --- a/web/html/login.html +++ b/web/html/login.html @@ -2,9 +2,14 @@ {{template "head" .}} @@ -269,8 +393,13 @@ - -

{{ i18n "pages.login.title" }}

+ +

+ + {{ i18n "pages.login.title" }} + 3X-UI + +

@@ -377,6 +506,42 @@ }, }, }); + document.addEventListener("DOMContentLoaded", function() { + var animationDelay = 2000; + initHeadline(); + + function initHeadline() { + animateHeadline(document.querySelectorAll('.headline')); + } + + function animateHeadline(headlines) { + var duration = animationDelay; + headlines.forEach(function(headline) { + setTimeout(function() { + hideWord(headline.querySelector('.is-visible')); + }, duration); + }); + } + + function hideWord(word) { + var nextWord = takeNext(word); + switchWord(word, nextWord); + setTimeout(function() { + hideWord(nextWord); + }, animationDelay); + } + + function takeNext(word) { + return (word.nextElementSibling) ? word.nextElementSibling : word.parentElement.firstElementChild; + } + + function switchWord(oldWord, newWord) { + oldWord.classList.remove('is-visible'); + oldWord.classList.add('is-hidden'); + newWord.classList.remove('is-hidden'); + newWord.classList.add('is-visible'); + } + }); diff --git a/web/html/xui/fakedns_modal.html b/web/html/xui/fakedns_modal.html index c830f44d..c3abe5d5 100644 --- a/web/html/xui/fakedns_modal.html +++ b/web/html/xui/fakedns_modal.html @@ -7,7 +7,7 @@ - + diff --git a/web/html/xui/index.html b/web/html/xui/index.html index 86dbf6b8..1c3132d6 100644 --- a/web/html/xui/index.html +++ b/web/html/xui/index.html @@ -19,12 +19,14 @@ color: hsla(0, 0%, 100%, .65); } - .ant-tag-df { - color: rgb(0 0 0 / 80%); + .dark .ant-card-hoverable:hover, + .dark .ant-space-item > .ant-tabs:hover { + transform: scale(0.987); + outline-color: #40434d; } - .dark .ant-tag-df { - color: rgb(255 255 255 / 80%); + .dark .ant-card-bordered { + outline: 2px solid var(--dark-color-background); } @@ -102,8 +104,8 @@ {{ i18n "pages.index.operationHours" }}: - Xray [[ formatSecond(status.appStats.uptime) ]] - OS [[ formatSecond(status.uptime) ]] + Xray [[ formatSecond(status.appStats.uptime) ]] + OS [[ formatSecond(status.uptime) ]] @@ -137,7 +139,7 @@ {{ i18n "pages.index.systemLoad" }}: - + [[ status.loads[0] ]] | [[ status.loads[1] ]] | [[ status.loads[2] ]]