From 3cb33c36c4f52f0848e840e25006aaf60e9bafa2 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Tue, 22 Mar 2016 19:05:32 +0100
Subject: [PATCH] UI: add a splashscreen

---
 gui/index.html   | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
 gui/package.json |  8 ++++++--
 2 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 gui/index.html

diff --git a/gui/index.html b/gui/index.html
new file mode 100644
index 000000000..45ca6ae0f
--- /dev/null
+++ b/gui/index.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <title>Duniter</title>
+  <style>
+    html {
+      font-family: "Courier New", Courier, monospace;
+    }
+    img {
+      width: 50%;
+      margin-left: auto;
+      margin-right: auto;
+      display: block;
+
+      margin-top: 40vh;
+      transform: translateY(-50%);
+    }
+    h1 {
+      text-align: center;
+      width: 80%;
+      margin-top: -10%;
+      margin-left: auto;
+      margin-right: auto;
+    }
+  </style>
+</head>
+<body>
+<img src="duniter.png"/>
+<h1 id="loader">Loading...</h1>
+<script type="text/javascript">
+  function reqListener () {
+    document.getElementById('loader').innerHTML = 'Server ready.';
+    location.href = 'http://127.0.0.1:9220';
+  }
+  function test() {
+    var oReq = new XMLHttpRequest();
+    oReq.addEventListener("load", reqListener);
+    oReq.open("GET", "http://127.0.0.1:9220/");
+    oReq.send();
+  }
+  function strange () {
+    document.getElementById('loader').innerHTML = 'The server is not starting...';
+  }
+  setInterval(test, 800);
+  setTimeout(strange, 8000);
+</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/gui/package.json b/gui/package.json
index b27890d8a..693d2c269 100644
--- a/gui/package.json
+++ b/gui/package.json
@@ -1,9 +1,13 @@
 {
   "name": "Duniter",
-  "main": "http://localhost:9220",
+  "main": "index.html",
   "node-main": "../sources/bin/ucoind",
   "window": {
     "icon": "duniter.png",
-    "title": "Duniter v0.2"
+    "title": "Duniter",
+    "width": 800,
+    "height": 800,
+    "min_width": 750,
+    "min_height": 400
   }
 }
-- 
GitLab