From 09ab991fbb6a974628f39655786eca00fb8d7e44 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 26 Dec 2018 15:04:23 -0700 Subject: [PATCH] Fix #8 --- lib/Note.lib.php | 18 ++++++++++++++++++ pages/home.php | 3 +++ static/css/home.css | 1 - 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/Note.lib.php b/lib/Note.lib.php index 2a4f554..a35366e 100644 --- a/lib/Note.lib.php +++ b/lib/Note.lib.php @@ -244,6 +244,24 @@ class Note { } } + /** + * Get the color that grayed-out text should be, for when we can't calculate + * CSS opacity or something. + * + * @return string + */ + public function getGrayColor(): string { + $text = $this->getTextColor(); + + if ($text == 'FFFFFF') { + return 'C0C0C0'; + } else if ($text = '000000') { + return '808080'; + } else { + return 'A9A9A9'; + } + } + /** * Set the note content * @param string $markdown diff --git a/pages/home.php b/pages/home.php index 5680bf4..26354ca 100644 --- a/pages/home.php +++ b/pages/home.php @@ -55,6 +55,9 @@ foreach ($notes as $note) { echo "#notecard_" . $note->getID() . " .card-footer a {\n" . " color: #" . $note->getTextColor() . ";\n" . "}\n"; + echo "#notecard_" . $note->getID() . " .parsedown-task-list-close {\n" + . " color: #" . $note->getGrayColor() . ";\n" + . "}\n"; } foreach ($colors as $c) { diff --git a/static/css/home.css b/static/css/home.css index c359b3c..9a44e79 100644 --- a/static/css/home.css +++ b/static/css/home.css @@ -38,5 +38,4 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. .parsedown-task-list-close { text-decoration: line-through; - opacity: 0.5; } \ No newline at end of file