JSFiddle - React, Tailwind, and code Playground
by Snj
HTML
<a href="javascript:void(0)" class="openbtn" onclick="openNav()">⍽</a>
<div id="myNav" class="overlay">
<div id="inputSlider">
<input type="range" id="range" min="50" max="500" value="155">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
</div>
<div class="myInfo"><b>::  </b><button class="checkButton">Run/Check</button><b>  ::</b></div>
<div class="overlay-content">
<div class="mycontainer">
</div>
</div>
</div>
CSS
:root {
--size: 155px;
--imgsize: 155;
}
.myInfo {
text-align: center;
margin-bottom: -1rem;
}
.myPagnat {
/*display: inline-flex;*/
}
.imgbox {
display: inline;
}
.imgcont {
width: inherit;
height: inherit;
background-size: contain;
background-repeat: no-repeat;
background-position: 50% 50%;
}
.mySpan {
display: inline-flex;
font-family: monospace;
font-weight: 800;
font-size: 1.2rem;
text-decoration: none;
text-shadow: -2px 2px 2px #0000008F;
}
.checkButton {
background: #6f6f6fab;
box-shadow: 0px 0px 6px #ffffffb0;
border-radius: 5px;
border: #313131 solid 1px;
font-size: large;
margin: 2em 0em 0em 0em;
}.checkButton:hover { box-shadow: 0px 0px 6px #8aff9fb0; cursor: pointer; }
#inputSlider{
text-align: center;
position: sticky;
opacity: 0.7;
padding: 0.5em;
display: grid;
top: 10px;
margin-left: 40px;
background: #22212191;
box-shadow: -3px 6px 11px rgba(132, 97, 97, 0.89), 3px 5px 11px rgba(0, 0, 0, 0.89), 7px 6px 11px rgba(132, 97, 97, 0.89);
width: calc(100% - 10rem);
z-index: 10;
--size: 155px;
}
.mycontainer {
padding: 0em 1em 1em 1em;
display: grid;
grid-gap: 1em;
font-family: monospace;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
/* Change "auto-fit" to "auto-fill" above to see the difference */
}
.mycontainer .img_div {
box-shadow: 0px 5px 11px 5px rgba(23, 22, 22, 0.65);
height: var(--size);
max-width: -moz-available;
object-fit: initial;
position: relative;
width: var(--size);
max-height: -moz-available;
}
.mycontainer .box {
padding: 0em 0em 0.5em;
border-radius: 0.3em;
background-color: rgba(49, 49, 49, 0.64) !important;
box-shadow: 10px 9px 20px 0px rgba(0, 0, 0, 0.44);
}
.mycontainer .box p {
margin-top: 3px;
color: #666262;
}
.mycontainer .box span {
display: ruby;
font-weight: bold;
position: relative;
margin:...
JavaScript
$(".checkButton").on("click", populate );
$(document).keyup(function(e){ if(e.keyCode === 27) { closeNav(); } });
function openNav() {
$("#myNav").css("width", "100%");
$("body").css("overflow-y", "hidden");
$(".closebtn").show();
}
function closeNav() {
$("#myNav").css("width", "0%");
$("body").css("overflow-y", "auto");
$(".closebtn").hide();
}
range.addEventListener("input", function() {
document.body.style.setProperty("--size", this.value + "px");
});
var parser = document.createElement('a'), searchObject = {}, queries, split, i;
var baseTop = $("div#inputSlider").offset().top;
var current_url, current_page, end_page, next_pagenr, next_page;
var scrollstop = "0";
var regex = /(https?:[/|.|\w|\s|-]*\.(?:jpg|gif|png))/gmi;
var found_results = [{"thread_id":"1634387"}]
function populate() {
for (let item of found_results) {
var temp_box = $("<div class='box'></div>");
var temp_imgbox = $("<div class='imgbox'></div>");
var temp_span = $("<a href='"+item.href+"' target='_blank'>"+item.text+"</a>");
var my_span = $("<span class='mySpan'>[</span>");
var temp_pags = $("<div class='myPagnat myPags_"+ item.thread_id+"'></div><br>");
temp_pags.append(temp_span);
temp_box.append(temp_pags);
for (let img of item.images) {
var temp_img = $("<img class='img_div' src="+img+">");
temp_imgbox.append(temp_img);
}
temp_box.append(temp_imgbox);
$(".mycontainer").append(temp_box);
}
}