From 7027fdd87011962b2b177342a462d54737e03501 Mon Sep 17 00:00:00 2001 From: KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> Date: Wed, 18 Aug 2021 12:57:26 -0300 Subject: theme newpost at top of page --- static/css/themes/default.css | 28 +++++++++ static/css/themes/gruvbox.css | 35 ++++++++++++ static/js/posts.js | 21 ++----- static/nposts.html | 30 +++++----- static/top.html | 128 +++++++++++++++++++++++++++--------------- 5 files changed, 167 insertions(+), 75 deletions(-) diff --git a/static/css/themes/default.css b/static/css/themes/default.css index fa76b50..2df2921 100644 --- a/static/css/themes/default.css +++ b/static/css/themes/default.css @@ -83,3 +83,31 @@ a.reply { color: #000080; font-size: 0.8em; } + +#newpostbtn { + text-align: center; + margin-top: 80px; +} + +#postForm { + margin: auto; +} + +#postForm tr > td:first-child { + background-color: #98e; + border: 1px black; + padding-left: 0.5em; + padding-right: 0.5em; +} + +#postForm input[type="text"], +#postForm textarea { + box-sizing: border-box; + -webkit-box-sizing:border-box; + -moz-box-sizing: border-box; +} + +#postForm #captcha { + display: block; + width: 100%; +} diff --git a/static/css/themes/gruvbox.css b/static/css/themes/gruvbox.css index fb39ea4..a23d7f4 100644 --- a/static/css/themes/gruvbox.css +++ b/static/css/themes/gruvbox.css @@ -61,3 +61,38 @@ h1,h2,h3,h4,h5,h6 { color: #83a598; font-size: 0.8em; } + +#newpostbtn { + text-align: center; + margin-top: 80px; +} + +input[type="text"] { + -webkit-appearance: none; + -webkit-border-radius: 0; + +} + +#postForm { + border: 4px solid #928374; + background-color: #3c3836; + margin: auto; +} + +#postForm tr > td:first-child { + background-color: #504945; + padding-left: 0.5em; + padding-right: 0.5em; +} + +#postForm input[type="text"], +#postForm textarea { + box-sizing: border-box; + -webkit-box-sizing:border-box; + -moz-box-sizing: border-box; +} + +#postForm #captcha { + display: block; + width: 100%; +} diff --git a/static/js/posts.js b/static/js/posts.js index 455e7ea..75244fa 100644 --- a/static/js/posts.js +++ b/static/js/posts.js @@ -2,29 +2,16 @@ function startNewPost(){ var el = document.getElementById("newpostbtn"); el.style="display:none;"; el.setAttribute("state", "1"); - document.getElementById("newpost").style = "display: block;"; + document.getElementById("newpost").style = ""; + sessionStorage.setItem("newpostState", true); } function stopNewPost(){ var el = document.getElementById("newpostbtn"); el.style="display:block;"; el.setAttribute("state", "0"); - document.getElementById("newpost").style = "display: hidden;"; -} - -function newpost() -{ - var state = document.getElementById("newpostbtn").getAttribute("state"); - if(state === "0") - { - startNewPost(); - sessionStorage.setItem("newpostState", true); - } - else - { - stopNewPost(); - sessionStorage.setItem("newpostState", false); - } + document.getElementById("newpost").style = "display: none;"; + sessionStorage.setItem("newpostState", false); } function shortURL(actorName, url) diff --git a/static/nposts.html b/static/nposts.html index 6def8b2..46d8bb1 100644 --- a/static/nposts.html +++ b/static/nposts.html @@ -15,33 +15,35 @@ {{ define "content" }} {{ $board := .Board }}