Skip to content

Commit

Permalink
use css transitions instead of js (#4055)
Browse files Browse the repository at this point in the history
  • Loading branch information
nworr authored Jan 23, 2024
1 parent 4ab5206 commit 1b302d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
14 changes: 0 additions & 14 deletions assets/src/legacy/view.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
var addDescriptionSlider = function(){
$('.liz-project-img').parent().mouseenter(function(){
var self = $(this);
self.find('.liz-project-desc').slideDown();
}).mouseleave(function(){
var self = $(this);
self.find('.liz-project-desc').hide();
}).click(function(){
var self = $(this);
window.location = self.parent().find('a.liz-project-view').attr('href');
return false;
});
}

var searchProjects = function(){
// Hide search if there are no projects
Expand Down Expand Up @@ -287,6 +274,5 @@ var searchProjects = function(){
}

window.addEventListener('load', function () {
addDescriptionSlider();
searchProjects();
});
6 changes: 4 additions & 2 deletions lizmap/modules/view/templates/view.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
<a name="link-projet-{$idm}"></a>
<div class="thumbnail">
<div class="liz-project">
<img width="250" height="250" loading="lazy" src="{$p->img}" alt="project image" class="liz-project-img">
<p class="liz-project-desc" style="display:none;">
<a href="{$p->url}{if $hide_header}&h=0{/if}">
<img width="250" height="250" loading="lazy" src="{$p->img}" alt="project image" class="_liz-project-img">
<p class="liz-project-desc" >
<b class="title">{$p->title}</b>
<br/>
<br/><b>{@default.project.abstract.label@}</b>&nbsp;: <span class="abstract">{$p->abstract|strip_tags|truncate:100}</span>
Expand All @@ -25,6 +26,7 @@
<br/><b>{@default.project.projection.label@}</b>&nbsp;: <span class="proj">{$p->proj}</span>
<br/><b>{@default.project.bbox.label@}</b>&nbsp;: <span class="bbox">{$p->bbox}</span>
</p>
</a>
</div>
<h5 class="liz-project-title">{$p->title}</h5>
<p>
Expand Down
13 changes: 10 additions & 3 deletions lizmap/www/assets/css/view.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,26 @@
}
.liz-project-desc {
color: white;
font-size: 0.8em;
line-height: 0.8em;
font-size: 0em;
line-height: 0em;
position: absolute;
bottom:-1px;
right:0px;
left:0px;
text-align: left;
text-transform: none;
background-color: rgba(0, 0, 0, 0.5);
padding:5px;
padding:0px;
margin:0px;
overflow-wrap: break-word;
}
.liz-project:hover .liz-project-desc {
line-height: 0.8em;
transition: line-height 300ms ease-in;
padding:5px;
font-size: 0.8em;
}


.liz-project-title{
overflow-wrap: anywhere;
Expand Down

4 comments on commit 1b302d4

@3liz-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest weekly run of end2end "playwright" tests failed with this latest commit on the branch release_3_7 😣

CC @nboisteault and @Gustry, please have a look to the logs. Maybe it's a false positive ?

Visit https://github.com/3liz/lizmap-web-client/actions/runs/7641820552

@3liz-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest weekly run of end2end "cypress" tests failed with this latest commit on the branch release_3_7 😣

CC @nboisteault and @Gustry, please have a look to the logs. Maybe it's a false positive ?

Visit https://github.com/3liz/lizmap-web-client/actions/runs/7641820552

@3liz-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest weekly run of end2end "playwright" tests failed with this latest commit on the branch release_3_6 😣

CC @nboisteault and @Gustry, please have a look to the logs. Maybe it's a false positive ?

Visit https://github.com/3liz/lizmap-web-client/actions/runs/7641820665

@3liz-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest weekly run of end2end "cypress" tests failed with this latest commit on the branch master 😣

CC @nboisteault and @Gustry, please have a look to the logs. Maybe it's a false positive ?

Visit https://github.com/3liz/lizmap-web-client/actions/runs/7641820503

Please sign in to comment.