From d68baeae618e50499d23aa474e9978cfb35cbb83 Mon Sep 17 00:00:00 2001
From: Trivernis
Date: Mon, 22 Oct 2018 20:39:44 +0200
Subject: [PATCH] Added Navigation
---
glob/script.js | 17 ++++++++++++++-
glob/style.sass | 46 +---------------------------------------
glob/style/elements.sass | 2 ++
res/html/about.htm | 6 +++---
res/html/data.htm | 28 ++++++++++++------------
res/html/index.htm | 5 ++++-
res/html/index.html | 3 +--
7 files changed, 42 insertions(+), 65 deletions(-)
diff --git a/glob/script.js b/glob/script.js
index b8e7470..31154a3 100644
--- a/glob/script.js
+++ b/glob/script.js
@@ -52,10 +52,25 @@ function toggleActionMenu() {
}
}
+/**
+ * Navigates inside the app
+ * @param view the targeted view
+ * @param title the title of the targtet that is displayed
+ */
function navigate(view, title) {
+ if (view !== 'index.htm') window.location.hash = view;
+ else window.location.hash = "";
$('.content').load(view);
let sideTitle = title || view.replace(/\.htm/, '');
- $('.navigationBar .title').html("" + sideTitle + "");
+ setTitle(sideTitle);
+}
+
+/**
+ * Sets the title that is displayed for the view
+ * @param title
+ */
+function setTitle(title) {
+ $('.navigationBar .title').html("" + title + "");
}
// -- Events --
diff --git a/glob/style.sass b/glob/style.sass
index 2ccbac0..6f38134 100644
--- a/glob/style.sass
+++ b/glob/style.sass
@@ -17,48 +17,4 @@
body
- font-family: ubuntuL
-
-//a
- color: $link-color
-
-//a:hover
- color: lighten($link-color, 10%)
-
-//a:visited
- color: darken($link-color, 10%)
-
-//h1, h2, h3, h4, h5
- line-height: 1.5em
-// tag-like classes
-
-//.title
- font-size: 30pt
-
-//.content
- padding: 0px 10%
- margin: auto
- line-height: 1.5em
-
-//.footer
- position: absolute
- width: 100%
- bottom: 0px
- left: 0px
- background: $bar-color
-
-//.header
- padding: 1px 1px
- position: static
- width: 100%
- top: 0px
- left: 0px
- background: $bar-color
-
-//.spacer
- height: 50px
-
-// attribute-like classes
-
-//.justify
- text-align: justify
\ No newline at end of file
+ font-family: ubuntuL
\ No newline at end of file
diff --git a/glob/style/elements.sass b/glob/style/elements.sass
index 8315a3e..a211776 100644
--- a/glob/style/elements.sass
+++ b/glob/style/elements.sass
@@ -42,10 +42,12 @@
background: url("/icons/menu.svg") no-repeat center, $cPrimary
transition-duration: 0.3s
cursor: pointer
+ border-radius: 0
.menu:hover
background: url("/icons/menu.svg") no-repeat center, darken($cPrimary, 4%)
.menu:active
background: url("/icons/menu.svg") no-repeat center, lighten($cPrimary, 4%)
+ border-radius: 2em
.button
background: $cPrimary
padding: 1em $sPadding 0
diff --git a/res/html/about.htm b/res/html/about.htm
index e69521a..5b3b105 100644
--- a/res/html/about.htm
+++ b/res/html/about.htm
@@ -16,6 +16,6 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/res/html/data.htm b/res/html/data.htm
index 4b367d5..3c26706 100644
--- a/res/html/data.htm
+++ b/res/html/data.htm
@@ -1,13 +1,15 @@
-
- Data
-
-
+ Data
+
+
+
\ No newline at end of file
diff --git a/res/html/index.htm b/res/html/index.htm
index 4bc0ad8..9e038c9 100644
--- a/res/html/index.htm
+++ b/res/html/index.htm
@@ -18,4 +18,7 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/res/html/index.html b/res/html/index.html
index d28af8e..c1d2b14 100644
--- a/res/html/index.html
+++ b/res/html/index.html
@@ -3,7 +3,6 @@
Landing 1
-