From a0cd7149338d3b7d7b113504c96da21e24662184 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Tue, 12 Feb 2019 09:51:13 -0700 Subject: [PATCH] Add a glow to taken styled books --- public/css/styles.css | 5 +++++ public/js/little-library.js | 11 ++++++++--- templates/elements/book.html | 4 ---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/public/css/styles.css b/public/css/styles.css index ff586ec..68bbf90 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -57,6 +57,11 @@ margin-top: -20%; z-index: 2; } +.book .spine.is-success { + -webkit-box-shadow: inset 0px 0px 99px 10px rgba(230,252,106,1); + -moz-box-shadow: inset 0px 0px 99px 10px rgba(230,252,106,1); + box-shadow: inset 0px 0px 99px 10px rgba(230,252,106,1); +} .spine .text-container { width: 260px; diff --git a/public/js/little-library.js b/public/js/little-library.js index c4c0566..e6ae59d 100644 --- a/public/js/little-library.js +++ b/public/js/little-library.js @@ -51,9 +51,14 @@ $(document).ready(function() { $('.take-book').click(function() { var id = $(this).data('book'); - $('#book_' + id).find('.box') - .removeClass('box').addClass(['notification', 'is-success']) - .attr('title', 'This can be downloaded until you leave this page'); + var book = $('#book_' + id).find('.spine'); + if (book) { + book.addClass('is-success'); + } else { + book = $('#book_' + id).find('.box'); + book.removeClass('box').addClass(['notification', 'is-success']) + } + book.attr('title', 'This can be downloaded until you leave this page'); socket.emit('take book', id); downloadButton = this; $(this).addClass('is-loading'); diff --git a/templates/elements/book.html b/templates/elements/book.html index f670dfc..cf7826d 100644 --- a/templates/elements/book.html +++ b/templates/elements/book.html @@ -5,10 +5,6 @@

{{title}}

{{author}}

-