-
Notifications
You must be signed in to change notification settings - Fork 54
/
index.html
86 lines (82 loc) · 3.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{% extends "base.html" %}
{% block css %}
<link type="text/css" rel="stylesheet" href="static/css/fonts.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="static/css/style.css" media="screen,projection"/>
{% if settings.custom_css %}
<link type="text/css" rel="stylesheet" href="static/css/custom.css" media="screen,projection"/>
{% endif %}
{% endblock %}
{% block logo %}
{% if sub_index %}
<div class="back-to-home">
<hr>
<a href="../">
<div id="logo" src="static/img/logo.svg">
Back
</div>
</a>
</div>
{% else %}
<img id="logo" src="static/img/logo.svg"/>
{% endif %}
{% endblock %}
{% block content %}
<div class="galleries-grid">
{% for galleries_line in galleries|reverse|batch(3)|reverse %}
{% if loop.index is divisibleby 3 or loop.index is divisibleby 2 %}
{% set no_big_gallery_cover = true %}
{% endif %}
<div class="galleries-line covers-{{ galleries_line|length }}">
{% for gallery in galleries_line|reverse %}<!-- comment tricks against space between inline-block
--><div class="gallery-square">
<a href="{{ gallery.link }}">
<div class="gallery-title">
<h2>{{ gallery.title }}</h2>
{% if gallery.sub_title %}<h3>{{ gallery.sub_title }}</h3>{% endif %}
{% if settings.show_date and gallery.date %}<div class="gallery-datetime">{{ gallery.date.strftime("%d %B %Y") }}</div>{% endif %}
{% if gallery.tags %}<div class="gallery-tag">IN {% for tag in gallery.tags -%} <span> {{ tag }}</span> {% endfor -%}</div>{% endif %}
</div>
</a>
{% if gallery.cover_type == "video" %}
{% set video = Video(gallery.cover) %}
{{ video.copy() }}
<div class="gallery-cover">
<video autoplay loop muted class="fillWidth">
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
</video>
<img class="fillWidth" alt="" src="{{ video.generate_thumbnail("900") }}">
</div>
{% else %}
{% set cover = Image(gallery.cover) %}
{{ cover.copy() }}
{% if no_big_gallery_cover %}
<div class="gallery-cover" style="background-image: url('{{ cover.generate_thumbnail("x900") }}'), url('{{ cover.generate_thumbnail("x150") }}');"></div>
{% else %}
<div class="gallery-cover" style="background-image: url('{{ cover.generate_thumbnail("x1366") }}'), url('{{ cover.generate_thumbnail("x900") }}');"></div>
{% endif %}
{% endif %}
</div><!-- comment tricks against space between inline-block
-->{% endfor %}
</div>
{% endfor %}
</div>
<p style="visibility: hidden">.</p>
{% if settings.settings.night_mode %}
<script type="text/javascript" src="./static/js/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript">
if (localStorage.getItem("mode_night") == "true") {
$('body').addClass('night');
document.getElementById("toggle-box-checkbox").checked = true;
}
$('#toggle-box-checkbox').on('change', function(){
if(this.checked){
$('body').addClass('night');
localStorage.setItem("mode_night", true);
}else{
$('body').removeClass('night');
localStorage.setItem("mode_night", false);
}
});
</script>
{% endif %}
{% endblock %}