Added Navigation

pull/18/head^2
Trivernis 6 years ago
parent 1a7cda36f2
commit d68baeae61

@ -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("<span>" + sideTitle + "</span>");
setTitle(sideTitle);
}
/**
* Sets the title that is displayed for the view
* @param title
*/
function setTitle(title) {
$('.navigationBar .title').html("<span>" + title + "</span>");
}
// -- Events --

@ -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
font-family: ubuntuL

@ -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

@ -16,6 +16,6 @@
</p>
<div class="spacer">
</div>
<p class="justify">
</p>
<script type="text/javascript">
setTitle('About')
</script>

@ -1,13 +1,15 @@
<h1> Data </h1>
<div>
<div style="height: 100px; width: 100%">
<svg viewBox="0 0 100 100" style="height: 100%; width: 100%">
<polygon
v-bind:points="temperatureData">
</polygon>
</svg>
</div>
</div>
<script src="/data.js" type="text/javascript">
</script>
<h1> Data </h1>
<div id="app">
<div style="height: 100px; width: 100%">
<svg viewBox="0 0 100 100" style="height: 100%; width: 100%">
<polygon
v-bind:points="temperatureData">
</polygon>
</svg>
</div>
</div>
<script src="/data.js" type="text/javascript">
</script>
<script type="text/javascript">
setTitle('Data')
</script>

@ -18,4 +18,7 @@
</div>
<div class="panel">
</div>
</div>
</div>
<script type="text/javascript">
setTitle('Home')
</script>

@ -3,7 +3,6 @@
<title> Landing 1 </title>
</head>
<body>
<div class="accentBar"></div>
<div class="app">
<div class="actionList">
<ul>
@ -28,7 +27,7 @@
</div>
<div class="content">
<script type="text/javascript">
navigate('index.htm', 'Home');
navigate(window.location.hash.replace('#', '') || 'index.htm', window.location.hash || 'Home');
</script>
</div>
</div>

Loading…
Cancel
Save