From 0b966e696c6a99f825510d406008fc9b9936077e Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Mon, 13 Feb 2017 18:43:15 -0200 Subject: [#907] Convert login page to react with @anikarni --- web-ui/src/interstitial/interstitial.js | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 web-ui/src/interstitial/interstitial.js (limited to 'web-ui/src/interstitial/interstitial.js') diff --git a/web-ui/src/interstitial/interstitial.js b/web-ui/src/interstitial/interstitial.js new file mode 100644 index 00000000..2eaa7a1c --- /dev/null +++ b/web-ui/src/interstitial/interstitial.js @@ -0,0 +1,58 @@ +if ($('#hive').length) { + var hive = new Snap('#hive'); + var img_width = $('#hive').width(); + var left_pos = img_width * 0.5; + + var pixelated = hive.path("M12.4,20.3v31.8l28,15.8l28-15.8V20.3l-28-15.8L12.4,20.3z M39.2,56.4l-16.3-9V27.9l16.3,9.3L39.2,56.4z M57.7,47.4l-16.1,9l0-19.2l16.1-9.4V47.4z M57.7,25.2L40.4,35.5L22.9,25.2l17.5-9.4L57.7,25.2z").transform("translate(319, 50)").attr("fill", "#908e8e"); + var all = hive.group().transform("matrix(2, 0, 0, 2, -100, -100)"); + + var height = 50; + var width = 58; + var rows = (($(window).height() / height) / 2) + 1; + var cols = (($(window).width() / width) / 2) + 1; + + + for (var j = 0; j < rows; j++) { + for (var i = 0; i < cols; i++) { + x = i * width + (j%2*width/2); + y = j * height; + all.add(pixelated.clone().transform("translate("+x+","+y+")")); + } + } + + all.add(pixelated); + + var brightenLogo = function () { + var glowPosition = Math.floor(Math.random()*rows*cols); + + all[glowPosition].animate({fill: "#FFF"}, 1000, function() { + darkenLogo(all[glowPosition]); + }); + }; + + var darkenLogo = function (el) { + el.animate({fill: "#908e8e"}, 1000, brightenLogo); + }; + + brightenLogo(); + +} + +$(function () { + var handler = setInterval(function () { + $.ajax({ + method: 'GET', + url: '/login/status' + }).success(function (data) { + if (data.status === 'completed' || data.status === 'error') { + window.location="/"; + } + }); + }, 2000); + + $('#hive-section').height($(window).height()); + + $(window).resize(function() { + window.location.reload(true); + }); +}); -- cgit v1.2.3 From 64780114ae90bb890d3ffa0a9aebe4686c6b74d3 Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Thu, 16 Feb 2017 13:42:50 -0200 Subject: [#907] Adapt login status to work with single user with @anikarni --- web-ui/src/interstitial/interstitial.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web-ui/src/interstitial/interstitial.js') diff --git a/web-ui/src/interstitial/interstitial.js b/web-ui/src/interstitial/interstitial.js index 2eaa7a1c..78a17190 100644 --- a/web-ui/src/interstitial/interstitial.js +++ b/web-ui/src/interstitial/interstitial.js @@ -42,7 +42,7 @@ $(function () { var handler = setInterval(function () { $.ajax({ method: 'GET', - url: '/login/status' + url: '/status' }).success(function (data) { if (data.status === 'completed' || data.status === 'error') { window.location="/"; -- cgit v1.2.3