Spaces:
Running
Running
Update index.html
#6
by
oldmonk69
- opened
- index.html +218 -253
index.html
CHANGED
|
@@ -3,30 +3,31 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8" />
|
| 5 |
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
| 6 |
-
<title>NeuralNomadAI —
|
| 7 |
|
| 8 |
<!-- Google fonts -->
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap" rel="stylesheet">
|
| 10 |
|
| 11 |
-
<!-- Tailwind
|
| 12 |
<script src="https://cdn.tailwindcss.com?plugins=forms"></script>
|
|
|
|
|
|
|
| 13 |
<link rel="stylesheet" href="style.css">
|
| 14 |
</head>
|
| 15 |
-
<body class="font-display bg-
|
| 16 |
|
| 17 |
-
<!--
|
| 18 |
<header class="site-header">
|
| 19 |
<div class="container nav-inner">
|
| 20 |
<div class="brand">
|
| 21 |
-
<div class="logo"></div>
|
| 22 |
<span class="brand-name">NeuralNomadAI</span>
|
| 23 |
</div>
|
| 24 |
<nav class="nav-links" aria-label="Primary Navigation">
|
| 25 |
-
<a
|
| 26 |
-
<a
|
| 27 |
-
<a
|
| 28 |
-
<a
|
| 29 |
-
<a data-page="contact" class="nav-link">Contact</a>
|
| 30 |
</nav>
|
| 31 |
<div class="nav-cta">
|
| 32 |
<button class="btn btn-outline">Login</button>
|
|
@@ -40,282 +41,246 @@
|
|
| 40 |
<div class="hero-overlay"></div>
|
| 41 |
<div class="container hero-inner">
|
| 42 |
<h1 class="hero-title">Unleash Your Creative Vision with AI</h1>
|
| 43 |
-
<p class="hero-sub">NeuralNomadAI empowers creators with cutting-edge AI tools for imagery and automation
|
| 44 |
-
|
|
|
|
| 45 |
<a href="#contact" class="btn btn-primary large">Get Started</a>
|
| 46 |
<a href="#services" class="btn btn-muted large">Explore Features</a>
|
| 47 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
</div>
|
| 49 |
</section>
|
| 50 |
|
| 51 |
<main>
|
| 52 |
-
<!--
|
| 53 |
-
<section class="container section
|
| 54 |
<h2 class="section-title">Quick Pitch</h2>
|
| 55 |
-
<p class="lead">NeuralNomadAI
|
| 56 |
</section>
|
|
|
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
<div
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
</article>
|
| 67 |
-
<article class="feature-card">
|
| 68 |
-
<img src="assets/showcase-2.jpg" alt="AI-powered sample 2" loading="lazy" />
|
| 69 |
-
<h3>Automated Workflow Tools</h3>
|
| 70 |
-
<p>Streamline your process with automated tasks and pipelines.</p>
|
| 71 |
-
</article>
|
| 72 |
-
<article class="feature-card">
|
| 73 |
-
<img src="assets/showcase-3.jpg" alt="AI-powered sample 3" loading="lazy" />
|
| 74 |
-
<h3>Customizable AI Models</h3>
|
| 75 |
-
<p>Tune models to match your artistic vision and brand voice.</p>
|
| 76 |
-
</article>
|
| 77 |
</div>
|
|
|
|
|
|
|
| 78 |
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
</div>
|
| 95 |
-
</
|
|
|
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
<a href="#contact" class="btn btn-primary">Get Started Today</a>
|
| 102 |
-
</div>
|
| 103 |
-
</section>
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
<h3>Hire Us on Fiverr</h3>
|
| 109 |
-
<p>For standardized services and quick turnarounds, find us on Fiverr.</p>
|
| 110 |
-
<a class="btn btn-primary" href="#" target="_blank" rel="noopener">Hire on Fiverr</a>
|
| 111 |
-
|
| 112 |
-
<hr class="divider"/>
|
| 113 |
-
|
| 114 |
-
<h3>Custom Requests</h3>
|
| 115 |
-
<form id="contact-form" class="contact-form" novalidate>
|
| 116 |
-
<label>
|
| 117 |
-
<span>Your Name</span>
|
| 118 |
-
<input name="name" type="text" placeholder="Enter your name" required>
|
| 119 |
-
</label>
|
| 120 |
-
<label>
|
| 121 |
-
<span>Your Email</span>
|
| 122 |
-
<input name="email" type="email" placeholder="Enter your email" required>
|
| 123 |
-
</label>
|
| 124 |
-
<label>
|
| 125 |
-
<span>Subject</span>
|
| 126 |
-
<input name="subject" type="text" placeholder="Enter the subject">
|
| 127 |
-
</label>
|
| 128 |
-
<label>
|
| 129 |
-
<span>Your Message</span>
|
| 130 |
-
<textarea name="message" rows="6" placeholder="Enter your message" required></textarea>
|
| 131 |
-
</label>
|
| 132 |
-
<button type="submit" class="btn btn-primary full">Send Message</button>
|
| 133 |
-
</form>
|
| 134 |
-
</div>
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
<p><strong>Availability:</strong> We are currently accepting new projects.</p>
|
| 142 |
-
</div>
|
| 143 |
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
<a class="social">Instagram</a>
|
| 148 |
-
<a class="social">LinkedIn</a>
|
| 149 |
-
</div>
|
| 150 |
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
|
|
| 160 |
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
<div class="pricing-grid mt-8">
|
| 167 |
-
<div class="pricing-card">
|
| 168 |
-
<div class="price-top">Basic <span class="price-amount">$29<span class="price-unit">/month</span></span></div>
|
| 169 |
-
<ul class="price-features">
|
| 170 |
-
<li>100 AI Image Credits</li>
|
| 171 |
-
<li>Basic Image Editing Tools</li>
|
| 172 |
-
<li>Community Support</li>
|
| 173 |
-
</ul>
|
| 174 |
-
<button class="btn btn-outline full">Choose Plan</button>
|
| 175 |
-
</div>
|
| 176 |
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
</ul>
|
| 195 |
-
<button class="btn btn-outline full">Contact Us</button>
|
| 196 |
-
</div>
|
| 197 |
-
</div>
|
| 198 |
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
<tbody>
|
| 206 |
-
<tr><td>AI Image Credits</td><td>100</td><td>Unlimited</td><td>Custom</td></tr>
|
| 207 |
-
<tr><td>Image Editing Tools</td><td>Basic</td><td>Advanced</td><td>Advanced</td></tr>
|
| 208 |
-
<tr><td>Support</td><td>Community</td><td>Priority</td><td>Dedicated</td></tr>
|
| 209 |
-
<tr><td>Delivery Time</td><td>Instant</td><td>Instant</td><td>Custom</td></tr>
|
| 210 |
-
<tr><td>Commercial Use</td><td>No</td><td>Yes</td><td>Yes</td></tr>
|
| 211 |
-
</tbody>
|
| 212 |
-
</table>
|
| 213 |
-
</div>
|
| 214 |
-
</section>
|
| 215 |
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
<div class="testimonial-grid mt-8">
|
| 220 |
-
<blockquote class="testimonial">
|
| 221 |
-
<div class="avatar">SB</div>
|
| 222 |
-
<div class="quote">
|
| 223 |
-
<strong>Sophia Bennett</strong>
|
| 224 |
-
<p class="date">August 15, 2023</p>
|
| 225 |
-
<p class="stars">★★★★★</p>
|
| 226 |
-
<p class="text">"NeuralNomadAI transformed my creative process. The AI imagery is stunning, and the automation tools have saved me countless hours."</p>
|
| 227 |
-
</div>
|
| 228 |
-
</blockquote>
|
| 229 |
-
|
| 230 |
-
<blockquote class="testimonial">
|
| 231 |
-
<div class="avatar">EC</div>
|
| 232 |
-
<div class="quote">
|
| 233 |
-
<strong>Ethan Carter</strong>
|
| 234 |
-
<p class="date">July 22, 2023</p>
|
| 235 |
-
<p class="stars">★★★★★</p>
|
| 236 |
-
<p class="text">"Exceptional service and results. NeuralNomadAI's AI tools are a game-changer for content creators."</p>
|
| 237 |
-
</div>
|
| 238 |
-
</blockquote>
|
| 239 |
-
|
| 240 |
-
<blockquote class="testimonial">
|
| 241 |
-
<div class="avatar">OH</div>
|
| 242 |
-
<div class="quote">
|
| 243 |
-
<strong>Olivia Hayes</strong>
|
| 244 |
-
<p class="date">June 10, 2023</p>
|
| 245 |
-
<p class="stars">★★★★★</p>
|
| 246 |
-
<p class="text">"I'm blown away by the quality and efficiency of NeuralNomadAI. A must-have for any serious creator."</p>
|
| 247 |
-
</div>
|
| 248 |
-
</blockquote>
|
| 249 |
-
</div>
|
| 250 |
-
</section>
|
| 251 |
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
<div class="cap-card"><h4>AI-Powered Imagery</h4><p>Generate stunning visuals with AI.</p></div>
|
| 258 |
-
<div class="cap-card"><h4>Automation Tools</h4><p>Automate repetitive tasks for efficiency.</p></div>
|
| 259 |
-
<div class="cap-card"><h4>Creative Solutions</h4><p>Tailored solutions for diverse needs.</p></div>
|
| 260 |
-
<div class="cap-card"><h4>Rapid Turnaround</h4><p>Fast delivery without compromising quality.</p></div>
|
| 261 |
-
</div>
|
| 262 |
-
</section>
|
| 263 |
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
<h2 class="section-title">Featured Work</h2>
|
| 267 |
-
<p class="lead">Explore our portfolio of AI-driven projects.</p>
|
| 268 |
-
|
| 269 |
-
<div class="portfolio-grid mt-8">
|
| 270 |
-
<div class="portfolio-item"><img src="assets/portfolio-1.jpg" alt=""><h4>AI-Enhanced Photography</h4></div>
|
| 271 |
-
<div class="portfolio-item"><img src="assets/portfolio-2.jpg" alt=""><h4>Automated Content Creation</h4></div>
|
| 272 |
-
<div class="portfolio-item"><img src="assets/portfolio-3.jpg" alt=""><h4>Personalized Marketing</h4></div>
|
| 273 |
-
<div class="portfolio-item"><img src="assets/portfolio-4.jpg" alt=""><h4>Design Tools</h4></div>
|
| 274 |
-
<div class="portfolio-item"><img src="assets/portfolio-5.jpg" alt=""><h4>Interactive Installations</h4></div>
|
| 275 |
-
<div class="portfolio-item"><img src="assets/portfolio-6.jpg" alt=""><h4>Data Visualization</h4></div>
|
| 276 |
-
</div>
|
| 277 |
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 281 |
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
<div class="footer-links">
|
| 287 |
-
<a>Terms of Service</a>
|
| 288 |
-
<a>Privacy Policy</a>
|
| 289 |
-
<a>Contact Us</a>
|
| 290 |
-
</div>
|
| 291 |
-
</div>
|
| 292 |
-
</div>
|
| 293 |
-
</footer>
|
| 294 |
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
const links = document.querySelectorAll('.nav-link');
|
| 300 |
-
const pages = document.querySelectorAll('.page-content'); // not used here — we use anchors instead
|
| 301 |
-
function setActive(link) {
|
| 302 |
-
links.forEach(l => l.classList.remove('active'));
|
| 303 |
-
link.classList.add('active');
|
| 304 |
}
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
});
|
| 311 |
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 319 |
})();
|
| 320 |
</script>
|
| 321 |
</body>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8" />
|
| 5 |
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
| 6 |
+
<title>NeuralNomadAI — Gemini Share Embed Demo</title>
|
| 7 |
|
| 8 |
<!-- Google fonts -->
|
| 9 |
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap" rel="stylesheet">
|
| 10 |
|
| 11 |
+
<!-- Tailwind utilities CDN -->
|
| 12 |
<script src="https://cdn.tailwindcss.com?plugins=forms"></script>
|
| 13 |
+
|
| 14 |
+
<!-- Local CSS -->
|
| 15 |
<link rel="stylesheet" href="style.css">
|
| 16 |
</head>
|
| 17 |
+
<body class="font-display bg-gradient-to-b from-[#071017] to-[#07121a] text-gray-100">
|
| 18 |
|
| 19 |
+
<!-- Simple header -->
|
| 20 |
<header class="site-header">
|
| 21 |
<div class="container nav-inner">
|
| 22 |
<div class="brand">
|
| 23 |
+
<div class="logo" aria-hidden="true"></div>
|
| 24 |
<span class="brand-name">NeuralNomadAI</span>
|
| 25 |
</div>
|
| 26 |
<nav class="nav-links" aria-label="Primary Navigation">
|
| 27 |
+
<a href="#home" class="nav-link active">Home</a>
|
| 28 |
+
<a href="#services" class="nav-link">Services</a>
|
| 29 |
+
<a href="#portfolio" class="nav-link">Portfolio</a>
|
| 30 |
+
<a href="#contact" class="nav-link">Contact</a>
|
|
|
|
| 31 |
</nav>
|
| 32 |
<div class="nav-cta">
|
| 33 |
<button class="btn btn-outline">Login</button>
|
|
|
|
| 41 |
<div class="hero-overlay"></div>
|
| 42 |
<div class="container hero-inner">
|
| 43 |
<h1 class="hero-title">Unleash Your Creative Vision with AI</h1>
|
| 44 |
+
<p class="hero-sub">NeuralNomadAI empowers creators with cutting-edge AI tools for imagery and automation.</p>
|
| 45 |
+
|
| 46 |
+
<div class="hero-ctas mt-6">
|
| 47 |
<a href="#contact" class="btn btn-primary large">Get Started</a>
|
| 48 |
<a href="#services" class="btn btn-muted large">Explore Features</a>
|
| 49 |
</div>
|
| 50 |
+
|
| 51 |
+
<!-- Gemini share preview card (centered under CTAs) -->
|
| 52 |
+
<div class="mt-8 flex justify-center">
|
| 53 |
+
<div class="gemini-card" id="geminiCard" role="region" aria-labelledby="geminiTitle" aria-describedby="geminiDesc">
|
| 54 |
+
<div class="gemini-thumb" aria-hidden="true">
|
| 55 |
+
<!-- stylized thumbnail or icon -->
|
| 56 |
+
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" class="text-sky-400" xmlns="http://www.w3.org/2000/svg">
|
| 57 |
+
<rect width="24" height="24" rx="6" fill="currentColor" opacity="0.12"/>
|
| 58 |
+
<path d="M8 12h8M8 8h8M8 16h8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
| 59 |
+
</svg>
|
| 60 |
+
</div>
|
| 61 |
+
<div class="gemini-meta">
|
| 62 |
+
<h3 id="geminiTitle" class="gemini-title">View Gemini Share</h3>
|
| 63 |
+
<p id="geminiDesc" class="gemini-desc">Interactive preview — opens an in-page viewer that mirrors the shared Gemini conversation.</p>
|
| 64 |
+
<div class="gemini-actions">
|
| 65 |
+
<button id="openGeminiBtn" class="btn btn-primary small">Open Preview</button>
|
| 66 |
+
<a id="openGeminiNewTab" class="btn btn-outline small" target="_blank" rel="noopener">Open in new tab</a>
|
| 67 |
+
<button id="copyGeminiLink" class="btn btn-muted small">Copy Link</button>
|
| 68 |
+
</div>
|
| 69 |
+
</div>
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
| 72 |
</div>
|
| 73 |
</section>
|
| 74 |
|
| 75 |
<main>
|
| 76 |
+
<!-- rest of the page content simplified for the demo -->
|
| 77 |
+
<section class="container section text-center">
|
| 78 |
<h2 class="section-title">Quick Pitch</h2>
|
| 79 |
+
<p class="lead">NeuralNomadAI — modern interface, Gemini share preview embedded for demonstration.</p>
|
| 80 |
</section>
|
| 81 |
+
</main>
|
| 82 |
|
| 83 |
+
<!-- Footer -->
|
| 84 |
+
<footer class="site-footer">
|
| 85 |
+
<div class="container footer-row">
|
| 86 |
+
<div>© 2025 NeuralNomadAI. All rights reserved.</div>
|
| 87 |
+
<div class="footer-links">
|
| 88 |
+
<a>Terms</a>
|
| 89 |
+
<a>Privacy</a>
|
| 90 |
+
<a>Contact</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
</div>
|
| 92 |
+
</div>
|
| 93 |
+
</footer>
|
| 94 |
|
| 95 |
+
<!-- Modal for Gemini iframe -->
|
| 96 |
+
<div id="geminiModal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="modalTitle" aria-hidden="true">
|
| 97 |
+
<div class="modal-backdrop" data-close="true"></div>
|
| 98 |
+
<div class="modal-panel" role="document">
|
| 99 |
+
<header class="modal-header">
|
| 100 |
+
<h3 id="modalTitle">Gemini Share Preview</h3>
|
| 101 |
+
<div class="modal-controls">
|
| 102 |
+
<button id="copyLinkModal" class="btn btn-muted small">Copy Link</button>
|
| 103 |
+
<a id="openNewTabModal" class="btn btn-outline small" target="_blank" rel="noopener">Open in new tab</a>
|
| 104 |
+
<button id="closeModal" class="btn btn-outline small" aria-label="Close preview">Close</button>
|
| 105 |
+
</div>
|
| 106 |
+
</header>
|
| 107 |
|
| 108 |
+
<div class="modal-body">
|
| 109 |
+
<!-- lazy-loaded iframe -->
|
| 110 |
+
<div id="iframeContainer" class="iframe-container" aria-live="polite">
|
| 111 |
+
<div class="iframe-fallback">
|
| 112 |
+
Loading preview... If the preview cannot be shown, you can open it in a new tab.
|
| 113 |
+
</div>
|
| 114 |
+
<!-- iframe element will be created dynamically on demand -->
|
| 115 |
+
</div>
|
| 116 |
</div>
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
|
| 120 |
+
<script>
|
| 121 |
+
// ==== Gemini share integration script ====
|
| 122 |
+
(function () {
|
| 123 |
+
const GEMINI_URL = 'https://g.co/gemini/share/4388c23581b0'; // provided share URL
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
+
const openGeminiBtn = document.getElementById('openGeminiBtn');
|
| 126 |
+
const openGeminiNewTab = document.getElementById('openGeminiNewTab');
|
| 127 |
+
const copyGeminiLink = document.getElementById('copyGeminiLink');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
+
const geminiModal = document.getElementById('geminiModal');
|
| 130 |
+
const iframeContainer = document.getElementById('iframeContainer');
|
| 131 |
+
const closeModalBtn = document.getElementById('closeModal');
|
| 132 |
+
const copyLinkModal = document.getElementById('copyLinkModal');
|
| 133 |
+
const openNewTabModal = document.getElementById('openNewTabModal');
|
|
|
|
|
|
|
| 134 |
|
| 135 |
+
// Set the anchor hrefs
|
| 136 |
+
openGeminiNewTab.href = GEMINI_URL;
|
| 137 |
+
openNewTabModal.href = GEMINI_URL;
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
+
// Copy helper
|
| 140 |
+
async function copyToClipboard(text) {
|
| 141 |
+
try {
|
| 142 |
+
await navigator.clipboard.writeText(text);
|
| 143 |
+
return true;
|
| 144 |
+
} catch (err) {
|
| 145 |
+
console.warn('Clipboard copy failed:', err);
|
| 146 |
+
return false;
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
|
| 150 |
+
// Create iframe lazily and inject to container
|
| 151 |
+
function createIframe(url) {
|
| 152 |
+
// remove any previous iframe
|
| 153 |
+
iframeContainer.querySelectorAll('iframe').forEach(n => n.remove());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
+
const iframe = document.createElement('iframe');
|
| 156 |
+
iframe.className = 'gemini-iframe';
|
| 157 |
+
// set src only when creating (lazy)
|
| 158 |
+
iframe.src = url;
|
| 159 |
+
// sandbox to reduce risk; allow-same-origin if Gemini needs it
|
| 160 |
+
// You can adjust sandbox flags if needed.
|
| 161 |
+
iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups');
|
| 162 |
+
iframe.setAttribute('loading', 'lazy');
|
| 163 |
+
iframe.setAttribute('referrerpolicy', 'no-referrer');
|
| 164 |
+
iframe.setAttribute('title', 'Gemini share preview');
|
| 165 |
|
| 166 |
+
// optional: handle load / error states
|
| 167 |
+
iframe.addEventListener('load', () => {
|
| 168 |
+
// hide fallback message
|
| 169 |
+
const fb = iframeContainer.querySelector('.iframe-fallback');
|
| 170 |
+
if (fb) fb.style.display = 'none';
|
| 171 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
+
iframe.addEventListener('error', () => {
|
| 174 |
+
const fb = iframeContainer.querySelector('.iframe-fallback');
|
| 175 |
+
if (fb) fb.textContent = 'Preview failed to load. You can open the share in a new tab.';
|
| 176 |
+
// remove iframe to avoid confusion
|
| 177 |
+
iframe.remove();
|
| 178 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
|
| 180 |
+
iframeContainer.appendChild(iframe);
|
| 181 |
+
return iframe;
|
| 182 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
+
// Open modal (creates iframe if needed)
|
| 185 |
+
function openModal() {
|
| 186 |
+
// show modal
|
| 187 |
+
geminiModal.classList.remove('hidden');
|
| 188 |
+
geminiModal.setAttribute('aria-hidden', 'false');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
|
| 190 |
+
// Focus management: focus the close button quickly
|
| 191 |
+
closeModalBtn.focus();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
+
// If there's no iframe yet, create it lazily
|
| 194 |
+
if (!iframeContainer.querySelector('iframe')) {
|
| 195 |
+
createIframe(GEMINI_URL);
|
| 196 |
+
}
|
| 197 |
+
// add key listener for Esc
|
| 198 |
+
document.addEventListener('keydown', onKeyDown);
|
| 199 |
+
trapFocus(geminiModal);
|
| 200 |
+
}
|
| 201 |
|
| 202 |
+
// Close modal and clean up
|
| 203 |
+
function closeModal() {
|
| 204 |
+
geminiModal.classList.add('hidden');
|
| 205 |
+
geminiModal.setAttribute('aria-hidden', 'true');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
|
| 207 |
+
// Optionally keep the iframe for faster reopen, or remove to free memory:
|
| 208 |
+
// iframeContainer.querySelectorAll('iframe').forEach(i => i.remove());
|
| 209 |
+
document.removeEventListener('keydown', onKeyDown);
|
| 210 |
+
releaseFocusTrap();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
}
|
| 212 |
+
|
| 213 |
+
function onKeyDown(e) {
|
| 214 |
+
if (e.key === 'Escape') closeModal();
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
// Basic focus trap for accessibility
|
| 218 |
+
let previousActive = null;
|
| 219 |
+
function trapFocus(modal) {
|
| 220 |
+
previousActive = document.activeElement;
|
| 221 |
+
const focusable = modal.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])');
|
| 222 |
+
const first = focusable[0];
|
| 223 |
+
const last = focusable[focusable.length - 1];
|
| 224 |
+
function handleTrap(e) {
|
| 225 |
+
if (e.key !== 'Tab') return;
|
| 226 |
+
if (e.shiftKey && document.activeElement === first) {
|
| 227 |
+
e.preventDefault();
|
| 228 |
+
last.focus();
|
| 229 |
+
} else if (!e.shiftKey && document.activeElement === last) {
|
| 230 |
+
e.preventDefault();
|
| 231 |
+
first.focus();
|
| 232 |
+
}
|
| 233 |
+
}
|
| 234 |
+
modal._trapHandler = handleTrap;
|
| 235 |
+
modal.addEventListener('keydown', handleTrap);
|
| 236 |
+
}
|
| 237 |
+
function releaseFocusTrap() {
|
| 238 |
+
const modal = geminiModal;
|
| 239 |
+
if (modal && modal._trapHandler) {
|
| 240 |
+
modal.removeEventListener('keydown', modal._trapHandler);
|
| 241 |
+
modal._trapHandler = null;
|
| 242 |
+
}
|
| 243 |
+
if (previousActive && previousActive.focus) previousActive.focus();
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
// clicking the backdrop closes modal
|
| 247 |
+
document.querySelectorAll('.modal-backdrop').forEach(b => {
|
| 248 |
+
b.addEventListener('click', closeModal);
|
| 249 |
+
});
|
| 250 |
+
|
| 251 |
+
// Event bindings
|
| 252 |
+
openGeminiBtn.addEventListener('click', openModal);
|
| 253 |
+
closeModalBtn.addEventListener('click', closeModal);
|
| 254 |
+
|
| 255 |
+
copyGeminiLink.addEventListener('click', async () => {
|
| 256 |
+
const ok = await copyToClipboard(GEMINI_URL);
|
| 257 |
+
const btn = copyGeminiLink;
|
| 258 |
+
const orig = btn.textContent;
|
| 259 |
+
btn.textContent = ok ? 'Copied!' : 'Copy failed';
|
| 260 |
+
setTimeout(() => btn.textContent = orig, 1600);
|
| 261 |
});
|
| 262 |
|
| 263 |
+
copyLinkModal.addEventListener('click', async () => {
|
| 264 |
+
const ok = await copyToClipboard(GEMINI_URL);
|
| 265 |
+
const btn = copyLinkModal;
|
| 266 |
+
const orig = btn.textContent;
|
| 267 |
+
btn.textContent = ok ? 'Copied!' : 'Copy failed';
|
| 268 |
+
setTimeout(() => btn.textContent = orig, 1600);
|
| 269 |
});
|
| 270 |
+
|
| 271 |
+
// If iframe is blocked by X-Frame-Options/CSP, the iframe will error and fallback message will show.
|
| 272 |
+
// The "Open in new tab" link remains available as a reliable fallback.
|
| 273 |
+
|
| 274 |
+
// Small enhancement: try to preconnect to the domain to reduce latency (non-blocking)
|
| 275 |
+
(function preconnect() {
|
| 276 |
+
try {
|
| 277 |
+
const l = document.createElement('link');
|
| 278 |
+
l.rel = 'preconnect';
|
| 279 |
+
l.href = 'https://g.co';
|
| 280 |
+
l.crossOrigin = 'anonymous';
|
| 281 |
+
document.head.appendChild(l);
|
| 282 |
+
} catch (e) { /* noop */ }
|
| 283 |
+
})();
|
| 284 |
})();
|
| 285 |
</script>
|
| 286 |
</body>
|