aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--lib/static.js9
-rw-r--r--public/index.html20
-rw-r--r--public/style.css84
4 files changed, 112 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 93f1361..090a040 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
+logs
node_modules
npm-debug.log
diff --git a/lib/static.js b/lib/static.js
index 2be10bc..7c2f9c1 100644
--- a/lib/static.js
+++ b/lib/static.js
@@ -56,7 +56,14 @@ module.exports = class Static {
return res.end(this.e500);
}}
- if (stats.isDirectory()) path += "/index.html";
+ if (stats.isDirectory()) {
+ if (!path.endsWith("/")) {
+ res.writeHead(302, {"Location":sane+"/"});
+ return res.end(`Redirecting: ${sane}/`);
+ }
+ path += "index.html";
+ }
+
const ext = `${Path.extname(path)}`.toLowerCase();
const stream = fs.createReadStream(path);
diff --git a/public/index.html b/public/index.html
index 88cf66d..28ace1d 100644
--- a/public/index.html
+++ b/public/index.html
@@ -12,7 +12,25 @@
<link rel="stylesheet" href="style.css">
</head>
<body>
- <h1>nomicvote</h1>
+ <section id="main">
+ <h1>nomicvote</h1>
+
+ <div id="buttons">
+ <button id="yes-btn">Yes</button>
+ <button id="no-btn">No</button>
+ <button id="pass-btn">Pass</button>
+ </div>
+ </section>
+
+ <div class="vote-bar dom-grn" style="width:100px">
+ <div class="red" style="width:40%"></div>
+ <div class="grn" style="width:40%"></div>
+ </div>
+
+ <div>
+ <div class="fab"></div>
+ <div class="fab"></div>
+ </div>
<script src="sock.js"></script>
<script src="main.js"></script>
diff --git a/public/style.css b/public/style.css
index 8db054f..07e0c23 100644
--- a/public/style.css
+++ b/public/style.css
@@ -9,6 +9,13 @@
h1 {
font-size: 34px;
font-weight: normal;
+ text-align: center;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
h4 {
@@ -19,3 +26,80 @@ h4 {
p {
font-size: 16px;
}
+
+#buttons {
+ max-width: 600px;
+ margin: auto;
+ text-align: center;
+ font-size: 0;
+ line-height: 0;
+}
+
+#yes-btn, #no-btn {
+ display: inline-block;
+ margin: 8px 0;
+ width: 50%;
+ height: 56px;
+ padding: 0 16px; /* 8 */
+ /* 16 from side */
+ font-size: 24px;
+ color: #fff;
+ border: 0;
+ border-radius: 56px;
+ outline: 0;
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
+ -webkit-tap-highlight-color: transparent;
+}
+
+#yes-btn {
+ background-color: #58c478;
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+
+#no-btn {
+ background-color: #ea6462;
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+
+#pass-btn {
+ display: inline-block;
+ margin: 8px 0;
+ height: 40px;
+ padding: 0 16px; /* 8 */
+ /* 16 from side */
+ border-radius: 40px;
+ font-size: 20px;
+ color: #fff;
+ background-color: #1d7ba3;
+ border: 0;
+ outline: 0;
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
+ -webkit-tap-highlight-color: transparent;
+}
+
+.vote-bar, .vote-bar .red, .vote-bar .grn { height: 10px; border-radius: 10px; }
+.vote-bar { position: relative; margin: 20px; background: #efefef; }
+.vote-bar .red { position: absolute; right:0; background: #ea6462; }
+.vote-bar .grn { position: absolute; left: 0; background: #58c478; }
+.vote-bar.dom-red .red { z-index: 1; }
+.vote-bar.dom-grn .grn { z-index: 1; }
+
+.fab {
+ height: 56px;
+ width: 56px; /* 40 */
+ padding: 16px; /* 8 */
+ /* 16 from side */
+ border-radius: 56px;
+ box-shadow: 0 0 0 1px rgba(0,0,0,.05),
+ 0 3px 3px rgba(0,0,0,.16), 0 3px 3px rgba(0,0,0,.23);
+}
+
+/*
+.matsh-d1 { box-shadow: 0 1px 1.5px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.24); }
+.matsh-d2 { box-shadow: 0 3px 3px rgba(0,0,0,.16), 0 3px 3px rgba(0,0,0,.23); }
+.matsh-d3 { box-shadow: 0 10px 10px rgba(0,0,0,.19), 0 6px 3px rgba(0,0,0,.23); }
+.matsh-d4 { box-shadow: 0 14px 14px rgba(0,0,0,.25), 0 10px 5px rgba(0,0,0,.22); }
+.matsh-d5 { box-shadow: 0 19px 19px rgba(0,0,0,.30), 0 15px 6px rgba(0,0,0,.22); }
+*/