Skip to content

Google #290

@markhajitov-lab

Description

@markhajitov-lab

The code <!doctype html>

<title>Search</title> <style> /* Reset-ish */ * { box-sizing: border-box; } html,body { height:100%; margin:0; font-family: Arial, Helvetica, sans-serif; background:#fff; color:#202124; }
/* Center container */
.page {
  min-height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:40px 20px;
}

/* Logo (text-based to avoid assets) */
.logo {
  font-size:64px;
  font-weight:700;
  letter-spacing: -2px;
  margin-bottom:22px;
  display:inline-block;
  user-select:none;
}
.logo span {
  display:inline-block;
  transform-origin:center;
}
/* playful multicolor */
.c1{ color:#4285F4 } /* blue */
.c2{ color:#DB4437 } /* red */
.c3{ color:#F4B400 } /* yellow */
.c4{ color:#0F9D58 } /* green */

/* Search box */
.search {
  width:100%;
  max-width:640px;
  display:flex;
  align-items:center;
  background:#fff;
  border:1px solid #dfe1e5;
  box-shadow: 0 2px 5px rgba(60,64,67,0.15);
  padding:10px 14px;
  border-radius:24px;
}
.search input[type="search"] {
  border:0;
  outline:0;
  font-size:16px;
  flex:1;
  padding:8px;
  min-width:0;
}
.search .icon {
  margin-right:8px;
  opacity:0.6;
  font-size:18px;
}

/* buttons row */
.buttons {
  margin-top:18px;
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}
.btn {
  background:#f8f9fa;
  border:1px solid #f1f3f4;
  padding:8px 14px;
  border-radius:4px;
  font-size:14px;
  cursor:pointer;
}
.btn.primary {
  background:#1a73e8;
  color:white;
  border-color:transparent;
}

/* small footer-like hint */
.hint { margin-top:28px; color:#5f6368; font-size:13px; opacity:0.9; }

/* responsive tweaks */
@media (max-width:420px){
  .logo{ font-size:40px; margin-bottom:14px; }
  .search { padding:8px 10px; border-radius:20px; }
}
</style>
Google
<!-- Search form: submits to Google so it performs a real search -->
<form class="search-form" action="https://www.google.com/search" method="GET" role="search" aria-label="Search Google">
  <div class="search" role="search">
    <div class="icon" aria-hidden="true">🔍</div>
    <input
      id="q"
      name="q"
      type="search"
      autocomplete="off"
      placeholder="Search the web"
      aria-label="Search"
    />
    <button type="submit" style="display:none">Search</button>
  </div>

  <div class="buttons" aria-hidden="false">
    <button class="btn" type="submit">Google Search</button>
    <!-- "I'm Feeling Lucky" requires a special query param; here we'll redirect to first result via Google -->
    <button class="btn primary" id="luckyBtn" type="button">I'm Feeling Lucky</button>
  </div>
</form>

<div class="hint">This page posts your query to Google (it really searches).</div>
<script> // Focus the search box on load for quick typing const inp = document.getElementById('q'); if (inp) inp.focus(); // I'm Feeling Lucky: open Google "I'm Feeling Lucky" (uses btnI param) document.getElementById('luckyBtn').addEventListener('click', () => { const q = encodeURIComponent(inp.value || ''); // If empty, redirect to Google's homepage "I'm Feeling Lucky" behaviour: open Google Doodle? we'll open google.com if (!q) { window.location.href = 'https://www.google.com/doodles'; return; } // Using &btnI=I to trigger Google's "I'm Feeling Lucky" server-side behavior window.location.href = `https://www.google.com/search?q=${q}&btnI=I`; }); // Submit on Enter works by default. No extra JS needed. </script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions