diff --git a/www/css/notecards.css b/www/css/notecards.css index 23c0e00..9449de1 100644 --- a/www/css/notecards.css +++ b/www/css/notecards.css @@ -69,6 +69,19 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. min-height: 4em; } +.notecard[data-favorite="1"] { + background-repeat: no-repeat; + background-size: 3em; + background-position: 1em 1em; +} + +.notecard[data-favorite="1"][data-fg="FFFFFF"] { + background-image: url(../img/starbg_dark.svg); +} +.notecard[data-favorite="1"][data-fg="000000"] { + background-image: url(../img/starbg_light.svg); +} + .popover .list .list-button { color: inherit; } \ No newline at end of file diff --git a/www/img/favorite_bg.svg b/www/img/favorite_bg.svg new file mode 100644 index 0000000..e79feca --- /dev/null +++ b/www/img/favorite_bg.svg @@ -0,0 +1,58 @@ + + diff --git a/www/img/starbg_dark.svg b/www/img/starbg_dark.svg new file mode 100644 index 0000000..5068f66 --- /dev/null +++ b/www/img/starbg_dark.svg @@ -0,0 +1,59 @@ + + diff --git a/www/img/starbg_light.svg b/www/img/starbg_light.svg new file mode 100644 index 0000000..917650d --- /dev/null +++ b/www/img/starbg_light.svg @@ -0,0 +1,59 @@ + + diff --git a/www/js/home.js b/www/js/home.js index 53bc858..7036305 100644 --- a/www/js/home.js +++ b/www/js/home.js @@ -21,8 +21,8 @@ function loadCards(callback) { $(".notecard-col").remove(); for (n in notes) { var note = notes[n]; - $("#notecards-bin").append('
' - + '
' + $("#notecards-bin").append('
' + + '
' + '
' + 'edit' + '
' @@ -35,6 +35,12 @@ function loadCards(callback) { } var noteElements = document.getElementsByClassName("notecard-col"); window.shuffleInstance.add(noteElements); + window.shuffleInstance.sort({ + reverse: true, + by: function (el) { + return el.getAttribute("data-favorite"); + } + }); if (typeof callback == 'function') { callback(); } @@ -121,6 +127,8 @@ $("#app").on("click", "#colorpicker .colorpicker-color", function () { NOTES.set(note2); $("#notecard-" + noteid).data("bg", note2.color); $("#notecard-" + noteid).data("fg", note2.textcolor); + $("#notecard-" + noteid).attr("data-bg", note2.color); + $("#notecard-" + noteid).attr("data-fg", note2.textcolor); // For CSS starbg $("#notecard-" + noteid).css("background-color", "#" + note2.color); $("#notecard-" + noteid).css("color", "#" + note2.textcolor); }); diff --git a/www/pages/home.html b/www/pages/home.html index 57995b2..c4e696c 100644 --- a/www/pages/home.html +++ b/www/pages/home.html @@ -39,8 +39,8 @@
{{/if}} {{#each notecards}} -
-
+
+
edit