mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[enh] oscar: image thumbnail layout
Adjust thumbnail sizes to fill the container width
This commit is contained in:
parent
ba90c5a2e0
commit
7a0fbdecc4
25 changed files with 513 additions and 230 deletions
|
|
@ -17,6 +17,9 @@
|
|||
window.searx = (function(d) {
|
||||
'use strict';
|
||||
|
||||
//
|
||||
d.getElementsByTagName("html")[0].className = "js";
|
||||
|
||||
// add data- properties
|
||||
var script = d.currentScript || (function() {
|
||||
var scripts = d.getElementsByTagName('script');
|
||||
|
|
|
|||
|
|
@ -108,4 +108,10 @@ $(document).ready(function(){
|
|||
tabs.children().attr("aria-selected", "false");
|
||||
$(a.target).parent().attr("aria-selected", "true");
|
||||
});
|
||||
|
||||
/**
|
||||
* Layout images according to their sizes
|
||||
*/
|
||||
searx.image_thumbnail_layout = new searx.ImageLayout('#main_results', '#main_results .result-images', 'img.img-thumbnail', 15, 200);
|
||||
searx.image_thumbnail_layout.watch();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -77,12 +77,39 @@
|
|||
// image formating of results
|
||||
.result-images {
|
||||
float: left !important;
|
||||
width: 24%;
|
||||
margin: .5%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
a {
|
||||
display: block;
|
||||
width: 100%;
|
||||
background-size: cover;
|
||||
.img-thumbnail {
|
||||
border: none !important;
|
||||
padding: 0;
|
||||
}
|
||||
&:hover, &:focus {
|
||||
outline: 0;
|
||||
.img-thumbnail {
|
||||
box-shadow: 5px 5px 15px 0px black;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.result-images.js a .img-thumbnail {
|
||||
max-height: inherit;
|
||||
min-height: inherit;
|
||||
}
|
||||
|
||||
.result-images:not(.js) {
|
||||
width: 25%;
|
||||
padding: 3px 13px 13px 3px;
|
||||
a {
|
||||
.img-thumbnail {
|
||||
margin: 0;
|
||||
max-height: 128px;
|
||||
min-height: 128px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue