From ea3bc60ac35fec0f7ac55fd3c2d6a132914529e8 Mon Sep 17 00:00:00 2001 From: flifloo Date: Fri, 14 Aug 2020 20:08:00 +0200 Subject: [PATCH] First graphics tests --- app.js | 2 + public/stylesheets/style.css | 75 +++++++++++++++++++++++++++++++++++- views/index.pug | 46 +++++++++++++++++++++- 3 files changed, 120 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 03884d6..04f9feb 100644 --- a/app.js +++ b/app.js @@ -4,6 +4,7 @@ let cookieParser = require("cookie-parser"); let logger = require("morgan"); let indexRouter = require("./routes/index"); +let commandRouter = require("./routes/command") let app = express(); @@ -18,6 +19,7 @@ app.use(cookieParser()); app.use(express.static(path.join(__dirname, "public"))); app.use("/", indexRouter); +app.use("/command", commandRouter); // catch 404 and forward to error handler app.use((req, res) => { diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 9453385..50cefd1 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -1,8 +1,81 @@ +html, body { + margin: 0; + height: 100%; +} + body { - padding: 50px; + display: flex; + align-items: center; font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; + background-color: #db970a; + background-image: linear-gradient(white 2px, transparent 2px), + linear-gradient(90deg, white 2px, transparent 2px), + linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px), + linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px); + background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px; + background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px; +} + +.card { + display: flex; + flex-direction: column; + width: max-content; + min-height: 80%; + height: auto; + padding: 1em; + margin: auto; + background-color: white; + box-shadow: 0.5em 0.5em 0.5em rgba(0, 0, 255, .2); + /* overflow-y: scroll; */ +} + +h1, h2, p{ + text-align: center; } a { color: #00B7FF; } + +#command { + margin: auto; + display: flex; + flex-direction: column; +} + +.field { + margin: auto auto 1em auto; +} + +.field input { + box-shadow: 0.5em 0.5em 0.5em rgba(0, 0, 255, .2); +} + +.field input[type="text"], .field input[type="list"] { + margin: auto; + width: 10vw; + border-top: none; + border-left: none; + border-right: none; + border-bottom: 1px gray solid; +} + +.field label { + display: block; + text-align: center; +} + +#command-action { + display: flex; + justify-content: space-around; +} + +#add-command p, #remove-command p { + font-weight: bold; + font-size: 2em; + margin: auto auto 1em auto; +} + +.hide { + display: none; +} diff --git a/views/index.pug b/views/index.pug index 3d63b9a..3b66edd 100644 --- a/views/index.pug +++ b/views/index.pug @@ -1,5 +1,47 @@ extends layout block content - h1= title - p Welcome to #{title} + div.card + h1= title + p Welcome to Sandwiches Order Doua + form#command(action="/command" method="POST") + div.field + label(for="department") Department: + input#department(type="list" list="department-list" name="department" required) + datalist#department-list + option(value="Info") + option(value="Bio") + option(value="Chimi") + option(value="GC") + option(value="GEA") + + div.field + label(for="firstname") First name: + input#firstname(type="text" name="firstname" required) + div.field + label(for="lastname") Last name: + input#lastname(type="text" name="lastname" required) + + div#command1.command + h2 Command 1 + div.field + label(for="sandwich") Sandwich: + input#sandwich(type="list" list="sandwich-list" name="sandwich1" required) + div.field + label(for="day") Day: + input#day(type="list" list="date-list" name="date1" required) + + div#command-action + a#add-command + p + + a#remove-command.hide + p - + + div.field + input#send(type="submit" value="Pay") + + datalist#sandwich-list + option(value="Jambon beurre") + datalist#date-list + option(value="14/08/2020") + script(src="javascripts/index.js")