From dbdd257c5223dbe4be08fefcb8d39386d9ec2700 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Fri, 26 Feb 2016 19:52:14 +0100 Subject: [PATCH] add caption on exposure theme --- .../templates/sections/bordered-picture.html | 2 +- .../templates/sections/pictures-group.html | 2 +- .../themes/material/static/css/styles.css | 41 +++++++++++++++++++ .../themes/material/templates/index.html | 2 +- .../templates/sections/bordered-picture.html | 17 ++++---- .../templates/sections/full-picture.html | 3 +- .../templates/sections/pictures-group.html | 15 +++---- 7 files changed, 61 insertions(+), 21 deletions(-) diff --git a/prosopopee/themes/exposure/templates/sections/bordered-picture.html b/prosopopee/themes/exposure/templates/sections/bordered-picture.html index a721190..a5f0cf8 100644 --- a/prosopopee/themes/exposure/templates/sections/bordered-picture.html +++ b/prosopopee/themes/exposure/templates/sections/bordered-picture.html @@ -3,7 +3,7 @@ {{ image.copy()}}
- + {% if caption %}
diff --git a/prosopopee/themes/exposure/templates/sections/pictures-group.html b/prosopopee/themes/exposure/templates/sections/pictures-group.html index 5e233bd..6f78714 100644 --- a/prosopopee/themes/exposure/templates/sections/pictures-group.html +++ b/prosopopee/themes/exposure/templates/sections/pictures-group.html @@ -6,7 +6,7 @@ {% set image = Image(image) %} {{ image.copy() }}
- + {% if caption %}
diff --git a/prosopopee/themes/material/static/css/styles.css b/prosopopee/themes/material/static/css/styles.css index 1920adf..0baaed5 100644 --- a/prosopopee/themes/material/static/css/styles.css +++ b/prosopopee/themes/material/static/css/styles.css @@ -31,3 +31,44 @@ main { text-align: center; width: 100%; } + +.caption { + position: relative; + overflow: hidden; +} + +.caption__media { + display: block; + min-width: 100%; + max-width: 100%; + height: auto; +} + + +.caption__overlay { + background-color: rgba(0, 0, 0, .4); + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + color: white; + transform: translateY(101%); + transition: transform .35s ease-out; +} + +.caption:hover .caption__overlay { + transform: translateY(0); +} + +.bordered-picture .caption__overlay { + margin-left: 11.5%; + margin-right: 11.5%; +} + +.caption .card-panel { + margin: 0; + padding: 1px; + text-align: center; +} + diff --git a/prosopopee/themes/material/templates/index.html b/prosopopee/themes/material/templates/index.html index ca50a93..b34d361 100644 --- a/prosopopee/themes/material/templates/index.html +++ b/prosopopee/themes/material/templates/index.html @@ -25,7 +25,7 @@
{% set cover = Image(gallery.cover) %} {{ cover.copy() }} - + {{ gallery.title }}
diff --git a/prosopopee/themes/material/templates/sections/bordered-picture.html b/prosopopee/themes/material/templates/sections/bordered-picture.html index a93c129..7971de1 100644 --- a/prosopopee/themes/material/templates/sections/bordered-picture.html +++ b/prosopopee/themes/material/templates/sections/bordered-picture.html @@ -1,14 +1,13 @@ -
+ -
- {% set image = Image(section.image) %} - {{ image.copy()}} - - + {% if caption %} +
+
{{ caption }}
+
+ {% endif %}
diff --git a/prosopopee/themes/material/templates/sections/full-picture.html b/prosopopee/themes/material/templates/sections/full-picture.html index 33fc8bf..f20537b 100644 --- a/prosopopee/themes/material/templates/sections/full-picture.html +++ b/prosopopee/themes/material/templates/sections/full-picture.html @@ -1,8 +1,7 @@ {% set image = Image(section.image) %} {{ image.copy() }}
-
-
+
{% if section.text %}

{{ section.text.title }}

diff --git a/prosopopee/themes/material/templates/sections/pictures-group.html b/prosopopee/themes/material/templates/sections/pictures-group.html index 60a9fb0..e515099 100644 --- a/prosopopee/themes/material/templates/sections/pictures-group.html +++ b/prosopopee/themes/material/templates/sections/pictures-group.html @@ -2,19 +2,20 @@
{% for line in section.images %} {% for image in line %} + {% set caption = image.text %} {% set image = Image(image) %} {{ image.copy() }} {% set plop = 12 // loop.length %}