2024-08-13 16:38:02 +02:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2024-08-28 21:31:27 +02:00
|
|
|
|
{{ if .IsThemeDark }}
|
|
|
|
|
<meta name="darkreader-lock">
|
|
|
|
|
{{ end }}
|
2024-08-13 16:38:02 +02:00
|
|
|
|
<title>{{.Query}} - Ocásek</title>
|
|
|
|
|
<link rel="stylesheet" href="/static/css/style.css">
|
2024-10-06 01:24:59 +02:00
|
|
|
|
<link rel="stylesheet" href="/static/css/style-fixedwidth.css">
|
2024-08-13 16:38:02 +02:00
|
|
|
|
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
|
|
|
|
|
<link rel="search" type="application/opensearchdescription+xml" title="Ocásek" href="/opensearch.xml">
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<form action="/search" id="prev-next-form" class="results-search-container" method="GET" autocomplete="off">
|
|
|
|
|
<h1 class="logomobile"><a class="no-decoration" href="./">Ocásek</a></h1>
|
|
|
|
|
<div class="wrapper-results">
|
2024-09-27 17:27:16 +02:00
|
|
|
|
<input type="text" name="q" value="{{ .Query }}" id="search-input"/>
|
2024-08-13 16:38:02 +02:00
|
|
|
|
<button id="search-wrapper-ico" class="material-icons-round" name="t" value="image">search</button>
|
2024-08-21 23:23:08 +02:00
|
|
|
|
<div class="autocomplete">
|
|
|
|
|
<ul>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2024-08-13 16:38:02 +02:00
|
|
|
|
<input type="submit" class="hide" name="t" value="image" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sub-search-button-wrapper">
|
|
|
|
|
<div class="search-container-results-btn">
|
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="text">search</button>
|
|
|
|
|
<button name="t" value="text" class="clickable">Web</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="search-container-results-btn">
|
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable search-active" name="t" value="image">image</button>
|
|
|
|
|
<button name="t" value="image" class="clickable search-active">Images</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="search-container-results-btn">
|
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="video">movie</button>
|
|
|
|
|
<button name="t" value="video" class="clickable">Videos</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="search-container-results-btn">
|
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="forum">forum</button>
|
|
|
|
|
<button name="t" value="forum" class="clickable">Forums</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="content" class="js-enabled">
|
|
|
|
|
<div class="search-container-results-btn">
|
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="map">map</button>
|
|
|
|
|
<button name="t" value="map" class="clickable">Maps</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="search-container-results-btn">
|
|
|
|
|
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="file">share</button>
|
|
|
|
|
<button name="t" value="file" class="clickable">Torrents</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
<form class="results_settings" action="/search" method="get">
|
|
|
|
|
<input type="hidden" name="q" value="{{ .Query }}">
|
|
|
|
|
<select class="results-settings" name="safe" id="safeSearchSelect">
|
|
|
|
|
<option value="disabled" {{if eq .Safe "disabled"}}selected{{end}}>Safe Search Off</option>
|
|
|
|
|
<option value="active" {{if eq .Safe "active"}}selected{{end}}>Safe Search On</option>
|
|
|
|
|
</select>
|
|
|
|
|
<select class="results-settings" name="lang" id="languageSelect">
|
|
|
|
|
{{range .LanguageOptions}}
|
|
|
|
|
<option value="{{.Code}}" {{if eq .Code $.CurrentLang}}selected{{end}}>{{.Name}}</option>
|
|
|
|
|
{{end}}
|
|
|
|
|
</select>
|
|
|
|
|
<button class="results-save" name="t" value="image">Apply settings</button>
|
|
|
|
|
</form>
|
2024-10-06 01:24:59 +02:00
|
|
|
|
<div class="search-results" id="results">
|
|
|
|
|
|
2024-08-13 16:38:02 +02:00
|
|
|
|
<!-- Results go here -->
|
|
|
|
|
{{ if .Results }}
|
|
|
|
|
<div class="images images_viewer_hidden">
|
|
|
|
|
<!-- Images Grid -->
|
2024-10-06 01:24:59 +02:00
|
|
|
|
{{ range $index, $result := .Results }}
|
2024-10-06 18:11:58 +02:00
|
|
|
|
<div class="image">
|
|
|
|
|
<img src="{{ .ThumbProxy }}" alt="{{ .Title }}" data-media="{{ .Media }}" class="clickable">
|
|
|
|
|
<div class="resolution">{{ .Width }} × {{ .Height }}</div>
|
|
|
|
|
<div class="details">
|
2024-10-06 01:24:59 +02:00
|
|
|
|
<span class="img_title clickable">{{ .Title }}</span>
|
|
|
|
|
<a href="{{ .Source }}" target="_blank" class="img_source">Source</a>
|
2024-08-13 16:38:02 +02:00
|
|
|
|
</div>
|
2024-10-06 01:24:59 +02:00
|
|
|
|
</div>
|
2024-08-13 16:38:02 +02:00
|
|
|
|
{{ end }}
|
|
|
|
|
</div>
|
2024-10-06 01:24:59 +02:00
|
|
|
|
|
2024-08-13 16:38:02 +02:00
|
|
|
|
<noscript>
|
|
|
|
|
<div class="prev-next prev-img">
|
|
|
|
|
<form action="/search" method="get">
|
|
|
|
|
<input type="hidden" name="q" value="{{ .Query }}">
|
|
|
|
|
<input type="hidden" name="t" value="image">
|
|
|
|
|
{{ if .HasPrevPage }}
|
|
|
|
|
<!-- Subtract 1 from the current page for the Previous button -->
|
|
|
|
|
<button type="submit" name="p" value="{{ sub .Page 1 }}">Previous</button>
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ if .HasNextPage }}
|
|
|
|
|
<!-- Add 1 to the current page for the Next button -->
|
|
|
|
|
<button type="submit" name="p" value="{{ add .Page 1 }}">Next</button>
|
|
|
|
|
{{ end }}
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</noscript>
|
|
|
|
|
{{ else if .NoResults }}
|
|
|
|
|
<div class="no-results">No results found for '{{ .Query }}'. Try different keywords.</div>
|
|
|
|
|
{{ else }}
|
|
|
|
|
<div class="no-more-results">Looks like this is the end of results.</div>
|
|
|
|
|
{{ end }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="message-bottom-left" id="message-bottom-left">
|
|
|
|
|
<span>Searching for new results...</span>
|
|
|
|
|
</div>
|
2024-10-06 01:24:59 +02:00
|
|
|
|
|
|
|
|
|
<div id="image-viewer-overlay" style="display: none;"></div>
|
|
|
|
|
|
2024-08-30 17:22:07 +02:00
|
|
|
|
<div id="template-data" data-page="{{ .Page }}" data-query="{{ .Query }}" data-type="image"></div>
|
|
|
|
|
<script defer src="/static/js/dynamicscrolling.js"></script>
|
2024-08-21 23:23:08 +02:00
|
|
|
|
<script defer src="/static/js/autocomplete.js"></script>
|
2024-10-06 18:11:58 +02:00
|
|
|
|
<script defer src="/static/js/imagetitletrim.js"></script>
|
2024-10-06 01:24:59 +02:00
|
|
|
|
<script>
|
2024-10-06 18:11:58 +02:00
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
let viewerOpen = false;
|
|
|
|
|
|
|
|
|
|
const viewerOverlay = document.getElementById('image-viewer-overlay');
|
|
|
|
|
viewerOverlay.innerHTML = `
|
|
|
|
|
<div id="image-viewer" class="image_view image_hide">
|
|
|
|
|
<div class="image-view-close">
|
|
|
|
|
<button class="btn-nostyle">
|
|
|
|
|
<div id="viewer-prev-button" class="material-icons-round icon_visibility clickable image-before">navigate_before</div>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn-nostyle">
|
|
|
|
|
<div id="viewer-next-button" class="material-icons-round icon_visibility clickable image-next">navigate_next</div>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn-nostyle">
|
|
|
|
|
<div id="viewer-close-button" class="material-icons-round icon_visibility clickable image-close">close</div>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<a class="image-viewer-link clickable" href="">
|
|
|
|
|
<div class="view-image" id="viewer-image-container">
|
|
|
|
|
<img id="viewer-image" class="view-image-img" src="" alt="">
|
2024-10-06 01:24:59 +02:00
|
|
|
|
</div>
|
2024-10-06 18:11:58 +02:00
|
|
|
|
</a>
|
|
|
|
|
<p class="image-alt" id="viewer-title"></p>
|
|
|
|
|
<p>View source: <a id="viewer-source-button" class="image-source" href="" target="_blank"></a></p>
|
|
|
|
|
<p>
|
|
|
|
|
<a class="full-size" href="#">Show source website</a>
|
|
|
|
|
<a class="proxy-size" href="#">Show in fullscreen</a>
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const imageView = document.getElementById('image-viewer');
|
|
|
|
|
|
|
|
|
|
function openImageViewer(element) {
|
|
|
|
|
const parentImageDiv = element.closest('.image');
|
|
|
|
|
if (!parentImageDiv) return;
|
|
|
|
|
|
|
|
|
|
const imgElement = parentImageDiv.querySelector('img.clickable');
|
|
|
|
|
const mediaUrl = imgElement.dataset.media;
|
|
|
|
|
const title = imgElement.alt;
|
|
|
|
|
const sourceUrl = parentImageDiv.querySelector('.img_source').href;
|
|
|
|
|
|
|
|
|
|
if (!mediaUrl || viewerOpen) {
|
|
|
|
|
return; // Don't open if data is missing or viewer is already open
|
|
|
|
|
}
|
|
|
|
|
viewerOpen = true;
|
|
|
|
|
|
|
|
|
|
const viewerImage = document.getElementById('viewer-image');
|
|
|
|
|
const viewerTitle = document.getElementById('viewer-title');
|
|
|
|
|
const viewerSourceButton = document.getElementById('viewer-source-button');
|
|
|
|
|
|
|
|
|
|
viewerImage.src = mediaUrl;
|
|
|
|
|
viewerTitle.textContent = title;
|
|
|
|
|
viewerSourceButton.href = sourceUrl;
|
|
|
|
|
viewerOverlay.style.display = 'flex';
|
|
|
|
|
imageView.classList.remove('image_hide');
|
|
|
|
|
imageView.classList.add('image_show');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Attach event listener to the document body
|
|
|
|
|
document.body.addEventListener('click', function(e) {
|
|
|
|
|
let target = e.target;
|
|
|
|
|
let clickableElement = target.closest('img.clickable, .img_title.clickable');
|
|
|
|
|
|
|
|
|
|
if (clickableElement) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
openImageViewer(clickableElement);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function closeImageViewer() {
|
|
|
|
|
imageView.classList.remove('image_show');
|
|
|
|
|
imageView.classList.add('image_hide');
|
|
|
|
|
viewerOverlay.style.display = 'none';
|
|
|
|
|
viewerOpen = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Close viewer on overlay or button click
|
|
|
|
|
document.getElementById('viewer-close-button').addEventListener('click', closeImageViewer);
|
|
|
|
|
viewerOverlay.addEventListener('click', function(e) {
|
|
|
|
|
if (e.target === viewerOverlay) {
|
|
|
|
|
closeImageViewer();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Handle keyboard events for closing and navigation
|
|
|
|
|
document.addEventListener('keydown', function(e) {
|
|
|
|
|
if (viewerOverlay.style.display === 'flex') {
|
|
|
|
|
if (e.key === 'Escape') {
|
|
|
|
|
closeImageViewer();
|
2024-10-06 01:24:59 +02:00
|
|
|
|
}
|
2024-10-06 18:11:58 +02:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2024-10-06 01:24:59 +02:00
|
|
|
|
</script>
|
2024-08-13 16:38:02 +02:00
|
|
|
|
<script>
|
|
|
|
|
// Check if JavaScript is enabled and modify the DOM accordingly
|
|
|
|
|
document.getElementById('content').classList.remove('js-enabled');
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
2024-10-06 18:11:58 +02:00
|
|
|
|
</html>
|