Search/templates/images.html
2024-04-05 14:15:43 +02:00

69 lines
3.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{.Query}} - Spitfire Search</title>
<link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
<div class="header">
<h1>TailsGo</h1>
<form action="/search" method="post" class="search-form" autocomplete="off">
<div class="search-bar">
<input type="text" name="q" value="{{ .Query }}" autofocus id="search-input" placeholder="Type to search..." />
<button type="submit" id="search-btn">Search</button>
</div>
</form>
</div>
<div class="search-results">
<h1>Image Search Results</h1>
{{ if .Results }}
<div class="images images_viewer_hidden">
<!-- Image Viewer Placeholder - Adapt as necessary -->
<div class="image_view image_hide">
<!-- Navigation and Close for the Image Viewer -->
<!-- Placeholder for dynamic interaction, adapt the onclick functionality as needed -->
<div class="image-view-close">
<button class="btn-nostyle"><div class="material-icons-round icon_visibility clickable">navigate_before</div></button>
<button class="btn-nostyle"><div class="material-icons-round icon_visibility clickable">navigate_next</div></button>
<button class="btn-nostyle"><div class="material-icons-round icon_visibility clickable">close</div></button>
</div>
<!-- Placeholder for selected image -->
<a class="image-viewer-link clickable" href="#">
<div class="view-image">
<img class="view-image-img" src="" alt="Selected Image"/>
</div>
</a>
<!-- Additional image details here -->
</div>
<!-- Images Grid -->
{{ range .Results }}
<div class="image">
<a class="clickable" href="{{ .Source }}" target="_blank">
<img src="{{ .ThumbProxy }}" alt="{{ .Title }}" data-media="{{ .Media }}">
<div class="resolution">{{ .Width }} × {{ .Height }}</div>
<div class="details">
<div class="img_title">{{ .Title }}</div>
<div class="img_source"><a href="{{ .Source }}" target="_blank">Source</a></div>
</div>
</a>
</div>
{{ end }}
</div>
<!-- Pagination -->
<div class="prev-next prev-img">
<!-- Update form action and method according to your app's routing and logic -->
<form action="/search" method="get">
<input type="hidden" name="q" value="{{ .Query }}">
<!-- Pagination buttons, implement pagination logic in your Go handler -->
<button type="submit" name="p" value="previous">Previous</button>
<button type="submit" name="p" value="next">Next</button>
</form>
</div>
{{ else }}
<div class="no-results">No results found for '{{ .Query }}'. Try different keywords.</div>
{{ end }}
</div>
</body>
</html>