From 1d8e5651dedf56470d10b94a0022942a91cde6cd Mon Sep 17 00:00:00 2001 From: KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> Date: Mon, 16 Aug 2021 15:56:41 -0300 Subject: devchan why the hell did you use style attributes --- client.go | 13 ++++------- static/archive.html | 2 +- static/css/gruvbox.css | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ static/css/style.css | 15 +++++++++++- static/posts.html | 6 ++--- static/top.html | 2 +- 6 files changed, 86 insertions(+), 15 deletions(-) create mode 100644 static/css/gruvbox.css diff --git a/client.go b/client.go index 85a327e..1be926a 100644 --- a/client.go +++ b/client.go @@ -216,7 +216,7 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co "parseReplyLink": func(actorId string, op string, id string, content string) template.HTML { actor := FingerActor(actorId) title := strings.ReplaceAll(ParseLinkTitle(actor.Id, op, content), `/\<`, ">") - link := ">>" + shortURL(actor.Outbox, id) + "" + link := ">>" + shortURL(actor.Outbox, id) + "" return template.HTML(link) }, "add": func(i, j int) int { @@ -403,7 +403,7 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB) { "parseReplyLink": func(actorId string, op string, id string, content string) template.HTML { actor := FingerActor(actorId) title := strings.ReplaceAll(ParseLinkTitle(actor.Id, op, content), `/\<`, ">") - link := ">>" + shortURL(actor.Outbox, id) + "" + link := ">>" + shortURL(actor.Outbox, id) + "" return template.HTML(link) }, "sub": func(i, j int) int { return i - j }}).ParseFiles("./static/main.html", "./static/npost.html", "./static/top.html", "./static/bottom.html", "./static/posts.html")) @@ -886,17 +886,12 @@ func ParseLinkComments(db *sql.DB, board Actor, op string, content string, threa } } - var style string - if board.Restricted { - style = "color: #af0a0f;" - } - //replace link with quote format replyID, isReply := IsReplyToOP(db, op, parsedLink) if isReply { id := shortURL(board.Outbox, replyID) - content = strings.Replace(content, match[i][0], ">>"+id+""+isOP+"", -1) + content = strings.Replace(content, match[i][0], ">>"+id+""+isOP+"", -1) } else { @@ -909,7 +904,7 @@ func ParseLinkComments(db *sql.DB, board Actor, op string, content string, threa } if actor.Id != "" { - content = strings.Replace(content, match[i][0], ">>"+shortURL(board.Outbox, parsedLink)+isOP+" →", -1) + content = strings.Replace(content, match[i][0], ">>"+shortURL(board.Outbox, parsedLink)+isOP+" →", -1) } } } diff --git a/static/archive.html b/static/archive.html index b08693a..3e040bc 100644 --- a/static/archive.html +++ b/static/archive.html @@ -20,7 +20,7 @@ {{ end }} {{ define "top" }} -

/{{ .Board.Name }}/ - {{ .Board.PrefName }}

+

/{{ .Board.Name }}/ - {{ .Board.PrefName }}

{{ .Board.Summary }}

Archived Posts

{{ end }} diff --git a/static/css/gruvbox.css b/static/css/gruvbox.css new file mode 100644 index 0000000..fb39ea4 --- /dev/null +++ b/static/css/gruvbox.css @@ -0,0 +1,63 @@ +a, a:link, a:visited, a:active { + color: #b16286; + text-decoration: none +} + +a.reply { + color: #cc241d; +} + +a:hover.reply { + color: #fb4934; +} + +body { + background: #282828; + color: #ebdbb2; + + font-family: Iosevka, monospace, sans-serif; + font-size: 0.9em; +} + +.popup-box { + border: 4px solid #928374; + background-color: #3c3836; +} + +.box, .box-alt { + background-color: #3c3836; +} + +.quote { + color: #98971a; +} + +.post { + background-color: #1d2021; +} + +:target > div > .post { + background-color: #504945; +} + +.subject { + color: #458588; +} + +.name { + color: #b8bb26; +} + +.tripcode { + color: #689d6a; +} + +h1,h2,h3,h4,h5,h6 { + color: #fb4934; + margin-bottom: 0.1em; +} + +.replyLink { + color: #83a598; + font-size: 0.8em; +} diff --git a/static/css/style.css b/static/css/style.css index bced2c1..fa76b50 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -67,6 +67,19 @@ body.nsfw { background-color: #f0c0b0; } -.tripcode { +.title { + color: #0f0c5d; +} + +.name, .tripcode { color: #117743; } + +a.reply { + color: #af0a0f; +} + +.replyLink { + color: #000080; + font-size: 0.8em; +} diff --git a/static/posts.html b/static/posts.html index 50d8b43..b9cac5e 100644 --- a/static/posts.html +++ b/static/posts.html @@ -45,7 +45,7 @@ } {{ end }} - {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} + {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }}

{{ parseContent $board.Actor $opId .Content $thread }}

{{ if .Replies }} {{ $replies := .Replies }} @@ -57,7 +57,7 @@ {{ range $replies.OrderedItems }}
-
>>
+
>>
{{ if eq $board.ModCred $board.Domain $board.Actor.Id }} [Delete Post] @@ -97,7 +97,7 @@ } {{ end }} - {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} + {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} {{ $parentId := .Id }} {{ if .Replies.OrderedItems }} {{ range .Replies.OrderedItems }} diff --git a/static/top.html b/static/top.html index 0081fc7..e37f221 100644 --- a/static/top.html +++ b/static/top.html @@ -1,6 +1,6 @@ {{ define "top" }}
-

/{{ .Board.Name }}/ - {{ .Board.PrefName }}

+

/{{ .Board.Name }}/ - {{ .Board.PrefName }}

{{ .Board.Summary }}

{{ $len := len .Posts }} {{ if eq $len 0 }} -- cgit v1.2.3