Got it 👍 — you want to **integrate the Gradio Stable Diffusion API** for generating images, combine it with your **news UI + serverless backend**, and make sure the site supports **article navigation + responsive design**. Here’s how we can plug it all together: --- ## ✅ Updated Full Stack Setup ### 1. **Image API Service (StabilityAI via Gradio)** We’ll create a small wrapper function in `services/imageService.js`: ```js // services/imageService.js import { Client } from "@gradio/client"; let client; export async function initClient() { if (!client) { client = await Client.connect("stabilityai/stable-diffusion"); } return client; } export async function generateImage(prompt, negative = "") { try { const client = await initClient(); const result = await client.predict("/infer", { prompt, negative, scale: 7.5, // typical scale for better results }); return result.data[0]; // return first generated image URL/base64 } catch (err) { console.error("Image generation failed:", err); return null; } } ``` --- ### 2. **Serverless Backend (Netlify Functions / Vercel API Routes)** Example for Vercel (`/api/generate-image.js`): ```js // api/generate-image.js import { generateImage } from "../services/imageService.js"; export default async function handler(req, res) { if (req.method !== "POST") { return res.status(405).json({ error: "Method not allowed" }); } const { prompt } = req.body; if (!prompt) { return res.status(400).json({ error: "Prompt required" }); } const image = await generateImage(prompt); if (!image) { return res.status(500).json({ error: "Image generation failed" }); } res.status(200).json({ image }); } ``` --- ### 3. **UI Integration (React Frontend)** In `ArticleCard.jsx` (where each news story is displayed): ```jsx import { useState } from "react"; export default function ArticleCard({ article }) { const [image, setImage] = useState(article.urlToImage); async function fetchAiImage() { try { const res = await fetch("/api/generate-image", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ prompt: article.title }), }); const data = await res.json(); if (data.image) setImage(data.image); } catch (err) { console.error("AI Image fetch failed", err); } } return ( <div className="bg-white dark:bg-gray-900 rounded-2xl shadow-md p-4 flex flex-col"> <img src={image} alt={article.title} className="rounded-xl object-cover h-48 w-full" /> <h2 className="text-lg font-bold mt-3">{article.title}</h2> <p className="text-sm text-gray-600 dark:text-gray-300"> {article.description} </p> <div className="flex justify-between mt-3"> <a href={`/article/${encodeURIComponent(article.title)}`} className="text-blue-600 hover:underline" > Read More → </a> <button onClick={fetchAiImage} className="text-xs bg-blue-500 text-white px-3 py-1 rounded-lg" > Generate AI Image </button> </div> </div> ); } ``` --- ### 4. **Responsive Navigation** Use Tailwind + responsive grid: ```jsx <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 p-6"> {articles.map((a, i) => ( <ArticleCard key={i} article={a} /> ))} </div> ``` --- ### 5. **Article Page Routing** If using **Next.js**: * `/pages/article/[slug].jsx` → loads full content. If using **React Router**: * `App.jsx`: ```jsx <Routes> <Route path="/" element={<HomePage />} /> <Route path="/article/:slug" element={<ArticlePage />} /> </Routes> ``` --- 🚀 This setup gives you: * **News UI** (grid + responsive cards) * **Navigation** to full article pages * **AI-powered images** per article via Stable Diffusion API * **Serverless backend** for clean API calls --- Do you want me to **make the `ArticlePage.jsx` (full article view)** right now so the navigation works end-to-end? - Initial Deployment
Browse files- README.md +7 -5
- index.html +444 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: fd
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,444 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Modern News Website</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Poppins', sans-serif;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
.article-card {
|
| 17 |
+
transition: all 0.3s ease;
|
| 18 |
+
border-radius: 16px;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
.article-card:hover {
|
| 22 |
+
transform: scale(1.02);
|
| 23 |
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.category-badge {
|
| 27 |
+
position: absolute;
|
| 28 |
+
top: 15px;
|
| 29 |
+
left: 15px;
|
| 30 |
+
z-index: 10;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.search-btn {
|
| 34 |
+
transition: all 0.3s ease;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.search-btn:hover {
|
| 38 |
+
transform: scale(1.05);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
.hamburger {
|
| 42 |
+
display: none;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
@media (max-width: 768px) {
|
| 46 |
+
.hamburger {
|
| 47 |
+
display: block;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.nav-links {
|
| 51 |
+
display: none;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.nav-links.active {
|
| 55 |
+
display: flex;
|
| 56 |
+
flex-direction: column;
|
| 57 |
+
position: absolute;
|
| 58 |
+
top: 70px;
|
| 59 |
+
left: 0;
|
| 60 |
+
width: 100%;
|
| 61 |
+
background-color: white;
|
| 62 |
+
padding: 20px;
|
| 63 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
| 64 |
+
z-index: 50;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.search-container {
|
| 68 |
+
flex-direction: column;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.search-container input,
|
| 72 |
+
.search-container button {
|
| 73 |
+
width: 100%;
|
| 74 |
+
border-radius: 16px !important;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
.search-container input {
|
| 78 |
+
margin-bottom: 10px;
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
</style>
|
| 82 |
+
</head>
|
| 83 |
+
<body class="bg-white">
|
| 84 |
+
<!-- Header/Navigation -->
|
| 85 |
+
<header class="bg-white shadow-sm sticky top-0 z-40">
|
| 86 |
+
<div class="container mx-auto px-4 py-4 flex justify-between items-center">
|
| 87 |
+
<div class="flex items-center">
|
| 88 |
+
<h1 class="text-2xl font-bold text-indigo-600">NewsHub</h1>
|
| 89 |
+
</div>
|
| 90 |
+
|
| 91 |
+
<div class="nav-links hidden md:flex space-x-8">
|
| 92 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">Home</a>
|
| 93 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">Categories</a>
|
| 94 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">Trending</a>
|
| 95 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">About</a>
|
| 96 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">Contact</a>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<button class="hamburger md:hidden text-gray-700">
|
| 100 |
+
<i class="fas fa-bars text-2xl"></i>
|
| 101 |
+
</button>
|
| 102 |
+
</div>
|
| 103 |
+
</header>
|
| 104 |
+
|
| 105 |
+
<!-- Hero Section -->
|
| 106 |
+
<section class="py-16 md:py-24 bg-white">
|
| 107 |
+
<div class="container mx-auto px-4 text-center">
|
| 108 |
+
<span class="text-sm uppercase tracking-wider text-gray-500 font-semibold">Latest Articles</span>
|
| 109 |
+
<h1 class="text-4xl md:text-5xl font-bold text-gray-800 mt-4 mb-6">Discover our latest news</h1>
|
| 110 |
+
<p class="text-lg text-gray-600 max-w-2xl mx-auto mb-10">
|
| 111 |
+
Discover the achievements that set us apart. From groundbreaking projects to industry accolades, we take pride in our accomplishments.
|
| 112 |
+
</p>
|
| 113 |
+
|
| 114 |
+
<div class="max-w-2xl mx-auto flex search-container">
|
| 115 |
+
<input type="text" placeholder="Input Placeholder" class="flex-grow px-6 py-3 rounded-l-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
|
| 116 |
+
<button class="search-btn bg-indigo-600 text-white px-6 py-3 rounded-r-lg font-medium hover:bg-indigo-700 transition-colors">
|
| 117 |
+
Find Now
|
| 118 |
+
</button>
|
| 119 |
+
</div>
|
| 120 |
+
</div>
|
| 121 |
+
</section>
|
| 122 |
+
|
| 123 |
+
<!-- Main Content -->
|
| 124 |
+
<main class="container mx-auto px-4 py-12">
|
| 125 |
+
<div class="flex flex-col md:flex-row gap-8">
|
| 126 |
+
<!-- Articles Grid -->
|
| 127 |
+
<div class="w-full">
|
| 128 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
| 129 |
+
<!-- Article Card 1 -->
|
| 130 |
+
<div class="article-card bg-white rounded-2xl shadow-md overflow-hidden hover:shadow-lg cursor-pointer">
|
| 131 |
+
<div class="relative">
|
| 132 |
+
<img src="https://source.unsplash.com/random/600x400/?technology" alt="Article thumbnail" class="w-full object-cover aspect-[4/5]">
|
| 133 |
+
<span class="category-badge bg-indigo-600 text-white text-xs font-semibold px-3 py-1 rounded-full">Technology</span>
|
| 134 |
+
</div>
|
| 135 |
+
<div class="p-5">
|
| 136 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2 line-clamp-3">The Future of AI in Everyday Life</h3>
|
| 137 |
+
<p class="text-gray-600 text-sm mb-4 line-clamp-2">Exploring how artificial intelligence will transform our daily routines and work environments in the coming decade.</p>
|
| 138 |
+
<div class="flex items-center">
|
| 139 |
+
<div class="w-8 h-8 rounded-full bg-gray-300 overflow-hidden mr-3">
|
| 140 |
+
<img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Author" class="w-full h-full object-cover">
|
| 141 |
+
</div>
|
| 142 |
+
<div>
|
| 143 |
+
<p class="text-sm font-medium text-gray-800">Sarah Johnson</p>
|
| 144 |
+
<p class="text-xs text-gray-500">July 20, 2024</p>
|
| 145 |
+
</div>
|
| 146 |
+
</div>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
|
| 150 |
+
<!-- Article Card 2 -->
|
| 151 |
+
<div class="article-card bg-white rounded-2xl shadow-md overflow-hidden hover:shadow-lg cursor-pointer">
|
| 152 |
+
<div class="relative">
|
| 153 |
+
<img src="https://source.unsplash.com/random/600x400/?travel" alt="Article thumbnail" class="w-full object-cover aspect-[4/5]">
|
| 154 |
+
<span class="category-badge bg-green-500 text-white text-xs font-semibold px-3 py-1 rounded-full">Travel</span>
|
| 155 |
+
</div>
|
| 156 |
+
<div class="p-5">
|
| 157 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2 line-clamp-3">Hidden Gems in Southeast Asia</h3>
|
| 158 |
+
<p class="text-gray-600 text-sm mb-4 line-clamp-2">Discover these 5 underrated destinations that offer authentic experiences away from tourist crowds.</p>
|
| 159 |
+
<div class="flex items-center">
|
| 160 |
+
<div class="w-8 h-8 rounded-full bg-gray-300 overflow-hidden mr-3">
|
| 161 |
+
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Author" class="w-full h-full object-cover">
|
| 162 |
+
</div>
|
| 163 |
+
<div>
|
| 164 |
+
<p class="text-sm font-medium text-gray-800">Michael Chen</p>
|
| 165 |
+
<p class="text-xs text-gray-500">July 18, 2024</p>
|
| 166 |
+
</div>
|
| 167 |
+
</div>
|
| 168 |
+
</div>
|
| 169 |
+
</div>
|
| 170 |
+
|
| 171 |
+
<!-- Article Card 3 -->
|
| 172 |
+
<div class="article-card bg-white rounded-2xl shadow-md overflow-hidden hover:shadow-lg cursor-pointer">
|
| 173 |
+
<div class="relative">
|
| 174 |
+
<img src="https://source.unsplash.com/random/600x400/?health" alt="Article thumbnail" class="w-full object-cover aspect-[4/5]">
|
| 175 |
+
<span class="category-badge bg-blue-500 text-white text-xs font-semibold px-3 py-1 rounded-full">Health</span>
|
| 176 |
+
</div>
|
| 177 |
+
<div class="p-5">
|
| 178 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2 line-clamp-3">The Science of Better Sleep</h3>
|
| 179 |
+
<p class="text-gray-600 text-sm mb-4 line-clamp-2">New research reveals surprising techniques to improve sleep quality and overall health based on circadian rhythms.</p>
|
| 180 |
+
<div class="flex items-center">
|
| 181 |
+
<div class="w-8 h-8 rounded-full bg-gray-300 overflow-hidden mr-3">
|
| 182 |
+
<img src="https://randomuser.me/api/portraits/women/68.jpg" alt="Author" class="w-full h-full object-cover">
|
| 183 |
+
</div>
|
| 184 |
+
<div>
|
| 185 |
+
<p class="text-sm font-medium text-gray-800">Dr. Emily Parker</p>
|
| 186 |
+
<p class="text-xs text-gray-500">July 15, 2024</p>
|
| 187 |
+
</div>
|
| 188 |
+
</div>
|
| 189 |
+
</div>
|
| 190 |
+
</div>
|
| 191 |
+
|
| 192 |
+
<!-- Article Card 4 -->
|
| 193 |
+
<div class="article-card bg-white rounded-2xl shadow-md overflow-hidden hover:shadow-lg cursor-pointer">
|
| 194 |
+
<div class="relative">
|
| 195 |
+
<img src="https://source.unsplash.com/random/600x400/?business" alt="Article thumbnail" class="w-full object-cover aspect-[4/5]">
|
| 196 |
+
<span class="category-badge bg-purple-500 text-white text-xs font-semibold px-3 py-1 rounded-full">Business</span>
|
| 197 |
+
</div>
|
| 198 |
+
<div class="p-5">
|
| 199 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2 line-clamp-3">Remote Work Trends in 2024</h3>
|
| 200 |
+
<p class="text-gray-600 text-sm mb-4 line-clamp-2">How companies are adapting their policies and what employees really want from hybrid work arrangements.</p>
|
| 201 |
+
<div class="flex items-center">
|
| 202 |
+
<div class="w-8 h-8 rounded-full bg-gray-300 overflow-hidden mr-3">
|
| 203 |
+
<img src="https://randomuser.me/api/portraits/men/75.jpg" alt="Author" class="w-full h-full object-cover">
|
| 204 |
+
</div>
|
| 205 |
+
<div>
|
| 206 |
+
<p class="text-sm font-medium text-gray-800">David Wilson</p>
|
| 207 |
+
<p class="text-xs text-gray-500">July 12, 2024</p>
|
| 208 |
+
</div>
|
| 209 |
+
</div>
|
| 210 |
+
</div>
|
| 211 |
+
</div>
|
| 212 |
+
|
| 213 |
+
<!-- Article Card 5 -->
|
| 214 |
+
<div class="article-card bg-white rounded-2xl shadow-md overflow-hidden hover:shadow-lg cursor-pointer">
|
| 215 |
+
<div class="relative">
|
| 216 |
+
<img src="https://source.unsplash.com/random/600x400/?food" alt="Article thumbnail" class="w-full object-cover aspect-[4/5]">
|
| 217 |
+
<span class="category-badge bg-red-500 text-white text-xs font-semibold px-3 py-1 rounded-full">Food</span>
|
| 218 |
+
</div>
|
| 219 |
+
<div class="p-5">
|
| 220 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2 line-clamp-3">Plant-Based Diets: Beyond the Hype</h3>
|
| 221 |
+
<p class="text-gray-600 text-sm mb-4 line-clamp-2">Nutritionists weigh in on the long-term benefits and potential pitfalls of modern plant-based eating trends.</p>
|
| 222 |
+
<div class="flex items-center">
|
| 223 |
+
<div class="w-8 h-8 rounded-full bg-gray-300 overflow-hidden mr-3">
|
| 224 |
+
<img src="https://randomuser.me/api/portraits/women/33.jpg" alt="Author" class="w-full h-full object-cover">
|
| 225 |
+
</div>
|
| 226 |
+
<div>
|
| 227 |
+
<p class="text-sm font-medium text-gray-800">Lisa Rodriguez</p>
|
| 228 |
+
<p class="text-xs text-gray-500">July 10, 2024</p>
|
| 229 |
+
</div>
|
| 230 |
+
</div>
|
| 231 |
+
</div>
|
| 232 |
+
</div>
|
| 233 |
+
|
| 234 |
+
<!-- Article Card 6 -->
|
| 235 |
+
<div class="article-card bg-white rounded-2xl shadow-md overflow-hidden hover:shadow-lg cursor-pointer">
|
| 236 |
+
<div class="relative">
|
| 237 |
+
<img src="https://source.unsplash.com/random/600x400/?sports" alt="Article thumbnail" class="w-full object-cover aspect-[4/5]">
|
| 238 |
+
<span class="category-badge bg-orange-500 text-white text-xs font-semibold px-3 py-1 rounded-full">Sports</span>
|
| 239 |
+
</div>
|
| 240 |
+
<div class="p-5">
|
| 241 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2 line-clamp-3">The Rise of Women's Sports Viewership</h3>
|
| 242 |
+
<p class="text-gray-600 text-sm mb-4 line-clamp-2">Record-breaking attendance and TV ratings signal a cultural shift in sports entertainment and sponsorship.</p>
|
| 243 |
+
<div class="flex items-center">
|
| 244 |
+
<div class="w-8 h-8 rounded-full bg-gray-300 overflow-hidden mr-3">
|
| 245 |
+
<img src="https://randomuser.me/api/portraits/men/45.jpg" alt="Author" class="w-full h-full object-cover">
|
| 246 |
+
</div>
|
| 247 |
+
<div>
|
| 248 |
+
<p class="text-sm font-medium text-gray-800">James Peterson</p>
|
| 249 |
+
<p class="text-xs text-gray-500">July 8, 2024</p>
|
| 250 |
+
</div>
|
| 251 |
+
</div>
|
| 252 |
+
</div>
|
| 253 |
+
</div>
|
| 254 |
+
</div>
|
| 255 |
+
|
| 256 |
+
<!-- Pagination -->
|
| 257 |
+
<div class="flex justify-center mt-12">
|
| 258 |
+
<nav class="flex items-center space-x-2">
|
| 259 |
+
<button class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">
|
| 260 |
+
<i class="fas fa-chevron-left"></i>
|
| 261 |
+
</button>
|
| 262 |
+
<button class="px-4 py-2 bg-indigo-600 text-white rounded-md font-medium">1</button>
|
| 263 |
+
<button class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">2</button>
|
| 264 |
+
<button class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">3</button>
|
| 265 |
+
<span class="px-2 text-gray-500">...</span>
|
| 266 |
+
<button class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">8</button>
|
| 267 |
+
<button class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">
|
| 268 |
+
<i class="fas fa-chevron-right"></i>
|
| 269 |
+
</button>
|
| 270 |
+
</nav>
|
| 271 |
+
</div>
|
| 272 |
+
</div>
|
| 273 |
+
|
| 274 |
+
<!-- Sidebar -->
|
| 275 |
+
<div class="w-full md:w-1/4 space-y-8">
|
| 276 |
+
<!-- Categories -->
|
| 277 |
+
<div class="bg-white p-6 rounded-xl shadow-sm">
|
| 278 |
+
<h3 class="text-lg font-bold text-gray-800 mb-4">Categories</h3>
|
| 279 |
+
<ul class="space-y-3">
|
| 280 |
+
<li>
|
| 281 |
+
<a href="#" class="flex items-center justify-between text-gray-700 hover:text-indigo-600">
|
| 282 |
+
<span>Technology</span>
|
| 283 |
+
<span class="bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded-full">24</span>
|
| 284 |
+
</a>
|
| 285 |
+
</li>
|
| 286 |
+
<li>
|
| 287 |
+
<a href="#" class="flex items-center justify-between text-gray-700 hover:text-indigo-600">
|
| 288 |
+
<span>Business</span>
|
| 289 |
+
<span class="bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded-full">18</span>
|
| 290 |
+
</a>
|
| 291 |
+
</li>
|
| 292 |
+
<li>
|
| 293 |
+
<a href="#" class="flex items-center justify-between text-gray-700 hover:text-indigo-600">
|
| 294 |
+
<span>Health</span>
|
| 295 |
+
<span class="bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded-full">15</span>
|
| 296 |
+
</a>
|
| 297 |
+
</li>
|
| 298 |
+
<li>
|
| 299 |
+
<a href="#" class="flex items-center justify-between text-gray-700 hover:text-indigo-600">
|
| 300 |
+
<span>Travel</span>
|
| 301 |
+
<span class="bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded-full">12</span>
|
| 302 |
+
</a>
|
| 303 |
+
</li>
|
| 304 |
+
<li>
|
| 305 |
+
<a href="#" class="flex items-center justify-between text-gray-700 hover:text-indigo-600">
|
| 306 |
+
<span>Food</span>
|
| 307 |
+
<span class="bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded-full">9</span>
|
| 308 |
+
</a>
|
| 309 |
+
</li>
|
| 310 |
+
<li>
|
| 311 |
+
<a href="#" class="flex items-center justify-between text-gray-700 hover:text-indigo-600">
|
| 312 |
+
<span>Sports</span>
|
| 313 |
+
<span class="bg-gray-100 text-gray-600 text-xs px-2 py-1 rounded-full">7</span>
|
| 314 |
+
</a>
|
| 315 |
+
</li>
|
| 316 |
+
</ul>
|
| 317 |
+
</div>
|
| 318 |
+
|
| 319 |
+
<!-- Popular Articles -->
|
| 320 |
+
<div class="bg-white p-6 rounded-xl shadow-sm">
|
| 321 |
+
<h3 class="text-lg font-bold text-gray-800 mb-4">Popular Articles</h3>
|
| 322 |
+
<ul class="space-y-4">
|
| 323 |
+
<li>
|
| 324 |
+
<a href="#" class="flex items-start space-x-3 group">
|
| 325 |
+
<div class="flex-shrink-0 w-16 h-16 rounded-md overflow-hidden">
|
| 326 |
+
<img src="https://source.unsplash.com/random/100x100/?tech" alt="Popular article" class="w-full h-full object-cover">
|
| 327 |
+
</div>
|
| 328 |
+
<div>
|
| 329 |
+
<h4 class="text-sm font-medium text-gray-800 group-hover:text-indigo-600">How Blockchain is Changing Finance</h4>
|
| 330 |
+
<p class="text-xs text-gray-500 mt-1">June 28, 2024</p>
|
| 331 |
+
</div>
|
| 332 |
+
</a>
|
| 333 |
+
</li>
|
| 334 |
+
<li>
|
| 335 |
+
<a href="#" class="flex items-start space-x-3 group">
|
| 336 |
+
<div class="flex-shrink-0 w-16 h-16 rounded-md overflow-hidden">
|
| 337 |
+
<img src="https://source.unsplash.com/random/100x100/?travel" alt="Popular article" class="w-full h-full object-cover">
|
| 338 |
+
</div>
|
| 339 |
+
<div>
|
| 340 |
+
<h4 class="text-sm font-medium text-gray-800 group-hover:text-indigo-600">Best Travel Destinations for Solo Travelers</h4>
|
| 341 |
+
<p class="text-xs text-gray-500 mt-1">June 25, 2024</p>
|
| 342 |
+
</div>
|
| 343 |
+
</a>
|
| 344 |
+
</li>
|
| 345 |
+
<li>
|
| 346 |
+
<a href="#" class="flex items-start space-x-3 group">
|
| 347 |
+
<div class="flex-shrink-0 w-16 h-16 rounded-md overflow-hidden">
|
| 348 |
+
<img src="https://source.unsplash.com/random/100x100/?health" alt="Popular article" class="w-full h-full object-cover">
|
| 349 |
+
</div>
|
| 350 |
+
<div>
|
| 351 |
+
<h4 class="text-sm font-medium text-gray-800 group-hover:text-indigo-600">Mental Health Tips for Remote Workers</h4>
|
| 352 |
+
<p class="text-xs text-gray-500 mt-1">June 22, 2024</p>
|
| 353 |
+
</div>
|
| 354 |
+
</a>
|
| 355 |
+
</li>
|
| 356 |
+
</ul>
|
| 357 |
+
</div>
|
| 358 |
+
|
| 359 |
+
<!-- Newsletter -->
|
| 360 |
+
<div class="bg-indigo-50 p-6 rounded-xl">
|
| 361 |
+
<h3 class="text-lg font-bold text-gray-800 mb-3">Subscribe to Newsletter</h3>
|
| 362 |
+
<p class="text-sm text-gray-600 mb-4">Get the latest articles and news delivered to your inbox.</p>
|
| 363 |
+
<form class="space-y-3">
|
| 364 |
+
<input type="email" placeholder="Your email address" class="w-full px-4 py-2 rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
|
| 365 |
+
<button type="submit" class="w-full bg-indigo-600 text-white py-2 rounded-md font-medium hover:bg-indigo-700 transition-colors">Subscribe</button>
|
| 366 |
+
</form>
|
| 367 |
+
</div>
|
| 368 |
+
</div>
|
| 369 |
+
</div>
|
| 370 |
+
</main>
|
| 371 |
+
|
| 372 |
+
<!-- Footer -->
|
| 373 |
+
<footer class="bg-gray-800 text-white py-12">
|
| 374 |
+
<div class="container mx-auto px-4">
|
| 375 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
|
| 376 |
+
<div>
|
| 377 |
+
<h3 class="text-xl font-bold mb-4">NewsHub</h3>
|
| 378 |
+
<p class="text-gray-400">Delivering quality news and insights to keep you informed and inspired.</p>
|
| 379 |
+
<div class="flex space-x-4 mt-6">
|
| 380 |
+
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-twitter"></i></a>
|
| 381 |
+
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-facebook"></i></a>
|
| 382 |
+
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-instagram"></i></a>
|
| 383 |
+
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-linkedin"></i></a>
|
| 384 |
+
</div>
|
| 385 |
+
</div>
|
| 386 |
+
<div>
|
| 387 |
+
<h4 class="font-bold text-lg mb-4">Quick Links</h4>
|
| 388 |
+
<ul class="space-y-2">
|
| 389 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Home</a></li>
|
| 390 |
+
<li><a href="#" class="text-gray-400 hover:text-white">About Us</a></li>
|
| 391 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Categories</a></li>
|
| 392 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Trending</a></li>
|
| 393 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Contact</a></li>
|
| 394 |
+
</ul>
|
| 395 |
+
</div>
|
| 396 |
+
<div>
|
| 397 |
+
<h4 class="font-bold text-lg mb-4">Categories</h4>
|
| 398 |
+
<ul class="space-y-2">
|
| 399 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Technology</a></li>
|
| 400 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Business</a></li>
|
| 401 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Health</a></li>
|
| 402 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Travel</a></li>
|
| 403 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Sports</a></li>
|
| 404 |
+
</ul>
|
| 405 |
+
</div>
|
| 406 |
+
<div>
|
| 407 |
+
<h4 class="font-bold text-lg mb-4">Contact Us</h4>
|
| 408 |
+
<address class="text-gray-400 not-italic">
|
| 409 |
+
<p class="mb-2">123 News Street, Media City</p>
|
| 410 |
+
<p class="mb-2">Email: info@newshub.com</p>
|
| 411 |
+
<p>Phone: (123) 456-7890</p>
|
| 412 |
+
</address>
|
| 413 |
+
</div>
|
| 414 |
+
</div>
|
| 415 |
+
<div class="border-t border-gray-700 mt-12 pt-8 text-center text-gray-400">
|
| 416 |
+
<p>© 2024 NewsHub. All rights reserved.</p>
|
| 417 |
+
</div>
|
| 418 |
+
</div>
|
| 419 |
+
</footer>
|
| 420 |
+
|
| 421 |
+
<script>
|
| 422 |
+
// Mobile menu toggle
|
| 423 |
+
document.querySelector('.hamburger').addEventListener('click', function() {
|
| 424 |
+
document.querySelector('.nav-links').classList.toggle('active');
|
| 425 |
+
});
|
| 426 |
+
|
| 427 |
+
// Article card click handler
|
| 428 |
+
document.querySelectorAll('.article-card').forEach(card => {
|
| 429 |
+
card.addEventListener('click', function() {
|
| 430 |
+
// In a real app, this would navigate to the article page
|
| 431 |
+
alert('Navigating to article page...');
|
| 432 |
+
});
|
| 433 |
+
});
|
| 434 |
+
|
| 435 |
+
// Search functionality
|
| 436 |
+
document.querySelector('.search-btn').addEventListener('click', function() {
|
| 437 |
+
const searchTerm = document.querySelector('input[type="text"]').value;
|
| 438 |
+
if(searchTerm.trim() !== '') {
|
| 439 |
+
alert(`Searching for: ${searchTerm}`);
|
| 440 |
+
}
|
| 441 |
+
});
|
| 442 |
+
</script>
|
| 443 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Kamocodes/fd" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 444 |
+
</html>
|