Search/templates/text.html
partisan 0559fd2bba
Some checks failed
Run Integration Tests / test (push) Failing after 10m2s
Added Weather IA
2025-06-30 08:07:57 +02:00

326 lines
No EOL
20 KiB
HTML
Executable file
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">
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
<title>{{ .Query }} - {{ translate "site_name" }}</title>
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
<link rel="stylesheet" href="/static/css/style-instantanswer.css">
<link rel="stylesheet" href="/static/css/style-fonts.css">
<link rel="stylesheet" href="/static/css/style-loadingcircle.css">
<link rel="stylesheet" href="/static/css/style-menu.css">
<!-- OpenSearch -->
<link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">
<!-- Icons -->
<link rel="icon" href="{{ .IconPathSVG }}" type="image/svg+xml">
<link rel="icon" href="{{ .IconPathPNG }}" type="image/png">
<link rel="apple-touch-icon" href="{{ .IconPathPNG }}">
</head>
<body>
<!-- Menu Button -->
<div id="content" class="js-enabled">
<div class="settings-search-div settings-search-div-search">
<button
class="material-icons-round clickable settings-icon-link settings-icon-link-search">&#xe5d2;</button>
</div>
<div class="search-menu settings-menu-hidden">
<h2>{{ translate "settings" }}</h2>
<div class="settings-content">
<button id="settingsButton" onclick="window.location.href='/settings'">{{ translate "all_settings"
}}</button>
<div class="theme-settings">
<p><span class="highlight">Current theme: </span> <span id="theme_name">{{.Theme}}</span></p>
<div class="themes-settings-menu">
<div><img class="view-image-search clickable" id="dark_theme" alt="Dark Theme"
src="/static/images/dark.webp"></div>
<div><img class="view-image-search clickable" id="light_theme" alt="Light Theme"
src="/static/images/light.webp"></div>
</div>
</div>
<select class="lang" 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="lang" name="lang" id="languageSelect">
{{range .LanguageOptions}}
<option value="{{.Code}}" {{if eq .Code $.CurrentLang}}selected{{end}}>{{.Name}}</option>
{{end}}
</select>
<button id="aboutQGatoBtn">About QGato</button>
</div>
</div>
</div>
<noscript>
<div class="settings-search-div settings-search-div-search">
<a href="/settings"
class="material-icons-round clickable settings-icon-link settings-icon-link-search">&#xe5d2;</a>
</div>
</noscript>
<!-- Popup Modal for QGato -->
<div id="aboutQGatoModal">
<!-- Close Button -->
<button class="btn-nostyle" id="close-button">
<div class="material-icons-round icon_visibility clickable cloase-btn">&#xe5cd;</div>
</button>
<div class="modal-content">
<img src="/static/images/icon.svg" alt="QGato">
<h2>{{ translate "site_name" }}</h2>
<p>{{ translate "site_description" }}</p>
<div class="button-container">
<button onclick="window.location.href='https://weforge.xyz/Spitfire/Search'">Source Code</button>
<button onclick="window.location.href='/privacy'">Privacy policy</button>
</div>
</div>
</div>
<form action="/search" id="prev-next-form" class="results-search-container" method="GET" autocomplete="off">
<h1 class="logomobile">
<div class="logo-container" href="/">
<a href="/">
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="86" viewBox="0 0 29 86">
<path fill-rule="evenodd"
d="M-44.35.78C-70.8 6.76-74.8 43.17-50.67 55.73c1.7.88 4.42 1.7 7.83 2.22 4.48.68 9.6.86 9.58.15-.04-1.43-7.3-8.28-8.67-8.28-3.15 0-9.94-5.66-11.97-10C-61.95 22.66-48.1 4.54-31.12 10c13.5 4.34 18.1 22.7 8.66 34.44-1.85 2.3-1.75 2.3-4.4-.22-4.8-4.59-8.57-5.25-11.98-2.1-2.18 2-2.15 2.66.15 4.14 1.9 1.22 13.4 12.95 17.49 17.83 4.3 5.13 5.24 6.14 7.52 7.97C-9.25 75.6-1.23 77.91 1 76.28c.67-.5 1.86-7.8 1.35-8.3-.12-.12-1.34-.4-2.7-.61-5.36-.86-9.23-3.46-14.2-9.55-3.49-4.27-4.12-5.26-3.38-5.26 2.54 0 8.05-8.62 9.86-15.43C-2.36 15.63-22.18-4.23-44.35.78m65.13 1.53C4.92 6.02-4.86 22.36-.72 38.24 3 52.62 18.43 59.63 33.67 57.64c4.7-.62 2.43-.66 4.45-.8s6.45-.01 6.93-.2c.4.03.72-.45.72-.94V42.31c0-7.36-.16-13.62-.33-13.9-.26-.4-2.36-.49-10.19-.4-11.44.15-10.96-.03-10.96 4.09 0 2.44-.04 3.99 1.17 4.7 1.13.68 3.43.59 6.68.41l3.76-.2.27 5.68c.33 6.59.57 6.15-3.64 6.7-15.53 2.04-24-5.02-23.37-19.43.66-15.1 12.2-22.78 26.96-17.94 4.5 1.47 4.4 1.52 6.16-2.8 1.5-3.68 1.5-3.69-.82-4.69C36.03 2.2 25.9 1.11 20.78 2.31m78.83.8c-2.87.76-2.9.84-3.15 6.12-.25 5.56.12 4.96-3.35 5.29-3.43.32-3.32.15-2.76 4.2.61 4.37.6 4.34 3.76 4.34h2.65v12.7c0 14.5 1.55 16.33 3.5 18.3 3.6 3.48 9.59 4.92 14.93 3.06 2.45-.85 2.43-.8 2.18-4.95-.25-4.1-.43-3.5-3.16-2.91-7.73 1.64-8.27.6-8.27-15.05V22.87h5.66l5.34-.1c.67-.01.97.4 1.28-3.9.35-4.8-.2-4.01-.8-4.14l-5.82.18-5.66.26v-5.16c0-5.84-.2-6.48-2.25-7.04-1.75-.49-1.76-.49-4.08.13m-34.5 11.02c-2.64.38-4.71 1.04-8.54 2.72l-4.03 1.76c-1.09.39-.28 1.29.69 3.89 1.06 2.75 1.35 3.35 2.11 3.03.76-.32.7-.23 1.43-.65 9.08-5.25 20.26-2.63 20.26 4.74v2.14l-5.95.2c-13.84.48-20.29 4.75-20.38 13.51-.13 12.4 14.18 17.22 24.62 8.3l2.3-1.97.23 1.85c.32 2.53.6 3.06 2.04 3.67 1.42.6 7.16.62 7.75.03.77-.77.37-6-.25-6.34-.94-.5-.77-1.57-.88-12.63-.15-14.87-.5-16.5-4.4-20.13-3.03-2.84-11.55-4.9-17-4.12m72.86 0c-27.2 5.27-24.13 43.96 3.47 43.9 14.67-.04 24.4-12.77 21.53-28.16-1.86-9.95-14.33-17.8-25-15.73m8.29 8.96c6.88 2.34 9.61 11.51 5.9 19.79-4.13 9.19-17.89 9.17-22.14-.03-1.32-2.85-1.24-10.79.14-13.54 3-6 9.45-8.49 16.1-6.22m-68.84 18.5v3.09l-1.85 1.63c-7.46 6.58-16.36 5.49-15.6-1.9.45-4.35 3.62-5.77 13.06-5.87l4.4-.05v3.1"
style="fill:currentColor" transform="translate(-31.68 4.9)" />
<path
d="M-13.47 73.3v1.11q-.65-.3-1.23-.46-.57-.15-1.11-.15-.93 0-1.44.36-.5.36-.5 1.03 0 .56.33.85.34.28 1.28.46l.69.14q1.27.24 1.88.86.6.6.6 1.64 0 1.22-.82 1.86-.82.63-2.4.63-.6 0-1.28-.14-.68-.13-1.4-.4v-1.17q.7.39 1.36.58.67.2 1.31.2.98 0 1.51-.38.54-.39.54-1.1 0-.62-.39-.97-.38-.35-1.25-.53l-.7-.13q-1.27-.26-1.84-.8-.57-.54-.57-1.51 0-1.12.78-1.76.8-.65 2.18-.65.6 0 1.2.1.63.12 1.27.33zm2.29-.28h5.34V74h-4.2v2.5h4.02v.96h-4.02v3.05h4.3v.97h-5.44zm10.14 1.13-1.55 4.2H.5zm-.65-1.13h1.3l3.21 8.45H1.64L.87 79.3h-3.8l-.78 2.17h-1.2zm9.75 4.48q.37.13.71.54.35.4.7 1.12l1.16 2.3H9.41L8.33 79.3q-.42-.85-.82-1.13-.39-.27-1.07-.27H5.2v3.57H4.06v-8.45h2.58q1.44 0 2.16.6.7.61.7 1.84 0 .8-.36 1.32-.37.52-1.08.73zM5.2 73.97v3h1.44q.82 0 1.24-.38.42-.38.42-1.12 0-.75-.42-1.12-.42-.38-1.24-.38zm12.65-.3v1.2q-.58-.53-1.23-.8-.65-.26-1.39-.26-1.45 0-2.22.89-.77.88-.77 2.55t.77 2.56q.77.88 2.22.88.74 0 1.39-.26.65-.27 1.23-.8v1.19q-.6.4-1.27.6-.67.21-1.42.21-1.91 0-3.02-1.17-1.1-1.18-1.1-3.2 0-2.04 1.1-3.21 1.1-1.18 3.02-1.18.76 0 1.43.2.67.2 1.26.6zm1.76-.65h1.14v3.46h4.15v-3.46h1.15v8.45H24.9v-4.02h-4.15v4.02h-1.14zm12.39 0h5.34V74h-4.2v2.5h4.02v.96h-4.02v3.05h4.3v.97H32zm7.32 0h1.53l3.75 7.07v-7.07h1.1v8.45h-1.53l-3.74-7.07v7.07h-1.11zm14.42 7.24V78h-1.87v-.93h3v3.62q-.67.47-1.46.71-.8.24-1.7.24-1.98 0-3.1-1.15-1.12-1.16-1.12-3.23 0-2.07 1.12-3.22 1.12-1.16 3.1-1.16.82 0 1.56.2.75.2 1.38.6v1.22q-.64-.54-1.35-.8-.71-.28-1.5-.28-1.55 0-2.33.86-.77.87-.77 2.58t.77 2.58q.78.86 2.33.86.6 0 1.08-.1.48-.1.86-.33zm3.21-7.24h1.14v8.45h-1.14zm3.42 0h1.54l3.74 7.07v-7.07h1.1v8.45h-1.53l-3.74-7.07v7.07h-1.11zm8.66 0h5.34V74h-4.2v2.5h4.02v.96h-4.02v3.05h4.3v.97h-5.44z"
aria-label="SEARCH ENGINE"
style="font-family:'ADLaM Display';white-space:pre;fill:currentColor" />
</svg>
</a>
</div>
</h1>
<div class="wrapper-results">
<input type="text" name="q" value="{{ .Query }}" id="search-input" />
<button id="search-wrapper-ico" class="material-icons-round" name="t" value="text">&#xe8b6;</button>
<div class="autocomplete">
<ul>
</ul>
</div>
<input type="submit" class="hide" name="t" value="text" />
</div>
<div class="sub-search-button-wrapper">
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable search-active" name="t"
value="text">&#xe8b6;</button>
<button name="t" value="text" class="clickable search-active">{{ translate "web" }}</button>
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t"
value="image">&#xe3f4;</button>
<button name="t" value="image" class="clickable">{{ translate "images" }}</button>
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t"
value="video">&#xe02c;</button>
<button name="t" value="video" class="clickable">{{ translate "videos" }}</button>
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t"
value="music">&#xe423;</button>
<button name="t" value="music" class="clickable">{{ translate "category_music" }}</button>
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t"
value="forum">&#xe0bf;</button>
<button name="t" value="forum" class="clickable">{{ translate "forums" }}</button>
</div>
<div id="content2" class="js-enabled">
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t"
value="map">&#xe55b;</button>
<button name="t" value="map" class="clickable">{{ translate "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">&#xe80d;</button>
<button name="t" value="file" class="clickable">{{ translate "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}}>{{ translate "safe_search_off" }}
</option>
<option value="active" {{if eq .Safe "active" }}selected{{end}}>{{ translate "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="text">{{ translate "save_settings" }}</button>
</form>
<p class="fetched fetched_dif_files fetched_tor">{{ translate "fetched_in" .Fetched }}</p>
<!-- Instant Answers Container -->
{{if .Instant}}
<div class="instant-container">
<div class="instant-box">
{{if eq .Instant.Type "currency"}}
<h3>{{.Instant.Title}}</h3> <!-- TODO: improve looks and feels of this ui -->
<div class="instant-result">
{{index .Instant.Content "display"}}
</div>
{{end}}
{{if eq .Instant.Type "calc"}}
<div class="instant-result">
<!-- Static result for non-JS users -->
<div id="static-calc">{{.Instant.Content}}</div>
<!-- Calculator UI for JS users -->
<div id="dynamic-calc" class="calc-container" style="display:none;">
<div class="calc-history" id="calc-history"></div>
<input type="text" class="calc-input" id="calc-input" value="{{.Query}}" readonly>
<div class="calc-buttons">
<button data-value="C"></button>
<button data-value="(">(</button>
<button data-value=")">)</button>
<button data-value="%">mod</button>
<button data-value="7">7</button>
<button data-value="8">8</button>
<button data-value="9">9</button>
<button data-value="/">÷</button>
<button data-value="4">4</button>
<button data-value="5">5</button>
<button data-value="6">6</button>
<button data-value="*">×</button>
<button data-value="1">1</button>
<button data-value="2">2</button>
<button data-value="3">3</button>
<button data-value="-">-</button>
<button data-value="0">0</button>
<button data-value=".">,</button>
<button data-value="=" class="equals">=</button>
<button data-value="+">+</button>
</div>
</div>
</div>
{{end}}
{{if eq .Instant.Type "weather"}}
<div class="weather">
<div class="weather-header">
<span class="weather-location">
{{index .Instant.Content "city"}}, {{index .Instant.Content "country"}}
</span>
<span class="weather-temp">
{{with (index .Instant.Content "current")}}{{printf "%.0f" .Temperature}}{{end}}°
<span class="weather-deg">C</span>
</span>
</div>
<div class="weather-current">
<div class="weather-current-left">
<span class="weather-icon">
{{weatherIcon (index .Instant.Content "current")}}
</span>
<span class="weather-cond">
{{with (index .Instant.Content "current")}}{{.Condition}}{{end}}
</span>
</div>
<div class="weather-current-right">
<span class="weather-detail" title="Humidity">
💧 {{with (index .Instant.Content "current")}}{{.Humidity}}{{end}}%
</span>
<span class="weather-detail" title="Wind">
💨 {{with (index .Instant.Content "current")}}{{printf "%.1f" .Wind}}{{end}} m/s
</span>
</div>
</div>
<div class="weather-forecast">
{{range $i, $day := (index .Instant.Content "forecast")}}
<div class="weather-forecast-day">
<div class="weather-forecast-date">{{formatShortDate $day.Date}}</div>
<div class="weather-forecast-temps">
<span>{{printf "%.0f" $day.MinTemp}}&ndash;{{printf "%.0f" $day.MaxTemp}}°C</span>
</div>
<div class="weather-forecast-cond">{{$day.Condition}}</div>
</div>
{{end}}
</div>
</div>
{{end}}
{{if eq .Instant.Type "wiki"}}
<h3>{{.Instant.Title}}</h3>
<div class="instant-result">{{index .Instant.Content "text"}}</div>
<div><a href="{{index .Instant.Content "link"}}" target="_blank">Read more on Wikipedia →</a></div>
{{end}}
</div>
</div>
{{end}}
<div class="results" id="results">
{{ if .Results }}
{{ range .Results }}
<div class="result_item">
<div class="result_header">
<div class="favicon-container">
<img src="/static/images/placeholder.svg" data-id="{{ .FaviconID }}"
data-full="/image/{{ .FaviconID }}_icon.webp" alt="🌐" class="favicon placeholder-img" />
</div>
<div class="result-url single-line-ellipsis">
{{ .PrettyLink.Domain }}
{{ if .PrettyLink.Path }}
{{ .PrettyLink.Path }}
{{ end }}
</div>
</div>
<a href="{{ .URL }}" class="result-title">
<h3 class="single-line-ellipsis">{{ .Header }}</h3>
</a>
<p class="result-description clamp-3-lines">{{ .Description }}</p>
</div>
{{ end }}
{{ else if .NoResults }}
<div class="no-results-found">
{{ translate "no_results_found" .Query }}<br>
{{ translate "suggest_rephrase" }}
</div>
{{ else }}
<div class="no-results-found">
{{ translate "no_more_results" }}
</div>
{{ end }}
</div>
<div id="message-bottom-right" class="message-bottom-right">
<span id="loading-text">{{ translate "searching_for_new_results" }}</span><span class="dot">.</span><span
class="dot">.</span><span class="dot">.</span>
</div>
<div class="prev-next prev-img" id="prev-next">
<form action="/search" method="get">
<input type="hidden" name="q" value="{{ .Query }}">
<input type="hidden" name="t" value="text">
<noscript>
{{ if .HasPrevPage }}
<button type="submit" name="p" value="{{ sub .Page 1 }}">{{ translate "previous" }}</button>
{{ end }}
{{ if .HasNextPage }}
<button type="submit" name="p" value="{{ add .Page 1 }}">{{ translate "next" }}</button>
{{ end }}
</noscript>
</form>
</div>
<div id="template-data" data-page="{{ .Page }}" data-query="{{ .Query }}" data-type="text"
data-hard-cache-enabled="{{ .HardCacheEnabled }}"></div>
<script defer src="/static/js/dynamicscrollingtext.js"></script>
<script defer src="/static/js/autocomplete.js"></script>
<script defer src="/static/js/calculator.js"></script>
<script defer src="/static/js/minimenu.js"></script>
<script>
document.querySelectorAll('.js-enabled').forEach(el => el.classList.remove('js-enabled'));
</script>
</body>
</html>