summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/css/site.css110
-rw-r--r--public/fonts/ComicMono-Bold.ttfbin0 -> 20516 bytes
-rw-r--r--public/fonts/ComicMono.ttfbin0 -> 18724 bytes
-rw-r--r--public/images/favicon.pngbin0 -> 190 bytes
-rw-r--r--src/templates/confirm_deletion.php19
-rw-r--r--src/templates/create.php17
-rw-r--r--src/templates/edit.php19
-rw-r--r--src/templates/form_fields.php6
-rw-r--r--src/templates/index.php25
9 files changed, 168 insertions, 28 deletions
diff --git a/public/css/site.css b/public/css/site.css
new file mode 100644
index 0000000..6204f7b
--- /dev/null
+++ b/public/css/site.css
@@ -0,0 +1,110 @@
+/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
+*,::after,::before{box-sizing:border-box}html{-moz-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji'}hr{height:0;color:inherit}abbr[title]{text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,'Liberation Mono',Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}
+.hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0}.hljs,.hljs-subst{color:#444}.hljs-comment{color:#888}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#bc6060}.hljs-literal{color:#78a960}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
+
+@font-face {
+ font-family: 'comicsans';
+ src: url('/fonts/ComicMono.ttf') format('truetype'),
+ url("/fonts/ComicMono.ttf") format("truetype");
+}
+
+body {
+ background-color: #1a202c;
+ font-family: "comicsans", monospace;
+ color: #ffffff;
+ font-size: 1.125rem;
+ line-height: 1.75rem;
+}
+
+h1,
+h2,
+label {
+ font-weight: bold;
+ font-size: 1.125rem;
+}
+
+h1 {
+ color: #BEF264;
+ text-align: center;
+ width: 100%;
+}
+
+h2 {
+ color: #FCD34D;
+}
+
+h2:before {
+ content: "## ";
+}
+
+section {
+ padding: 1rem;
+}
+
+a {
+ color: #93C5FD;
+ text-decoration: none;
+}
+
+a:hover {
+ color: #3730A3;
+}
+
+a:before {
+ content: "=> ";
+}
+
+a.no-decoration:before {
+ content: "";
+}
+
+ol {
+ list-style-type: none;
+ padding: 0;
+}
+
+label {
+ display: block;
+ color: #86EFAC;
+ margin-top: 1rem;
+}
+
+input,
+button {
+ border-radius: .25rem;
+ display: block;
+ width: 100%;
+}
+
+input {
+ border: 2px solid #FFFFFF;
+ padding: .375rem .75rem;
+}
+
+button {
+ background-color: #86EFAC;
+ border: 1px solid transparent;
+ cursor: pointer;
+ font-weight: 400;
+ line-height: 1.5;
+ margin-top: 1rem;
+ padding: .375rem .75rem;
+ text-align: center;
+ vertical-align: middle;
+}
+
+.message {
+ background-color: #93C5FD;
+ border-radius: .25rem;
+ border: 1px solid transparent;
+ color: #000000;
+ padding: .375rem .75rem;
+ text-align: center;
+}
+
+@media (min-width: 1536px) {
+ section {
+ width: 80%;
+ margin: auto;
+ }
+}
diff --git a/public/fonts/ComicMono-Bold.ttf b/public/fonts/ComicMono-Bold.ttf
new file mode 100644
index 0000000..e03f41e
--- /dev/null
+++ b/public/fonts/ComicMono-Bold.ttf
Binary files differ
diff --git a/public/fonts/ComicMono.ttf b/public/fonts/ComicMono.ttf
new file mode 100644
index 0000000..9bc7354
--- /dev/null
+++ b/public/fonts/ComicMono.ttf
Binary files differ
diff --git a/public/images/favicon.png b/public/images/favicon.png
new file mode 100644
index 0000000..4909792
--- /dev/null
+++ b/public/images/favicon.png
Binary files differ
diff --git a/src/templates/confirm_deletion.php b/src/templates/confirm_deletion.php
index 06e133f..12c5cd1 100644
--- a/src/templates/confirm_deletion.php
+++ b/src/templates/confirm_deletion.php
@@ -4,13 +4,20 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Confirm - Bookmarks</title>
+ <link rel="shortcut icon" href="/images/favicon.png">
+ <link rel="stylesheet" href="/css/site.css">
</head>
<body>
- <a href="/">Back</a>
- <form action="/delete" method="POST">
- <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/>
- <?php echo htmlentities($bookmark->url.' '.$bookmark->title.' '.$bookmark->tag); ?>
- <button type="submit">Delete</button>
- </form>
+ <section>
+ <h1>Bookmarks</h1>
+ <h2>Confirm Deletion</h2>
+ <a href="/">Back</a>
+ <form action="/delete" method="POST">
+ <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/>
+ <?php echo htmlentities("$bookmark->url | $bookmark->title | $bookmark->tag"); ?>
+ <button type="submit">Delete</button>
+ </form>
+ <p>Copyright © 2021 David T. Sadler.</p>
+ </section>
</body>
</html>
diff --git a/src/templates/create.php b/src/templates/create.php
index 37004ff..21df9a8 100644
--- a/src/templates/create.php
+++ b/src/templates/create.php
@@ -4,12 +4,19 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Add - Bookmarks</title>
+ <link rel="shortcut icon" href="/images/favicon.png">
+ <link rel="stylesheet" href="/css/site.css">
</head>
<body>
- <a href="/">Back</a>
- <form action="/store" method="POST">
- <?php require_once('form_fields.php'); ?>
- <button type="submit">Add</button>
- </form>
+ <section>
+ <h1>Bookmarks</h1>
+ <h2>Add</h2>
+ <a href="/">Back</a>
+ <form action="/store" method="POST">
+ <?php require_once('form_fields.php'); ?>
+ <button type="submit">Add</button>
+ </form>
+ <p>Copyright © 2021 David T. Sadler.</p>
+ </section>
</body>
</html>
diff --git a/src/templates/edit.php b/src/templates/edit.php
index b462e7e..100cd0e 100644
--- a/src/templates/edit.php
+++ b/src/templates/edit.php
@@ -4,13 +4,20 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Edit - Bookmarks</title>
+ <link rel="shortcut icon" href="/images/favicon.png">
+ <link rel="stylesheet" href="/css/site.css">
</head>
<body>
- <a href="/">Back</a>
- <form action="/update" method="POST">
- <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/>
- <?php require_once('form_fields.php'); ?>
- <button type="submit">Update</button>
- </form>
+ <section>
+ <h1>Bookmarks</h1>
+ <h2>Edit</h2>
+ <a href="/">Back</a>
+ <form action="/update" method="POST">
+ <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/>
+ <?php require_once('form_fields.php'); ?>
+ <button type="submit">Update</button>
+ </form>
+ <p>Copyright © 2021 David T. Sadler.</p>
+ </section>
</body>
</html>
diff --git a/src/templates/form_fields.php b/src/templates/form_fields.php
index 3f54040..3005ee8 100644
--- a/src/templates/form_fields.php
+++ b/src/templates/form_fields.php
@@ -1,12 +1,12 @@
-<input type="text" name="url" maxlength="512" value="<?php echo htmlspecialchars($old->get('url', $bookmark->url)); ?>" autofocus><br>
+<label>URL<input type="text" name="url" maxlength="512" value="<?php echo htmlspecialchars($old->get('url', $bookmark->url)); ?>" autofocus></label>
<?php if ($errors->has('url')) { ?>
<p><?php echo implode(', ', $errors->get('url')); ?></p>
<?php } ?>
-<input type="text" name="title" maxlength="256" value="<?php echo htmlspecialchars($old->get('title', $bookmark->title)); ?>"><br>
+<label>Title<input type="text" name="title" maxlength="256" value="<?php echo htmlspecialchars($old->get('title', $bookmark->title)); ?>"></label>
<?php if ($errors->has('title')) { ?>
<p><?php echo implode(', ', $errors->get('title')); ?></p>
<?php } ?>
-<input type="text" name="tag" maxlength="8" value="<?php echo htmlspecialchars($old->get('tag', $bookmark->tag)); ?>"><br>
+<label>Tag<input type="text" name="tag" maxlength="8" value="<?php echo htmlspecialchars($old->get('tag', $bookmark->tag)); ?>"></label>
<?php if ($errors->has('tag')) { ?>
<p><?php echo implode(', ', $errors->get('tag')); ?></p>
<?php } ?>
diff --git a/src/templates/index.php b/src/templates/index.php
index 4f76614..c046e6c 100644
--- a/src/templates/index.php
+++ b/src/templates/index.php
@@ -4,16 +4,25 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bookmarks</title>
+ <link rel="shortcut icon" href="/images/favicon.png">
+ <link rel="stylesheet" href="/css/site.css">
</head>
<body>
- <?php if ($message) { ?>
- <p><?php echo $message; ?></p>
- <?php } ?>
- <a href="/create">Add</a>
- <ul>
- <?php foreach ($bookmarks as $bookmark) { ?>
- <li><a href="<?php echo htmlentities($bookmark->url); ?>"><?php echo $bookmark->title != '' ? htmlentities($bookmark->title) : htmlentities($bookmark->url); ?></a> <a href="/edit?id=<?php echo $bookmark->id; ?>">Edit</a> | <a href="/delete/confirm?id=<?php echo $bookmark->id; ?>">Delete</a></li>
+ <section>
+ <h1>Bookmarks</h1>
+ <?php if ($message) { ?>
+ <p class="message"><?php echo $message; ?></p>
<?php } ?>
- </ul>
+ <a href="/create">Add Bookmark</a>
+ <h2>Tags</h2>
+ <a href="/">All</a>
+ <h2>Bookmarks</h2>
+ <ol>
+ <?php foreach ($bookmarks as $bookmark) { ?>
+ <li><a href="<?php echo htmlentities($bookmark->url); ?>"><?php echo (new DateTime($bookmark->addedAt))->format('Y-m-d'); ?> - <?php echo $bookmark->title != '' ? htmlentities($bookmark->title) : htmlentities($bookmark->url); ?></a> | <a class="no-decoration" href="/edit?id=<?php echo $bookmark->id; ?>">Edit</a> | <a class="no-decoration" href="/delete/confirm?id=<?php echo $bookmark->id; ?>">Delete</a></li>
+ <?php } ?>
+ </ol>
+ <p>Copyright © 2021 David T. Sadler.</p>
+ </section>
</body>
</html>