Skip to content
Permalink
Browse files

standarise loading bars

  • Loading branch information...
Manuel-777 committed Mar 28, 2019
1 parent 6735670 commit 95f6e1c1c7368cbb90476617c077deb553baf996
Showing with 36 additions and 11 deletions.
  1. +14 −1 shared/shared.css
  2. +2 −0 window_main/explore.js
  3. +2 −0 window_main/history.js
  4. +3 −0 window_main/index.html
  5. +15 −10 window_main/renderer.js
@@ -155,6 +155,19 @@ label {
z-index: 50;
}

.loading_bar_main {
background-color: #B7C89E;
overflow: hidden;
width: calc(100% - 4px);
height: 4px;
position: absolute;
top: 91px;
animation-name: color;
animation-duration: 2s;
animation-iteration-count: infinite;
z-index: 50;
}

.ux_loading {
position: absolute !important;
width: 50% !important;
@@ -163,7 +176,7 @@ label {
.loading_color {
position: relative;
width: 200%;
height: inherit;
height: 100%;
animation-name: grow;
animation-duration: 2s;
animation-iteration-count: infinite;
@@ -404,6 +404,7 @@ function queryExplore(skip) {
filterSkip: filterSkip
};

showLoadingBars();
ipc_send("request_explore", query);
}

@@ -685,6 +686,7 @@ function eventLoad(event, index) {
}

function open_course_request(courseId) {
showLoadingBars();
ipc_send("request_course", courseId);
}

@@ -18,6 +18,7 @@ globals
createDivision,
playerData,
tags_colors,
showLoadingBars,
$$
*/
const RANKS = ["Bronze", "Silver", "Gold", "Platinum", "Diamond", "Mythic"];
@@ -808,6 +809,7 @@ function draftShareLink() {
expire: expire,
id: currentId
};
showLoadingBars();
ipc_send("request_draft_link", obj);
}

@@ -62,6 +62,9 @@
</div>
</div>

<div class="loading_bar_main main_loading" style="display: none"><div class="loading_color loading_w"></div><div class="loading_color loading_u"></div><div class="loading_color loading_b"></div><div class="loading_color loading_r"></div><div class="loading_color loading_g"></div></div>


<div class="popup"></div>
<div class="wrapper">
<div class="loading_bar init_loading"><div class="loading_color loading_w"></div><div class="loading_color loading_u"></div><div class="loading_color loading_b"></div><div class="loading_color loading_r"></div><div class="loading_color loading_g"></div></div>
@@ -454,6 +454,7 @@ ipc.on("set_status", function(event, arg) {
//
ipc.on("set_home", function(event, arg) {
document.body.style.cursor = "auto";
hideLoadingBars();
deck_tags = arg.tags;

Object.keys(deck_tags).forEach(function(format) {
@@ -469,6 +470,7 @@ ipc.on("set_home", function(event, arg) {

//
ipc.on("set_explore_decks", function(event, arg) {
hideLoadingBars();
if (sidebarActive == 3) {
setExploreDecks(arg);
}
@@ -517,6 +519,7 @@ ipc.on("open_course_deck", function(event, arg) {
arg.mainDeck = removeDuplicates(arg.mainDeck);
arg.sideboard = removeDuplicates(arg.sideboard);
open_deck(arg, 1);
hideLoadingBars();
});

//
@@ -612,6 +615,7 @@ ipc.on("initialize", function() {
$(".top_username_id").html(playerData.name.slice(-6));

sidebarActive = -1;
showLoadingBars();
ipc_send("request_home", true);
$(".top_nav").removeClass("hidden");
$(".overflow_ux").removeClass("hidden");
@@ -793,6 +797,7 @@ function force_open_about() {
let top_compact = false;
let resizeTimer;
window.addEventListener("resize", event => {
hideLoadingBars();
clearTimeout(resizeTimer);
resizeTimer = setTimeout(() => {
if ($(".top_nav_icons").width() < 500) {
@@ -878,10 +883,7 @@ $(document).ready(function() {
if (offlineMode) {
showOfflineSplash();
} else {
$("#ux_0").html(
'<div class="loading_bar ux_loading"><div class="loading_color loading_w"></div><div class="loading_color loading_u"></div><div class="loading_color loading_b"></div><div class="loading_color loading_r"></div><div class="loading_color loading_g"></div></div>'
);

showLoadingBars();
if (discordTag == null) {
open_home_tab(null, true);
} else {
@@ -907,12 +909,6 @@ $(document).ready(function() {
if ($(this).hasClass("it3")) {
sidebarActive = 3;
openExploreTab();
/*
$("#ux_0").html(
'<div class="loading_bar ux_loading"><div class="loading_color loading_w"></div><div class="loading_color loading_u"></div><div class="loading_color loading_b"></div><div class="loading_color loading_r"></div><div class="loading_color loading_g"></div></div>'
);
document.body.style.cursor = "progress";
*/
}
if ($(this).hasClass("it4")) {
sidebarActive = 4;
@@ -932,8 +928,17 @@ $(document).ready(function() {
});
});

function showLoadingBars() {
$$(".main_loading")[0].style.display = "block";
}

function hideLoadingBars() {
$$(".main_loading")[0].style.display = "none";
}

//
ipc.on("set_draft_link", function(event, arg) {
hideLoadingBars();
document.getElementById("share_input").value = arg;
});

0 comments on commit 95f6e1c

Please sign in to comment.
You can’t perform that action at this time.