From 263b09c912e4312a267fcf8c429141e5b6d6db9c Mon Sep 17 00:00:00 2001 From: Tristan Maat Date: Sun, 15 Apr 2018 23:12:01 +0000 Subject: [PATCH] Add startpage --- src/pages/startpage.json | 7 +++++++ src/startpage/startpage.js | 9 +++++++++ src/startpage/startpage.pug | 7 +++++++ src/startpage/startpage.scss | 6 ++++++ 4 files changed, 29 insertions(+) create mode 100644 src/pages/startpage.json create mode 100644 src/startpage/startpage.js create mode 100644 src/startpage/startpage.pug create mode 100644 src/startpage/startpage.scss diff --git a/src/pages/startpage.json b/src/pages/startpage.json new file mode 100644 index 0000000..8c9fb6f --- /dev/null +++ b/src/pages/startpage.json @@ -0,0 +1,7 @@ +{ + "hash": true, + "title": "tlater.net startpage", + "filename": "../startpage.html", + "template": "./src/startpage/startpage.pug", + "chunks": ["startpage"] +} diff --git a/src/startpage/startpage.js b/src/startpage/startpage.js new file mode 100644 index 0000000..1972868 --- /dev/null +++ b/src/startpage/startpage.js @@ -0,0 +1,9 @@ +import "bootstrap"; +import "./startpage.scss"; + +function print_time_recursively (element) { + element.html(new Date().toLocaleString()); + setTimeout(() => print_time_recursively(element), 1000); +} + +$(() => print_time_recursively($("#clock h1"))); diff --git a/src/startpage/startpage.pug b/src/startpage/startpage.pug new file mode 100644 index 0000000..9f2ae0b --- /dev/null +++ b/src/startpage/startpage.pug @@ -0,0 +1,7 @@ +extends ../lib/pug/base + +block content + .container + .row + #clock.col-md-12 + h1 diff --git a/src/startpage/startpage.scss b/src/startpage/startpage.scss new file mode 100644 index 0000000..3e6178b --- /dev/null +++ b/src/startpage/startpage.scss @@ -0,0 +1,6 @@ +@import "../lib/scss/main"; +@import "~bootstrap/scss/bootstrap"; + +#clock { + text-align: center; +}