aboutsummaryrefslogtreecommitdiff
path: root/templates/shortcodes/imagehover.html
blob: 350506c754735c18c51394a03949ebef9cbf9869 (plain)
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
{%- set_global bg = " " %}
{%- for source in sources %}
  {%- if not loop.first %}
    ## {{ source | safe }}
    <div id="hoverimage{{loop.index}}"> </div>
  {%- else %}
    {% set_global bg = source %}
  {%- endif %}
{%- endfor %}

<style>
  {%- for source in sources %}
    {%- if not loop.first %}
      #hoverimage{{loop.index}} {
        background-image: url('{{ get_url(path="/", trailing_slash=false) }}{{ page.path | safe }}{{ source | safe }}');
        width: 560px;
        height: 650px;
      }
      #hoverimage{{loop.index}}:hover {
        background-image: url('{{ get_url(path="/", trailing_slash=false) }}{{ page.path | safe }}{{ bg | safe }}');
        width: 560px;
        height: 650px;
      }
    {%- endif %}
  {%- endfor %}
</style>