From 36f82d73352b93faba0bddae82784d871be3a8a8 Mon Sep 17 00:00:00 2001
From: Daniel <50356015+danny007in@users.noreply.github.com>
Date: Thu, 28 Jan 2021 01:05:47 +0530
Subject: [PATCH 1/3] preload improve
---
build/js/Layout.js | 18 +++++++++++-------
build/scss/_layout.scss | 20 +-------------------
build/scss/_preloader.scss | 24 ++++++++++++++++++++++++
3 files changed, 36 insertions(+), 26 deletions(-)
create mode 100644 build/scss/_preloader.scss
diff --git a/build/js/Layout.js b/build/js/Layout.js
index 7e20d5912..cf771f1e1 100644
--- a/build/js/Layout.js
+++ b/build/js/Layout.js
@@ -39,6 +39,7 @@ const Default = {
scrollbarAutoHide: 'l',
panelAutoHeight: true,
panelAutoHeightMode: 'min-height',
+ preloadDuration: 200,
loginRegisterAutoHeight: true
}
@@ -174,13 +175,16 @@ class Layout {
setTimeout(() => {
$('body.hold-transition').removeClass('hold-transition')
}, 50)
- const $preloader = $(SELECTOR_PRELOADER)
- if ($preloader) {
- $preloader.css('height', 0)
- setTimeout(() => {
- $preloader.children().hide()
- }, 200)
- }
+
+ setTimeout(() => {
+ const $preloader = $(SELECTOR_PRELOADER)
+ if ($preloader) {
+ $preloader.css('height', 0)
+ setTimeout(() => {
+ $preloader.children().hide()
+ }, 200)
+ }
+ }, this._config.preloadDuration)
}
_max(numbers) {
diff --git a/build/scss/_layout.scss b/build/scss/_layout.scss
index 2cf857c45..79317df86 100644
--- a/build/scss/_layout.scss
+++ b/build/scss/_layout.scss
@@ -12,20 +12,6 @@ body,
min-height: 100%;
}
-.preloader {
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: $main-bg;
- height: 100vh;
- width: 100%;
- transition: height 200ms linear;
- position: fixed;
- left: 0;
- top: 0;
- z-index: $zindex-preloader;
-}
-
.wrapper {
position: relative;
@@ -662,7 +648,7 @@ body:not(.layout-fixed) {
}
.dark-mode {
- background-color: lighten($dark, 7.5%) !important;
+ background-color: $dark-main-bg;
color: $white;
.breadcrumb-item {
@@ -683,8 +669,4 @@ body:not(.layout-fixed) {
color: $white;
}
}
- .preloader {
- background-color: $dark;
- color: $white;
- }
}
diff --git a/build/scss/_preloader.scss b/build/scss/_preloader.scss
new file mode 100644
index 000000000..8752f5564
--- /dev/null
+++ b/build/scss/_preloader.scss
@@ -0,0 +1,24 @@
+//
+// Core: Preloader
+//
+
+.preloader {
+ display: flex;
+ background-color: $main-bg;
+ height: 100vh;
+ width: 100%;
+ transition: height 200ms linear;
+ position: fixed;
+ left: 0;
+ top: 0;
+ z-index: $zindex-preloader;
+}
+
+.dark-mode {
+ .preloader {
+ background-color: $dark-main-bg;
+ color: $white;
+ }
+}
+
+//
From 1753a44ed4fb85b05310ab49bdc5dbc7b600b9cb Mon Sep 17 00:00:00 2001
From: Daniel <50356015+danny007in@users.noreply.github.com>
Date: Thu, 28 Jan 2021 01:06:16 +0530
Subject: [PATCH 2/3] preload example
---
index.html | 4 ++--
index2.html | 10 ++++++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/index.html b/index.html
index e81f1ae24..a784cd91b 100644
--- a/index.html
+++ b/index.html
@@ -30,8 +30,8 @@
-
-

+
+
diff --git a/index2.html b/index2.html
index 4501f22f3..c358556a0 100644
--- a/index2.html
+++ b/index2.html
@@ -14,10 +14,16 @@
-
+
+
+
+
+

+
+
-