From 5357efeff7f819ff5762271645a8589a98cef841 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 23 Sep 2016 13:37:25 -0400 Subject: [PATCH 1/4] timer final (?) --- ...Andy\342\200\231s MBP on 2016-09-23).html" | 260 ------------------ 1 file changed, 260 deletions(-) delete mode 100644 "public/work/webdev/misc/project/timer (Conflicted copy from Andy\342\200\231s MBP on 2016-09-23).html" diff --git "a/public/work/webdev/misc/project/timer (Conflicted copy from Andy\342\200\231s MBP on 2016-09-23).html" "b/public/work/webdev/misc/project/timer (Conflicted copy from Andy\342\200\231s MBP on 2016-09-23).html" deleted file mode 100644 index 9290caa..0000000 --- "a/public/work/webdev/misc/project/timer (Conflicted copy from Andy\342\200\231s MBP on 2016-09-23).html" +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - - - - Timer - - - - - - - - - - - - - - - \ No newline at end of file From 3cb77e05d2ccd72ef6382ee78ec9656d44f68d5c Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 23 Sep 2016 13:40:47 -0400 Subject: [PATCH 2/4] wtf adobe --- public/work/webdev/misc/project/timer.html | 159 +++++++++++++++++++-- 1 file changed, 146 insertions(+), 13 deletions(-) diff --git a/public/work/webdev/misc/project/timer.html b/public/work/webdev/misc/project/timer.html index fbc3390..9290caa 100644 --- a/public/work/webdev/misc/project/timer.html +++ b/public/work/webdev/misc/project/timer.html @@ -18,7 +18,7 @@ #pauseplay { display: none; } - label[for="pauseplay"] { + #background { position: fixed; top: 0; left: 0; @@ -29,8 +29,10 @@ background: #e67e22; } - label[for="pauseplay"]::after { - content: "\25B6"; + #pauseplay:checked ~ #background { background: #16a085; } + + #background::before { + content: ""; position: absolute; display: block; @@ -47,43 +49,128 @@ border-radius: 64px; } - #pauseplay:checked ~ label[for="pauseplay"] { background: #16a085; } + #background::after { + content: ""; + + position: absolute; + display: block; + top: 50%; + left: 50%; + } + + #pauseplay:not(:checked) ~ #background::after { + width: 0; + height: 0; + transform: translate(-10px, -24px); - #pauseplay:checked ~ label[for="pauseplay"]:after { content: "\23f8"; } + border-top: 24px solid transparent; + border-left: 32px solid #000; + border-bottom: 24px solid transparent; + } + + #pauseplay:checked ~ #background::after { + width: 16px; + height: 48px; + transform: translate(-24px, -24px); + + border-left: 16px solid #000; + border-right: 16px solid #000; + } #time { position: absolute; - width: 128px; + width: 92px; + height: 32px; top: 50%; left: 50%; - transform: translate(-50%, -128px); + padding: 0; + transform: translate(-64px, -128px); border: 0; background-color: rgba(0, 0, 0, 0.1); text-align: center; + line-height: 32px; color: #fff; font-family: sans-serif; font-size: 24px; } + + #time:disabled { + color: #fff; + cursor: not-allowed; + } + + #reset { + position: absolute; + width: 32px; + height: 32px; + top: 50%; + left: 50%; + padding: 0; + transform: translate(32px, -128px); + + background: rgba(0, 0, 0, 0.1); + border: 0; + cursor: pointer; + } + + #reset::before { + content: ""; + + position: absolute; + display: block; + width: 20px; + height: 20px; + top: 50%; + left: 50%; + box-sizing: border-box; + transform: rotate(45deg) translate(-13.5px, 0.5px); + + border-radius: 12px; + border: 4px solid #fff; + border-left: 4px solid transparent; + } + + #reset::after { + content: ""; + + position: absolute; + display: block; + width: 0; + height: 0; + top: 50%; + left: 50%; + transform: translate(-7px, -13px); + + border-top: 6px solid transparent; + border-right: 8px solid #fff; + border-bottom: 6px solid transparent; + } - + + + From 6fb48d6d8a5d5c53a765ca1b02214192cce3b505 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 23 Sep 2016 14:02:51 -0400 Subject: [PATCH 3/4] added support for optional file extensions on web projects --- index.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 83e3e8c..e47cba5 100644 --- a/index.js +++ b/index.js @@ -170,13 +170,29 @@ app.get('/:project*', function(req, res, next) { if(path) { req.url = req.url.substr(req.params.project.length + 2); + let index; + + //if it doesn't end with an extension + if(!/[^\/]+\..+$/.test(req.url)) { + //get the name of what the file would be + let match = req.url.match(/([^\/]+)\/?$/); + + //should always be true hopfully + if(match) { + index = match[1] + '.html'; + + //don't try to get file/file.html, just /file.html + req.url = req.url.substr(0, req.url.length - match[0].length); + } + } + + //should never be true I think if(!req.url.length) req.url = '/'; - express.static(__dirname + '/public/work/' + path).apply(this, arguments); - } else { + express.static(__dirname + '/public/work/' + path, {index}).apply(this, arguments); + } else next(); - } }); //404 From f0f37e52421b5729c68d7b83114f23220c94f348 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 23 Sep 2016 17:19:43 -0400 Subject: [PATCH 4/4] wtf git 3 --- public/work/webdev/misc/project/timer.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/work/webdev/misc/project/timer.html b/public/work/webdev/misc/project/timer.html index 9290caa..e99aecc 100644 --- a/public/work/webdev/misc/project/timer.html +++ b/public/work/webdev/misc/project/timer.html @@ -210,7 +210,7 @@ } time.onkeypress = function(e) { - let code = e.keyCode || e.which; + var code = e.keyCode || e.which; //console.log(code); @@ -222,7 +222,7 @@ !(e.metaKey || e.ctrlKey)) { //keyboard shortcuts //todo - add home/end/pageup/pagedn - let char = String.fromCharCode(code); + var char = String.fromCharCode(code); if(!/[0-9:.]/.test(char)) { e.returnValue = false;