Add colors to threading in article display.

This commit is contained in:
Retro_Guy 2024-11-10 04:49:23 -07:00
parent 6812a1d5ed
commit d72ef00ec8
7 changed files with 156 additions and 22 deletions

View File

@ -19,4 +19,21 @@
--color-border: #828282;
--color-row-border: #0000A5;
/* Quote levels when displaying posts */
--color-quote-level-0: #D0BDBD;
--color-quote-level-1: #6495ed;
--color-quote-level-2: #df73ff;
--color-quote-level-3: #778899;
--color-quote-level-4: #daa520;
--color-quote-level-5: #9932cc;
--color-quote-level-6: #648c11;
--color-quote-level-7: #009698;
--color-quote-level-8: #9c7c38;
/* Message count display */
--color-message-age-1: red;
--color-message-age-2: darkgoldenrod;
--color-message-age-3: green;
--color-message-age-old: #0C090A;
}

View File

@ -17,6 +17,20 @@
--color-link: #00B0DF;
--color-visited: #6688BB;
--color-border: #828282;
--color-row-border: black;
/* Quote levels when displaying posts */
--color-quote-level-0: #D0BDBD;
--color-quote-level-1: #6495ed;
--color-quote-level-2: #df73ff;
--color-quote-level-3: #778899;
--color-quote-level-4: #daa520;
--color-quote-level-5: #9932cc;
--color-quote-level-6: #648c11;
--color-quote-level-7: #009698;
--color-quote-level-8: #9c7c38;
/* Message count display */
--color-message-age-1: red;
--color-message-age-2: darkgoldenrod;
--color-message-age-3: green;
--color-message-age-old: #0C090A;
}

View File

@ -19,4 +19,21 @@
--color-border: #F5F7FA;
--color-row-border: #4C5D77;
/* Quote levels when displaying posts */
--color-quote-level-0: #0C090A;
--color-quote-level-1: #7070ff;
--color-quote-level-2: #ff4500;
--color-quote-level-3: #555555;
--color-quote-level-4: #367588;
--color-quote-level-5: #9932cc;
--color-quote-level-6: #648c11;
--color-quote-level-7: #009698;
--color-quote-level-8: #9c7c38;
/* Message count display */
--color-message-age-1: red;
--color-message-age-2: darkgoldenrod;
--color-message-age-3: green;
--color-message-age-old: #0C090A;
}

View File

@ -19,4 +19,21 @@
--color-border: #828282;
--color-row-border: #663399;
/* Quote levels when displaying posts */
--color-quote-level-0: #0C090A;
--color-quote-level-1: #4169e1;
--color-quote-level-2: #cc5500;
--color-quote-level-3: #555555;
--color-quote-level-4: #367588;
--color-quote-level-5: #9932cc;
--color-quote-level-6: #648c11;
--color-quote-level-7: #009698;
--color-quote-level-8: #9c7c38;
/* Message count display */
--color-message-age-1: red;
--color-message-age-2: darkgoldenrod;
--color-message-age-3: green;
--color-message-age-old: #0C090A;
}

View File

@ -19,4 +19,21 @@
--color-border: #828282;
--color-row-border: #8D918D;
/* Quote levels when displaying posts */
--color-quote-level-0: black;
--color-quote-level-1: #0000cd;
--color-quote-level-2: #a52a2a;
--color-quote-level-3: #65000b;
--color-quote-level-4: #004953;
--color-quote-level-5: #9932cc;
--color-quote-level-6: #4b5320;
--color-quote-level-7: #003399;
--color-quote-level-8: #654321;
/* Message count display */
--color-message-age-1: red;
--color-message-age-2: darkgoldenrod;
--color-message-age-3: green;
--color-message-age-old: #0C090A;
}

View File

@ -553,29 +553,29 @@ input[id^=trigger_headers]:checked+.display_headers_on {
color: var(--color-visited);
}
/* Article age colors. Set these at top of this file */
/* Message counts display change colors based on age */
.group_display_message_count_1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
color: red;
color: var(--color-message-age-1);
}
.group_display_message_count_2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
color: darkgoldenrod;
color: var(--color-message-age-2);
}
.group_display_message_count_3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
color: darkgreen;
color: var(--color-message-age-3);
}
.group_display_message_count_old {
font-family: Arial, Helvetica, sans-serif;
font-size: 0.9em;
color: var(--color-text);
color: var(--color-message-age-old);
}
div.ellipsis {
@ -1176,6 +1176,42 @@ blockquote.np_article_quote {
margin: 0px;
}
.quote_level_0 {
color: var(--color-quote-level-0);
}
.quote_level_1 {
color: var(--color-quote-level-1);
}
.quote_level_2 {
color: var(--color-quote-level-2);
}
.quote_level_3 {
color: var(--color-quote-level-3);
}
.quote_level_4 {
color: var(--color-quote-level-4);
}
.quote_level_5 {
color: var(--color-quote-level-5);
}
.quote_level_6 {
color: var(--color-quote-level-6);
}
.quote_level_7 {
color: var(--color-quote-level-7);
}
.quote_level_8 {
color: var(--color-quote-level-8);
}
/* =========== Post layout =========== */
/* headline */

View File

@ -1184,10 +1184,6 @@ function display_links_in_body($text)
global $config_dir;
preg_match_all('/(https?|ftp|scp|news|gopher|gemini|telnet):\/\/[a-zA-Z0-9.?%=\-\+\;\:\,\~\@\!\(\)\$\#&_\/]+/', $text, $matches);
$isquote = false;
if (strpos($text, ">") == 0) {
$isquote = true;
echo '<blockquote class="np_article_quote">';
}
foreach ($matches[0] as $match) {
if (! $match) {
continue;
@ -1202,9 +1198,29 @@ function display_links_in_body($text)
$text = preg_replace($pattern, '<a href="' . $linkurl . '" rel="nofollow" target="_blank">' . $url . '</a>', $text, 1);
}
$text = rewrite_body($text);
echo $text;
if ($isquote) {
echo '</blockquote>';
$vlad = explode('<br>', $text);
foreach ($vlad as $line) {
$line = preg_replace("/<\/?p>/", "", $line);
$line = preg_replace("/\&gt;/", ">", $line);
$line = trim($line);
$depth = 0;
for ($i = 0; $i < strlen($line); $i++) {
if ($line[$i] == ' ') {
continue;
}
if ($line[$i] == '>') {
$depth++;
continue;
}
break;
}
if ($depth < 9) {
echo '<span class="quote_level_' . $depth . '">';
} else {
echo '<span class="quote_level_' . $depth - 7 . '">';
}
echo $line . '</span><br>';
}
}