Write an HTML page where it looks like google. Give it a dark mode option and some other…
- User
Write an HTML page where it looks like google. Give it a dark mode option and some other stuff.
- Assistant
Write an HTML page where it looks like google. Give it a dark mode option and some other stuff.
Certainly! Below is an HTML page that resembles Google's homepage, complete with a dark mode toggle and some additional features. You can copy and paste this code into a file with a .html extension and open it in your web browser to see it in action.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MySearch</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* Base styles */
body {
margin: 0;
font-family: Arial, sans-serif;
background-color: #fff;
color: #000;
transition: background-color 0.3s, color 0.3s;
}
/* Dark mode styles */
body.dark-mode {
background-color: #202124;
color: #e8eaed;
}
/* Centered content */
.container {
text-align: center;
margin-top: 15%;
}
/* Logo styling */
.logo {
font-size: 64px;
font-weight: bold;
color: #4285f4; /* Google blue color */
}
/* Search bar styling */
.search-bar {
margin-top: 30px;
}
.search-input {
width: 50%;
padding: 12px 20px;
border: 1px solid #ccc;
border-radius: 24px;
font-size: 16px;
outline: none;
transition: box-shadow 0.3s;
}
.search-input:focus {
box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}
/* Buttons styling */
.buttons {
margin-top: 20px;
}
.btn {
padding: 10px 20px;
margin: 5px;
background-color: #f8f9fa;
border: 1px solid #c6c6c6;
border-radius: 4px;
font-size: 14px;
cursor: pointer;
transition: background-color 0.3s;
}
.btn:hover {
background-color: #e8e8e8;
}
/* Dark mode button styling */
.dark-mode-toggle {
position: fixed;
top: 10px;
right: 10px;
}
</style>
</head>
<body>
<!-- Dark Mode Toggle -->
<div class="dark-mode-toggle">
<label>
<input type="checkbox" id="darkModeToggle">
Dark Mode
</label>
</div>
<!-- Main Content -->
<div class="container">
<!-- Logo -->
<div class="logo">My<span style="color:#db4437;">S</span><span style="color:#f4b400;">e</span><span style="color:#0f9d58;">a</span><span style="color:#4285f4;">r</span><span style="color:#db4437;">c</span><span style="color:#f4b400;">h</span></div>
<!-- Search Bar -->
<div class="search-bar">
<input type="text" class="search-input" placeholder="Search...">
</div>
<!-- Buttons -->
<div class="buttons">
<button class="btn">Search</button>
<button class="btn">I'm Feeling Lucky</button>
</div>
</div>
<!-- Additional Content -->
<footer style="position: fixed; bottom: 0; width: 100%; text-align: center; padding: 10px;">
© 2023 MySearch | <a href="#" style="color: inherit; text-decoration: none;">Privacy</a> | <a href="#" style="color: inherit; text-decoration: none;">Terms</a>
</footer>
<!-- JavaScript for Dark Mode -->
<script>
const toggle = document.getElementById('darkModeToggle');
const body = document.body;
toggle.addEventListener('change', () => {
body.classList.toggle('dark-mode');
});
</script>
</body>
</html>
Features of this page:
Google-like Appearance: The page emulates the minimalist design of Google's homepage with a large logo, centered search bar, and action buttons.
Dark Mode Toggle: A checkbox in the top-right corner allows users to switch between light mode and dark mode seamlessly.
Responsive Design: The page is responsive and adjusts to different screen sizes using relative units and viewport meta tags.
Additional Content (Footer): A footer has been added at the bottom with placeholder links for Privacy and Terms, enhancing the realism of the page.
Instructions to Use:
Save the File:
.html extension, for example, mysearch.html.Open in a Browser:
Interact with the Page:
Explanation of Key Components:
HTML Structure:
<head> section includes meta tags for character encoding and viewport settings, a title, and internal CSS styles.<body> contains the main content: dark mode toggle, logo, search bar, buttons, and footer.Styling:
<style> tags in the <head>.body element transitions between light and dark modes using the .dark-mode class.Dark Mode Functionality:
.dark-mode class on the body element when changed.Additional Content:
Customizations:
Change the Logo Text:
<div class="logo"> element to personalize the logo.Adjust Colors:
Extend Functionality:
Note: Since this is a static HTML page, the search functionality is not operational. Implementing a functional search feature would require backend development with a programming language like Python, PHP, or JavaScript running on a server.
Enjoy your custom search page with dark mode!
Not yet included in a published release.