| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta
- name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=5.0"
- />
- <title>Simo Search</title>
- <link rel="stylesheet" href="/static/main.css" />
- <link rel="icon" type="image/x-icon" href="/static/favicon.gif" />
- <link
- rel="search"
- type="application/opensearchdescription+xml"
- title="Simo Search"
- href="/opensearch.xml"
- />
- <script>
- (function () {
- function isEmbedMode() {
- return (
- (window.location.hash || "").indexOf("#embed") !== -1
- );
- }
- function syncEmbedClassFromHash() {
- document.body.classList.toggle("embed", isEmbedMode());
- }
- function wireEmbedPreservingHomeSearchSubmit() {
- const form = document.querySelector(
- "form.home-search-form",
- );
- if (!form) return;
- form.addEventListener("submit", function (ev) {
- if (!isEmbedMode()) return;
- // Default GET form submission omits the fragment.
- // In embed mode, submit by navigating to action + querystring + #embed.
- ev.preventDefault();
- const actionAttr =
- form.getAttribute("action") || "/search";
- const actionUrl = new URL(
- actionAttr,
- window.location.origin,
- );
- const params = new URLSearchParams(new FormData(form));
- actionUrl.search = params.toString();
- window.location.assign(actionUrl.toString() + "#embed");
- });
- }
- function init() {
- syncEmbedClassFromHash();
- wireEmbedPreservingHomeSearchSubmit();
- }
- if (document.readyState === "loading") {
- document.addEventListener("DOMContentLoaded", init);
- } else {
- init();
- }
- window.addEventListener("hashchange", syncEmbedClassFromHash);
- })();
- </script>
- </head>
- <body>
- <div class="view-home">
- <div class="container" id="container">
- <h1 class="hero-logo">Simo <span>Search</span></h1>
- <form action="/search" class="home-search-form">
- <div class="search-input-wrapper">
- <input
- name="q"
- type="text"
- class="search-box"
- placeholder="Search the web..."
- autofocus
- autocomplete="off"
- />
- </div>
- <div class="buttons">
- <button type="submit" class="btn-primary">
- Search
- </button>
- </div>
- </form>
- </div>
- </div>
- </body>
- </html>
|