-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage_header.html
44 lines (39 loc) · 1.29 KB
/
image_header.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
{% load wagtailcore_tags wagtailimages_tags %}
{% if self.large %}
{% image value.image fill-1000x500 as image %}
{% image value.cover fill-1000x500 as cover %}
{% else %}
{% image value.image fill-1000x200 as image %}
{% image value.cover fill-1000x200 as cover %}
{% endif %}
<style>
.image-header{
display:flex;
align-items: {% if value.large%}flex-end{% else %}center{% endif %};
color:white;
margin-bottom: 3rem;
{% if value.large %}
min-height:500px;
{% else%}
min-height:200px;
{% endif%}
background-size:cover !important;
}
.image-header .title{
padding: 15px 20px 0;
width: 700px;
font-size: 1.3rem;
margin: 0 auto;
}
.image-header .title.large{
margin-bottom: 5rem;
}
</style>
<section class="image-header"
style="{%if value.title%} background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url({% if image %}{{image.url}}{% else %}{{cover.url}}{%endif%});{%else%}background:url({% if image %}{{image.url}}{% else %}{{cover.url}}{%endif%});{%endif%} {{ image.background_position_style }}">
{% if value.title %}
<div class="title {% if value.large %}large{%endif%}">
<h1>{{value.title}}</h1>
</div>
{% endif %}
</section>