From b639cb180d0371742bf095529078dc7e6bd03b04 Mon Sep 17 00:00:00 2001 From: swag Date: Sat, 1 Jan 2022 21:39:04 -0500 Subject: [PATCH] Style makeover --- assets/css/swagg.css | 57 +++++++++++++++++++++++++------ guestbook-ng.pl | 4 +++ templates/index.html.ep | 42 +++++++++++------------ templates/layouts/default.html.ep | 25 +++++--------- templates/sign.html.ep | 2 +- 5 files changed, 80 insertions(+), 50 deletions(-) diff --git a/assets/css/swagg.css b/assets/css/swagg.css index 9e253aa..51967d8 100644 --- a/assets/css/swagg.css +++ b/assets/css/swagg.css @@ -7,22 +7,20 @@ body { background: #000; margin: 0em; color: #00FF00; - font: normal 16px/20px Courier, Courier New, monospace; + font-family: fantasy; } a { - color: #FFF; - text-decoration: underline; -} - -a:hover { - color: #EEE; + color: cyan; text-decoration: none; } -form { - cursor: auto; - /* text-align: center; */ +a:hover { + text-decoration: underline; +} + +a:active, a:visited { + color: violet; } td { @@ -88,9 +86,46 @@ img { margin-bottom: 1em; } +.articles { + displace: flex; + flex-flow: column; + margin-bottom: 1em; +} + +article { + border-style: ridge; + padding: 0em 1em; +} + +article .message.field { + font-family: cursive; + font-size: 1.35em; + margin-bottom: 0em; +} + +article h3 { + margin-bottom: 0em; +} + .captcha { display: grid; - grid-template-columns: 1fr 6fr; + grid-template-columns: 1fr 10fr; +} + +footer { + font-style: italic; + text-align: center; +} + +nav { + display: flex; + flex-flow: row wrap; + justify-content: center; + gap: 1em; +} + +h1#top { + text-align: center; } @media screen and (max-width: 1365px) { diff --git a/guestbook-ng.pl b/guestbook-ng.pl index 16cdaa4..1920b5d 100755 --- a/guestbook-ng.pl +++ b/guestbook-ng.pl @@ -71,6 +71,10 @@ any [qw{GET POST}], '/sign' => sub ($c) { $c->redirect_to('index'); } else { + # Try to randomize things for the CAPTCHA challenge. The + # string 'false' actually evaluates to true so this is an + # attempt to confuse a (hypothetical) bot that would try to + # select what it thinks is the right answer my @answers = shuffle(0, 'false', undef); my $right_answer_label = 'I\'m ready to sign (choose this one)'; my @wrong_answer_labels = shuffle( diff --git a/templates/index.html.ep b/templates/index.html.ep index f4fa721..bce9c4b 100644 --- a/templates/index.html.ep +++ b/templates/index.html.ep @@ -1,26 +1,24 @@ % layout 'default'; % title 'View';

Messages from the World Wide Web

- -<% for my $row (@$view_posts) { %> - - - - - - - - - - - - - - - - -<% } %> -
Date:<%= @$row[0] %>
Name:<%= @$row[1] %>
Message:<%= @$row[2] %>
  
-
+<% for my $row (@$view_posts) { =%> +
+
+

<%= @$row[0] %>

+
+

<%= @$row[2] %>

+
+
+
+ - <%= @$row[1] %> + <% if (@$row[3]) { =%> + (<%= link_to Homepage => @$row[3] %>) + <% } =%> +
+
+
+
+<% } =%> +
+ diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index b4f8684..48f4980 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -7,28 +7,21 @@
-
-

Guestbook-NG

- - - - - - - -
<%= link_to View => 'index' %> <%= link_to Sign => 'sign' %>
-
-
+

Guestbook-NG

+ + +
<%= content =%>
-
-

Maximize your dynamic innovation using battle-tested deep - learning models.

-
+

Maximize your dynamic innovation using battle-tested deep + learning models.

diff --git a/templates/sign.html.ep b/templates/sign.html.ep index f8a89cb..3bdd1ad 100644 --- a/templates/sign.html.ep +++ b/templates/sign.html.ep @@ -7,7 +7,7 @@ <%= input_tag 'name' %>
- <%= label_for url => 'Homepage URL (doesn\'t work yet 😩😭)' %> + <%= label_for url => 'Homepage URL' %> <%= input_tag 'url' %>