Search/templates/images.html

74 lines
3.7 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2024-04-05 12:15:43 +00:00
<title>{{.Query}} - Spitfire Search</title>
<link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
2024-04-05 12:15:43 +00:00
<div class="header">
2024-04-07 13:48:25 +00:00
<h1>Ocásek</h1>
2024-04-05 12:15:43 +00:00
<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 }}
2024-04-05 12:15:43 +00:00
<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>
2024-04-05 12:15:43 +00:00
</a>
<!-- Additional image details here -->
</div>
<!-- Images Grid -->
{{ range .Results }}
<div class="image">
2024-04-07 13:48:25 +00:00
<a class="clickable" href="{{ .ThumbProxy }}" target="_blank">
2024-04-05 12:15:43 +00:00
<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>
2024-04-05 12:15:43 +00:00
<!-- Pagination -->
<div class="prev-next prev-img">
<form action="/search" method="get">
<input type="hidden" name="q" value="{{ .Query }}">
2024-04-07 13:48:25 +00:00
<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 }}
2024-04-05 12:15:43 +00:00
</form>
</div>
{{ else }}
<div class="no-results">No results found for '{{ .Query }}'. Try different keywords.</div>
{{ end }}
</div>
</body>
2024-04-07 13:48:25 +00:00
</html>