Use a new tinted book set on every page
[books.alexwlchan.net] / templates / _inline_book_list.html
1 {% for book_entry in all_books %}
2 {% set r = (tint_colors[book_entry.book.cover_image][0] * 255) | int %}
3 {% set g = (tint_colors[book_entry.book.cover_image][1] * 255) | int %}
4 {% set b = (tint_colors[book_entry.book.cover_image][2] * 255) | int %}
5
6 <style>
7   #reading_{{ r }}_{{ g }}_{{ b }} {
8     background: rgba({{ r }}, {{ g }}, {{ b }}, 0.05);
9     border-color: rgb({{ r }}, {{ g }}, {{ b }});
10   }
11
12   #reading_{{ r }}_{{ g }}_{{ b }} a {
13     color: rgb({{ r }}, {{ g }}, {{ b }});;
14   }
15
16   #reading_{{ r }}_{{ g }}_{{ b }} a:hover {
17     background: rgba({{ r }}, {{ g }}, {{ b }}, 0.3);
18   }
19 </style>
20
21 <div class="reading" id="reading_{{ r }}_{{ g }}_{{ b }}">
22   <div class="reading_inner">
23     <div class="book_thumbnail">
24       {% set book = book_entry.book %}
25       {% include "_book_cover.html" %}
26     </div>
27
28     <div class="book_metadata">
29       <p class="title">{{ book_entry.book.title | smartypants | safe }}</p>
30       <p>
31         <small>
32           by {{ book_entry.book.author }}
33           {%- if book_entry.book.publication_year %}
34             ({{ book_entry.book.publication_year}})
35           {%- endif -%}
36         </small>
37       </p>
38     </div>
39   </div>
40   {% if book_entry.plan.text %}
41   <div class="note">
42     {{ book_entry.plan.text | render_markdown | safe }}
43   </div>
44   {% endif %}
45 </div>
46 {% endfor %}