Sanjay51's picture
You are an expert full‑stack web developer tasked with creating a prototype for a "Blog Generator Web App". The goal is to build a lightweight MVP that allows users to generate, edit, and download AI‑generated blog posts based on user input.
a3f5a07 verified
class CustomHeader extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
}
header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
color: white;
text-decoration: none;
transition: transform 0.2s;
}
.logo:hover {
transform: translateX(5px);
}
.logo-text {
font-size: 1.5rem;
font-weight: bold;
margin-left: 0.5rem;
}
.nav-links {
display: flex;
gap: 2rem;
align-items: center;
}
.nav-link {
color: white;
text-decoration: none;
transition: opacity 0.2s;
display: flex;
align-items: center;
gap: 0.5rem;
}
.nav-link:hover {
opacity: 0.8;
}
.dark-mode-toggle {
background: rgba(255, 255, 255, 0.2);
border: 2px solid white;
border-radius: 50px;
width: 60px;
height: 30px;
position: relative;
cursor: pointer;
transition: background 0.3s;
}
.dark-mode-toggle::after {
content: '☀️';
position: absolute;
width: 24px;
height: 24px;
background: white;
border-radius: 50%;
top: 2px;
left: 2px;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.3s;
font-size: 14px;
}
.dark-mode-toggle.dark {
background: rgba(0, 0, 0, 0.3);
}
.dark-mode-toggle.dark::after {
content: '🌙';
transform: translateX(30px);
}
@media (max-width: 768px) {
.container {
padding: 1rem;
}
.nav-links {
gap: 1rem;
}
.nav-text {
display: none;
}
}
</style>
<header>
<div class="container">
<a href="#" class="logo">
<span style="font-size: 2rem;">✍️</span>
<span class="logo-text">BlogWizard Pro</span>
</a>
<nav class="nav-links">
<a href="#" class="nav-link">
<i data-feather="home"></i>
<span class="nav-text">Home</span>
</a>
<a href="#outputSection