exports.update_preloader = function(percentage) { _preloader.caption.innerHTML = percentage + "%"; if (_preloader.type == "SIMPLE") _preloader.bar.style.width = percentage + "%"; if (_preloader.type == "ADVANCED") { _preloader.bar.style.width = percentage / _preloader.ratio + "%"; _preloader.fill.style.width = (100 - percentage) + "%"; } if (_preloader.type == "ROTATION") _preloader.anim_elem.style.transform = "rotate(" + percentage + "deg)"; if (percentage == 100) if (_preloader.fadeout) { m_app.css_animate(_preloader.background, "opacity", 1, 0, 1500, null, null, function(){ _preloader.background.parentNode.removeChild(_preloader.background); }); m_app.css_animate(_preloader.container, "opacity", 1, 0, 1000, null, null, function(){ _preloader.container.parentNode.removeChild(_preloader.container); }); } else { _preloader.container.parentNode.removeChild(_preloader.container); if (_preloader.background) _preloader.background.parentNode.removeChild(_preloader.background); } }
m_app.css_animate(_logo_container, "opacity", 0, 1, LOGO_SHOW_DELAY, "", "", function() { _preloader_caption.style.display = "block"; m_app.css_animate(_preloader_caption, "opacity", 0, 1, CAPTION_SHOW_DELAY, "", "", function() { m_main.resume(); m_data.load(file, loaded_callback, preloader_callback, false); }); })
function show_replay() { _replay_circle.addEventListener("click", return_to_begin); var replay_style = _replay.style; replay_style.opacity = 0; replay_style.display = "block"; var b4w_logo_style = _blend4web_logo.style; b4w_logo_style.opacity = 0; b4w_logo_style.display = "block"; var soc_but_style = _social_buttons.style; soc_but_style.opacity = 0; soc_but_style.display = "block"; m_app.css_animate(_replay, "opacity", 0, 1, REPLAY_FADE_IN, "", "", function() { m_app.css_animate(_blend4web_logo, "opacity", 0, 1, LOGO_FADE_IN); m_app.css_animate(_social_buttons, "opacity", 0, 1, SOCIAL_FADE_IN); }); m_anim.apply(_bm_13_Armature, "bm_13_Armature_rotate_-20_Action"); m_anim.set_behavior(_bm_13_Armature, m_anim.AB_FINISH_STOP); m_anim.set_first_frame(_bm_13_Armature); }
function remove_preloader() { show_info(); m_app.css_animate(_preload_cont, "opacity", 1, 0, REMOVE_PRELOAD_TIME, "", "", function() { _preload_cont.parentNode.removeChild(_preload_cont); }); }
var drop_top = function(elem) { _is_anim_top = true; m_app.css_animate(elem, "marginBottom", 0, -45, ANIM_ELEM_DELAY, "", "px"); m_app.css_animate(elem, "opacity", 1, 0, ANIM_ELEM_DELAY, "", "", function() { if (elem.nextElementSibling && elem.nextElementSibling.id != "opened_button") drop_top(elem.nextElementSibling); else { setTimeout(function() { _is_anim_top = false; _is_panel_open_top = false; check_anim_end(); }, 100); return; } }); }
var drop_left = function(elem) { _is_anim_left = true; m_app.css_animate(elem, "marginRight", 0, -45, ANIM_ELEM_DELAY, "", "px"); m_app.css_animate(elem, "opacity", 1, 0, ANIM_ELEM_DELAY, "", "", function() { if (elem.previousElementSibling && elem.previousElementSibling.id != "opened_button") drop_left(elem.previousElementSibling); else { setTimeout(function() { _is_anim_left = false; _is_panel_open_left = false; check_anim_end(); _hor_button_section.style.display = ""; }, 100); return; } }); }
var drop_top = function(elem) { _is_anim_top = true; elem.style.marginBottom = "-45px"; elem.style.display = "block"; m_app.css_animate(elem, "marginBottom", -45, 0, ANIM_ELEM_DELAY, "", "px", function() { if (!elem.previousElementSibling) { setTimeout(function() { _is_anim_top = false; _is_panel_open_top = true; check_anim_end(); }, 100); return; } drop_top(elem.previousElementSibling) }); m_app.css_animate(elem, "opacity", 0, 1, ANIM_ELEM_DELAY, "", ""); }
var drop_left = function(elem) { _is_anim_left = true; elem.style.marginRight = "-45px"; if ((elem.id == "help_button") && _is_help_menu_opened) { setTimeout(function() { _is_anim_left = false; _is_panel_open_left = true; check_anim_end(); }, 100); return; } elem.style.display = "block"; m_app.css_animate(elem, "marginRight", -45, 0, ANIM_ELEM_DELAY, "", "px", function() { if (!elem.nextElementSibling) { setTimeout(function() { _is_anim_left = false; _is_panel_open_left = true; check_anim_end(); }, 100); return; } drop_left(elem.nextElementSibling) }); m_app.css_animate(elem, "opacity", 0, 1, ANIM_ELEM_DELAY, "", ""); }
function create_preloader() { m_main.pause(); var pl_cont = document.querySelector("#pl_cont"); var pl_frame = pl_cont.querySelector("#pl_frame"); _pl_bar = document.querySelector("#pl_bar"); _pl_caption = document.querySelector("#pl_caption"); _pl_fill = document.querySelector("#pl_fill"); m_app.css_animate(pl_cont, "opacity", 0, 1, 500, "", "", function() { m_main.resume(); pl_frame.style.opacity = 1; }) }
function preloader_callback(percentage) { _pl_bar.style.width = percentage / (460 / 295) + "%"; _pl_fill.style.width = (100 - percentage) + "%"; _pl_caption.innerHTML = percentage + "%"; if (percentage == 100) { var pl_cont = document.querySelector("#pl_cont"); var pl_frame = pl_cont.querySelector("#pl_frame"); var scroll_panel = document.querySelector("#scroll_panel"); pl_frame.style.opacity = 0; m_app.css_animate(pl_cont, "opacity", 1, 0, 1000, "", "", function() { m_app.css_animate(scroll_panel, "opacity", 0, 1, 500); pl_cont.parentNode.removeChild(pl_cont); }) } }
cb: function() { _opened_button.style.display = "block"; m_app.css_animate(_opened_button, "transform", 0, 1, MENU_BUTTON_SHOW_DELAY, "scale(", ")"); }
m_app.css_animate(pl_cont, "opacity", 1, 0, 1000, "", "", function() { m_app.css_animate(scroll_panel, "opacity", 0, 1, 500); pl_cont.parentNode.removeChild(pl_cont); })
m_app.css_animate(_replay, "opacity", 0, 1, REPLAY_FADE_IN, "", "", function() { m_app.css_animate(_blend4web_logo, "opacity", 0, 1, LOGO_FADE_IN); m_app.css_animate(_social_buttons, "opacity", 0, 1, SOCIAL_FADE_IN); });