Added Files
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
@ECHO OFF
|
||||
ECHO Starting Web Server...
|
||||
python3 -m http.server
|
||||
python -m http.server
|
||||
@@ -1,3 +1,5 @@
|
||||
.news-item:nth-child(odd) {background: #CCC}
|
||||
|
||||
.accountbutton {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
@@ -0,0 +1,87 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Nokomis JROTC</title>
|
||||
<script src="//cdn.letreach.com/js/main/a99d6ff3dec6106a641e37d249ac4762.js"></script>
|
||||
<link rel="manifest" href="https://lax18.github.io/WebJROTC/manifest.json">
|
||||
<link rel="stylesheet" href="https://lax18.github.io/WebJROTC/css/font.css">
|
||||
<link rel="stylesheet" href="https://lax18.github.io/WebJROTC/css/material.indigo-red.min.css">
|
||||
<link rel="stylesheet" href="https://lax18.github.io/WebJROTC/css/style.css">
|
||||
<script src="js/authentication.js"></script>
|
||||
<script src="https://lax18.github.io/WebJROTC/js/material.min.js"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="https://www.gstatic.com/firebasejs/5.5.3/firebase.js"></script>
|
||||
<script src="nscript.js"></script>
|
||||
<meta name="theme-color" content="#3f51b5">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/WebJROTC/assets/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/WebJROTC/assets/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/WebJROTC/assets/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/WebJROTC/assets/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/WebJROTC/assets/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/WebJROTC/assets/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/WebJROTC/assets/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/WebJROTC/assets/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/WebJROTC/assets/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/WebJROTC/assets/favicons/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="194x194" href="/WebJROTC/assets/favicons/favicon-194x194.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/WebJROTC/assets/favicons/android-chrome-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/WebJROTC/assets/favicons/favicon-16x16.png">
|
||||
<link rel="mask-icon" href="/WebJROTC/assets/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="apple-mobile-web-app-title" content="JROTC">
|
||||
<meta name="application-name" content="JROTC">
|
||||
<meta name="msapplication-TileColor" content="#3f51b5">
|
||||
<script>
|
||||
function onLoad() {
|
||||
// Initialize Firebase
|
||||
var config = {
|
||||
apiKey: "AIzaSyB0keF26uKYDOR2o-8HYkgoOGWhsPyHdkg",
|
||||
authDomain: "jrotc-database.firebaseapp.com",
|
||||
databaseURL: "https://jrotc-database.firebaseio.com",
|
||||
projectId: "jrotc-database",
|
||||
storageBucket: "jrotc-database.appspot.com",
|
||||
messagingSenderId: "787128694744"
|
||||
};
|
||||
firebase.initializeApp(config);
|
||||
navigator.serviceWorker.register('sw.js');
|
||||
externalOnLoad();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="onLoad()">
|
||||
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
||||
<header class="mdl-layout__header">
|
||||
<div class="mdl-layout__header-row">
|
||||
<!-- Title -->
|
||||
<span class="mdl-layout-title">News</span>
|
||||
<!-- Add spacer, to align navigation to the right -->
|
||||
<div class="mdl-layout-spacer"></div>
|
||||
<div class="clickable"><i class="material-icons" onclick="location.href='info.html'">info</i></div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="mdl-layout__drawer">
|
||||
<span class="mdl-layout-title">Nokomis JROTC</span>
|
||||
<nav class="mdl-navigation">
|
||||
<div id="loginbutton" class="accountbutton">
|
||||
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect" onclick="logIn();">
|
||||
Log In
|
||||
</button>
|
||||
</div>
|
||||
<div id="logoutbutton" class="accountbutton" style="display: none;">
|
||||
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect" onclick="logOut();">
|
||||
Log Out
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<main class="mdl-layout__content">
|
||||
<div class="page-content">
|
||||
<div id="news-holder">
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// onLoad Script to fetch and sort
|
||||
function externalOnLoad() {
|
||||
firebase.database().ref("news")
|
||||
.orderByChild('timestamp')
|
||||
.on('value', function(snapshot) {
|
||||
this.data = [];
|
||||
|
||||
snapshot.forEach(function(child) {
|
||||
console.log(child)
|
||||
var data = child.val
|
||||
var a = document.createElement("div")
|
||||
a.innerHTML = "<div id='news-item'><span id='news-title'><h3>"+child.key+"</h3></span><span id='news-time'>"+data.timestamp+"</span><br><span id='news-content'>"+data.content+"</span></div>"
|
||||
document.getElementById("news-holder").appendChild(a);
|
||||
}.bind(this));
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// Firebase Scripts
|
||||
// global read data and place on page function
|
||||
function setData(ref, element, read1) {
|
||||
var array = readData(ref, function(array) {
|
||||
document.getElementById(element).innerHTML = array[read1]
|
||||
});
|
||||
}
|
||||
|
||||
function readData(ref, callback) {
|
||||
var nextformation = firebase.database().ref(ref);
|
||||
nextformation.on("value", function(data) {
|
||||
var array = data.val();
|
||||
callback(array)
|
||||
});
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
.ribbon-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.ribbons-display {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
@@ -27,11 +31,11 @@
|
||||
}
|
||||
|
||||
.ribbons {
|
||||
margin-right: auto;
|
||||
margin-right: auto;
|
||||
margin-left: 0px;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.ribbon_selector {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -49,12 +49,12 @@
|
||||
<div class="ribbons-display" id="ribbons-display">
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<div id="ribbon_selector">
|
||||
|
||||
<div id="ribbon_selector" class="ribbon-center">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user