fix: frog images are now animated with the mouse cursor

This commit is contained in:
Adrien Allard 2024-06-11 17:07:32 +02:00
parent 5d63b5fc79
commit c1abcf273b
4 changed files with 7 additions and 4 deletions

View File

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -3,6 +3,7 @@
id, id,
title_picture, title_picture,
title_picture_hover = None, title_picture_hover = None,
title_picture_active = None,
title_picture_offset = "0px", title_picture_offset = "0px",
title_color = "var(--color-text)") title_color = "var(--color-text)")
-%} -%}
@ -14,6 +15,7 @@
color: {{ title_color }}; color: {{ title_color }};
--picture-url:url('{{ title_picture }}'); --picture-url:url('{{ title_picture }}');
--picture-hover-url:url('{{ title_picture_hover or title_picture }}'); --picture-hover-url:url('{{ title_picture_hover or title_picture }}');
--picture-active-url:url('{{ title_picture_active or title_picture }}');
--picture-offset: {{ title_picture_offset }}; --picture-offset: {{ title_picture_offset }};
" "
> >

View File

@ -18,16 +18,12 @@
} }
&--title { &--title {
z-index: -1;
background: transparent; background: transparent;
position: relative; position: relative;
margin-top: 110px; margin-top: 110px;
align-self: center; align-self: center;
&::before { &::before {
z-index: -1;
position: absolute; position: absolute;
top: -110px; top: -110px;
left: var(--picture-offset); left: var(--picture-offset);
@ -42,6 +38,10 @@
background-image: var(--picture-hover-url); background-image: var(--picture-hover-url);
} }
&:active::before {
background-image: var(--picture-active-url);
}
@media ($mobile-breakpoint) { @media ($mobile-breakpoint) {
margin-top: 70px; margin-top: 70px;

View File

@ -12,6 +12,7 @@
"collective", "collective",
"/img/section-collective.png", "/img/section-collective.png",
title_picture_hover = "/img/section-collective-hover.png", title_picture_hover = "/img/section-collective-hover.png",
title_picture_active = "/img/section-collective-active.png",
title_picture_offset = "170px" title_picture_offset = "170px"
) %} ) %}
<div class="presentation--content"> <div class="presentation--content">