Spaces:
Running
Running
File size: 11,374 Bytes
16ee67f cece0b1 16ee67f 8aa751b cece0b1 49ada05 8aa751b cece0b1 8aa751b 49ada05 cece0b1 49ada05 cece0b1 8aa751b 49ada05 cece0b1 49ada05 cece0b1 49ada05 cece0b1 49ada05 cece0b1 49ada05 cece0b1 49ada05 cece0b1 49ada05 cece0b1 49ada05 cece0b1 49ada05 cece0b1 49ada05 8aa751b 49ada05 8aa751b 49ada05 cece0b1 49ada05 cece0b1 49ada05 8aa751b 49ada05 cece0b1 49ada05 8aa751b 49ada05 8aa751b 49ada05 8aa751b 49ada05 cece0b1 49ada05 8aa751b 49ada05 8aa751b 49ada05 8aa751b 49ada05 cece0b1 49ada05 cece0b1 49ada05 cece0b1 49ada05 8aa751b 49ada05 cece0b1 49ada05 8aa751b 49ada05 8aa751b 49ada05 8aa751b cece0b1 49ada05 8aa751b 49ada05 cece0b1 8aa751b 16ee67f 8aa751b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
<!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>NeuralNomadAI — Gemini Share Embed Demo</title>
<!-- Google fonts -->
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap" rel="stylesheet">
<!-- Tailwind utilities CDN -->
<script src="https://cdn.tailwindcss.com?plugins=forms"></script>
<!-- Local CSS -->
<link rel="stylesheet" href="style.css">
</head>
<body class="font-display bg-gradient-to-b from-[#071017] to-[#07121a] text-gray-100">
<!-- Simple header -->
<header class="site-header">
<div class="container nav-inner">
<div class="brand">
<div class="logo" aria-hidden="true"></div>
<span class="brand-name">NeuralNomadAI</span>
</div>
<nav class="nav-links" aria-label="Primary Navigation">
<a href="#home" class="nav-link active">Home</a>
<a href="#services" class="nav-link">Services</a>
<a href="#portfolio" class="nav-link">Portfolio</a>
<a href="#contact" class="nav-link">Contact</a>
</nav>
<div class="nav-cta">
<button class="btn btn-outline">Login</button>
<button class="btn btn-primary">Get Started</button>
</div>
</div>
</header>
<!-- HERO -->
<section id="home" class="hero-section">
<div class="hero-overlay"></div>
<div class="container hero-inner">
<h1 class="hero-title">Unleash Your Creative Vision with AI</h1>
<p class="hero-sub">NeuralNomadAI empowers creators with cutting-edge AI tools for imagery and automation.</p>
<div class="hero-ctas mt-6">
<a href="#contact" class="btn btn-primary large">Get Started</a>
<a href="#services" class="btn btn-muted large">Explore Features</a>
</div>
<!-- Gemini share preview card (centered under CTAs) -->
<div class="mt-8 flex justify-center">
<div class="gemini-card" id="geminiCard" role="region" aria-labelledby="geminiTitle" aria-describedby="geminiDesc">
<div class="gemini-thumb" aria-hidden="true">
<!-- stylized thumbnail or icon -->
<svg width="64" height="64" viewBox="0 0 24 24" fill="none" class="text-sky-400" xmlns="http://www.w3.org/2000/svg">
<rect width="24" height="24" rx="6" fill="currentColor" opacity="0.12"/>
<path d="M8 12h8M8 8h8M8 16h8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
<div class="gemini-meta">
<h3 id="geminiTitle" class="gemini-title">View Gemini Share</h3>
<p id="geminiDesc" class="gemini-desc">Interactive preview — opens an in-page viewer that mirrors the shared Gemini conversation.</p>
<div class="gemini-actions">
<button id="openGeminiBtn" class="btn btn-primary small">Open Preview</button>
<a id="openGeminiNewTab" class="btn btn-outline small" target="_blank" rel="noopener">Open in new tab</a>
<button id="copyGeminiLink" class="btn btn-muted small">Copy Link</button>
</div>
</div>
</div>
</div>
</div>
</section>
<main>
<!-- rest of the page content simplified for the demo -->
<section class="container section text-center">
<h2 class="section-title">Quick Pitch</h2>
<p class="lead">NeuralNomadAI — modern interface, Gemini share preview embedded for demonstration.</p>
</section>
</main>
<!-- Footer -->
<footer class="site-footer">
<div class="container footer-row">
<div>© 2025 NeuralNomadAI. All rights reserved.</div>
<div class="footer-links">
<a>Terms</a>
<a>Privacy</a>
<a>Contact</a>
</div>
</div>
</footer>
<!-- Modal for Gemini iframe -->
<div id="geminiModal" class="modal hidden" role="dialog" aria-modal="true" aria-labelledby="modalTitle" aria-hidden="true">
<div class="modal-backdrop" data-close="true"></div>
<div class="modal-panel" role="document">
<header class="modal-header">
<h3 id="modalTitle">Gemini Share Preview</h3>
<div class="modal-controls">
<button id="copyLinkModal" class="btn btn-muted small">Copy Link</button>
<a id="openNewTabModal" class="btn btn-outline small" target="_blank" rel="noopener">Open in new tab</a>
<button id="closeModal" class="btn btn-outline small" aria-label="Close preview">Close</button>
</div>
</header>
<div class="modal-body">
<!-- lazy-loaded iframe -->
<div id="iframeContainer" class="iframe-container" aria-live="polite">
<div class="iframe-fallback">
Loading preview... If the preview cannot be shown, you can open it in a new tab.
</div>
<!-- iframe element will be created dynamically on demand -->
</div>
</div>
</div>
</div>
<script>
// ==== Gemini share integration script ====
(function () {
const GEMINI_URL = 'https://g.co/gemini/share/4388c23581b0'; // provided share URL
const openGeminiBtn = document.getElementById('openGeminiBtn');
const openGeminiNewTab = document.getElementById('openGeminiNewTab');
const copyGeminiLink = document.getElementById('copyGeminiLink');
const geminiModal = document.getElementById('geminiModal');
const iframeContainer = document.getElementById('iframeContainer');
const closeModalBtn = document.getElementById('closeModal');
const copyLinkModal = document.getElementById('copyLinkModal');
const openNewTabModal = document.getElementById('openNewTabModal');
// Set the anchor hrefs
openGeminiNewTab.href = GEMINI_URL;
openNewTabModal.href = GEMINI_URL;
// Copy helper
async function copyToClipboard(text) {
try {
await navigator.clipboard.writeText(text);
return true;
} catch (err) {
console.warn('Clipboard copy failed:', err);
return false;
}
}
// Create iframe lazily and inject to container
function createIframe(url) {
// remove any previous iframe
iframeContainer.querySelectorAll('iframe').forEach(n => n.remove());
const iframe = document.createElement('iframe');
iframe.className = 'gemini-iframe';
// set src only when creating (lazy)
iframe.src = url;
// sandbox to reduce risk; allow-same-origin if Gemini needs it
// You can adjust sandbox flags if needed.
iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups');
iframe.setAttribute('loading', 'lazy');
iframe.setAttribute('referrerpolicy', 'no-referrer');
iframe.setAttribute('title', 'Gemini share preview');
// optional: handle load / error states
iframe.addEventListener('load', () => {
// hide fallback message
const fb = iframeContainer.querySelector('.iframe-fallback');
if (fb) fb.style.display = 'none';
});
iframe.addEventListener('error', () => {
const fb = iframeContainer.querySelector('.iframe-fallback');
if (fb) fb.textContent = 'Preview failed to load. You can open the share in a new tab.';
// remove iframe to avoid confusion
iframe.remove();
});
iframeContainer.appendChild(iframe);
return iframe;
}
// Open modal (creates iframe if needed)
function openModal() {
// show modal
geminiModal.classList.remove('hidden');
geminiModal.setAttribute('aria-hidden', 'false');
// Focus management: focus the close button quickly
closeModalBtn.focus();
// If there's no iframe yet, create it lazily
if (!iframeContainer.querySelector('iframe')) {
createIframe(GEMINI_URL);
}
// add key listener for Esc
document.addEventListener('keydown', onKeyDown);
trapFocus(geminiModal);
}
// Close modal and clean up
function closeModal() {
geminiModal.classList.add('hidden');
geminiModal.setAttribute('aria-hidden', 'true');
// Optionally keep the iframe for faster reopen, or remove to free memory:
// iframeContainer.querySelectorAll('iframe').forEach(i => i.remove());
document.removeEventListener('keydown', onKeyDown);
releaseFocusTrap();
}
function onKeyDown(e) {
if (e.key === 'Escape') closeModal();
}
// Basic focus trap for accessibility
let previousActive = null;
function trapFocus(modal) {
previousActive = document.activeElement;
const focusable = modal.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])');
const first = focusable[0];
const last = focusable[focusable.length - 1];
function handleTrap(e) {
if (e.key !== 'Tab') return;
if (e.shiftKey && document.activeElement === first) {
e.preventDefault();
last.focus();
} else if (!e.shiftKey && document.activeElement === last) {
e.preventDefault();
first.focus();
}
}
modal._trapHandler = handleTrap;
modal.addEventListener('keydown', handleTrap);
}
function releaseFocusTrap() {
const modal = geminiModal;
if (modal && modal._trapHandler) {
modal.removeEventListener('keydown', modal._trapHandler);
modal._trapHandler = null;
}
if (previousActive && previousActive.focus) previousActive.focus();
}
// clicking the backdrop closes modal
document.querySelectorAll('.modal-backdrop').forEach(b => {
b.addEventListener('click', closeModal);
});
// Event bindings
openGeminiBtn.addEventListener('click', openModal);
closeModalBtn.addEventListener('click', closeModal);
copyGeminiLink.addEventListener('click', async () => {
const ok = await copyToClipboard(GEMINI_URL);
const btn = copyGeminiLink;
const orig = btn.textContent;
btn.textContent = ok ? 'Copied!' : 'Copy failed';
setTimeout(() => btn.textContent = orig, 1600);
});
copyLinkModal.addEventListener('click', async () => {
const ok = await copyToClipboard(GEMINI_URL);
const btn = copyLinkModal;
const orig = btn.textContent;
btn.textContent = ok ? 'Copied!' : 'Copy failed';
setTimeout(() => btn.textContent = orig, 1600);
});
// If iframe is blocked by X-Frame-Options/CSP, the iframe will error and fallback message will show.
// The "Open in new tab" link remains available as a reliable fallback.
// Small enhancement: try to preconnect to the domain to reduce latency (non-blocking)
(function preconnect() {
try {
const l = document.createElement('link');
l.rel = 'preconnect';
l.href = 'https://g.co';
l.crossOrigin = 'anonymous';
document.head.appendChild(l);
} catch (e) { /* noop */ }
})();
})();
</script>
</body>
</html>
|