<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Share Button Generator</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: #fafafa;
color: #0a0a0a;
line-height: 1.6;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 0 32px;
}
/* Header */
.header {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
padding: 64px 0;
text-align: center;
color: white;
}
.header h1 {
font-size: 3.5rem;
font-weight: 800;
margin-bottom: 20px;
letter-spacing: -0.025em;
}
.header p {
font-size: 1.3rem;
opacity: 0.9;
max-width: 700px;
margin: 0 auto;
}
/* Main */
.main {
padding: 80px 0;
}
.layout {
display: grid;
grid-template-columns: 400px 1fr;
gap: 80px;
align-items: start;
}
/* Left Panel */
.left-panel {
background: white;
border-radius: 20px;
padding: 40px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
border: 1px solid #e5e5e5;
position: sticky;
top: 40px;
}
.section {
margin-bottom: 40px;
}
.section:last-child {
margin-bottom: 0;
}
.section-title {
font-size: 18px;
font-weight: 700;
color: #0a0a0a;
margin-bottom: 20px;
}
/* Platform Grid */
.platform-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
.platform-card {
background: #fafafa;
border: 2px solid #e5e5e5;
border-radius: 12px;
padding: 16px;
cursor: pointer;
transition: all 0.2s ease;
text-align: center;
}
.platform-card:hover {
border-color: #6366f1;
background: #f8faff;
}
.platform-card.selected {
border-color: #6366f1;
background: #f8faff;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.platform-checkbox {
display: none;
}
.platform-name {
font-size: 15px;
font-weight: 600;
color: #0a0a0a;
}
/* Form Elements */
.form-group {
margin-bottom: 24px;
}
.form-group:last-child {
margin-bottom: 0;
}
.form-label {
display: block;
font-size: 15px;
font-weight: 600;
color: #0a0a0a;
margin-bottom: 12px;
}
.form-input, .form-select, .form-textarea {
width: 100%;
padding: 16px;
border: 2px solid #e5e5e5;
border-radius: 12px;
font-size: 15px;
background: white;
transition: all 0.2s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
outline: none;
border-color: #6366f1;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.form-textarea {
resize: vertical;
min-height: 100px;
}
.form-hint {
font-size: 14px;
color: #666;
margin-top: 8px;
}
.radio-group {
display: flex;
flex-direction: column;
gap: 16px;
}
.radio-card {
background: #fafafa;
border: 2px solid #e5e5e5;
border-radius: 12px;
padding: 16px;
cursor: pointer;
transition: all 0.2s ease;
}
.radio-card:hover {
border-color: #6366f1;
background: #f8faff;
}
.radio-card.selected {
border-color: #6366f1;
background: #f8faff;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.radio-input {
display: none;
}
.radio-label {
font-size: 15px;
font-weight: 600;
color: #0a0a0a;
cursor: pointer;
}
.style-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
/* Right Panel */
.right-panel {
display: flex;
flex-direction: column;
gap: 40px;
}
.preview-section, .code-section {
background: white;
border-radius: 20px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
border: 1px solid #e5e5e5;
overflow: hidden;
}
.section-header {
padding: 32px 40px;
border-bottom: 1px solid #e5e5e5;
background: #fafafa;
}
.section-header-title {
font-size: 20px;
font-weight: 700;
color: #0a0a0a;
}
.preview-content {
padding: 60px 40px;
min-height: 200px;
display: flex;
align-items: center;
justify-content: center;
background: white;
position: relative;
}
.preview-floating {
position: absolute;
bottom: 32px;
right: 32px;
}
/* AI Share Buttons */
.ai-share-buttons {
display: flex;
flex-wrap: wrap;
gap: 16px;
align-items: center;
}
.ai-share-button {
padding: 14px 24px;
border-radius: 10px;
font-size: 15px;
font-weight: 600;
color: white;
text-decoration: none;
border: none;
cursor: pointer;
transition: all 0.2s ease;
display: inline-block;
}
.ai-share-button:hover {
transform: translateY(-2px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}
.size-small .ai-share-button {
padding: 10px 18px;
font-size: 14px;
}
.size-large .ai-share-button {
padding: 18px 32px;
font-size: 16px;
}
.shape-square .ai-share-button {
border-radius: 6px;
}
.shape-pill .ai-share-button {
border-radius: 50px;
}
.btn-chatgpt { background: linear-gradient(135deg, #10a37f 0%, #0ea472 100%); }
.btn-claude { background: linear-gradient(135deg, #c93c3c 0%, #b73333 100%); }
.btn-perplexity { background: linear-gradient(135deg, #7a49f3 0%, #6d42e0 100%); }
/* Code Section */
.code-content {
padding: 40px;
}
.code-header-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32px;
}
.generate-btn {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
color: white;
border: none;
padding: 16px 32px;
border-radius: 12px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.generate-btn:hover {
transform: translateY(-2px);
box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}
.code-description {
color: #666;
margin-bottom: 32px;
font-size: 16px;
}
.code-output-container {
background: #f8f8f8;
border: 1px solid #e5e5e5;
border-radius: 16px;
position: relative;
overflow: hidden;
}
.code-output-header {
padding: 16px 24px;
background: #f0f0f0;
border-bottom: 1px solid #e5e5e5;
display: flex;
justify-content: space-between;
align-items: center;
}
.code-output-title {
font-size: 14px;
font-weight: 600;
color: #666;
}
.copy-btn {
background: white;
border: 1px solid #d0d0d0;
padding: 8px 16px;
border-radius: 8px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
color: #666;
}
.copy-btn:hover {
background: #f5f5f5;
border-color: #999;
}
.copy-btn.copied {
background: #10b981;
color: white;
border-color: #10b981;
}
.code-output {
padding: 32px;
font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
font-size: 14px;
line-height: 1.7;
color: #333;
background: white;
border: none;
margin: 0;
max-height: 500px;
overflow-y: auto;
white-space: pre-wrap;
}
.empty-state {
color: #999;
font-style: italic;
text-align: center;
padding: 40px;
}
.ai-share-floating {
position: fixed;
bottom: 32px;
right: 32px;
background: white;
padding: 20px;
border-radius: 16px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
z-index: 1000;
}
@media (max-width: 1200px) {
.layout {
grid-template-columns: 1fr;
gap: 40px;
}
.left-panel {
position: static;
}
}
@media (max-width: 768px) {
.container {
padding: 0 20px;
}
.header h1 {
font-size: 2.5rem;
}
.header p {
font-size: 1.1rem;
}
.left-panel {
padding: 32px;
}
.preview-content {
padding: 40px 20px;
}
.code-content {
padding: 32px;
}
.platform-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="header">
<div class="container">
<h1>AI Share Button Generator</h1>
<p>Create beautiful sharing buttons that let visitors open your content in ChatGPT, Claude, and Perplexity</p>
</div>
</div>
<div class="main">
<div class="container">
<div class="layout">
<!-- Left Panel -->
<div class="left-panel">
<div class="section">
<div class="section-title">Select AI Platforms</div>
<div class="platform-grid">
<div class="platform-card selected" data-platform="chatgpt">
<input type="checkbox" class="platform-checkbox" value="chatgpt" checked>
<div class="platform-name">ChatGPT</div>
</div>
<div class="platform-card selected" data-platform="claude">
<input type="checkbox" class="platform-checkbox" value="claude" checked>
<div class="platform-name">Claude</div>
</div>
<div class="platform-card selected" data-platform="perplexity">
<input type="checkbox" class="platform-checkbox" value="perplexity" checked>
<div class="platform-name">Perplexity</div>
</div>
</div>
</div>
<div class="section">
<div class="section-title">URL Configuration</div>
<div class="radio-group">
<div class="radio-card selected">
<input type="radio" class="radio-input" name="urlType" value="dynamic" checked>
<div class="radio-label">Dynamic (current page URL)</div>
</div>
<div class="radio-card">
<input type="radio" class="radio-input" name="urlType" value="static">
<div class="radio-label">Static URL</div>
</div>
</div>
<div class="form-group" style="margin-top: 20px;">
<input type="url" class="form-input" id="staticUrl" placeholder="https://example.com/page" disabled>
</div>
</div>
<div class="section">
<div class="form-group">
<div class="form-label">Prompt Template</div>
<textarea class="form-textarea" id="promptTemplate">Summarize and analyze this content: {{url}}</textarea>
<div class="form-hint">Use {{url}} for dynamic URL insertion</div>
</div>
</div>
<div class="section">
<div class="section-title">Button Style</div>
<div class="style-grid">
<div class="form-group">
<div class="form-label">Size</div>
<select class="form-select" id="buttonSize">
<option value="small">Small</option>
<option value="medium" selected>Medium</option>
<option value="large">Large</option>
</select>
</div>
<div class="form-group">
<div class="form-label">Shape</div>
<select class="form-select" id="buttonShape">
<option value="default">Rounded</option>
<option value="square">Square</option>
<option value="pill">Pill</option>
</select>
</div>
</div>
</div>
<div class="section">
<div class="section-title">Placement</div>
<div class="radio-group">
<div class="radio-card selected">
<input type="radio" class="radio-input" name="placement" value="inline" checked>
<div class="radio-label">Inline with content</div>
</div>
<div class="radio-card">
<input type="radio" class="radio-input" name="placement" value="floating">
<div class="radio-label">Floating widget</div>
</div>
</div>
</div>
</div>
<!-- Right Panel -->
<div class="right-panel">
<!-- Preview Section -->
<div class="preview-section">
<div class="section-header">
<div class="section-header-title">Live Preview</div>
</div>
<div class="preview-content" id="previewArea">
<div id="previewButtons" class="empty-state">
Select platforms to see preview
</div>
</div>
</div>
<!-- Code Section -->
<div class="code-section">
<div class="section-header">
<div class="section-header-title">Generated Code</div>
</div>
<div class="code-content">
<div class="code-header-row">
<div class="code-description">
Complete HTML, CSS, and JavaScript code ready to copy and paste into your website.
</div>
<button class="generate-btn" onclick="generateCode()">
Generate Code
</button>
</div>
<div class="code-output-container">
<div class="code-output-header">
<div class="code-output-title">HTML + CSS + JavaScript</div>
<button class="copy-btn" onclick="copyToClipboard()">Copy Code</button>
</div>
<div class="code-output" id="codeOutput">Configure your options and click "Generate Code" to create your AI share buttons</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
const platforms = {
chatgpt: { name: 'ChatGPT', url: 'https://chat.openai.com/?q=', className: 'btn-chatgpt' },
claude: { name: 'Claude', url: 'https://claude.ai/new?q=', className: 'btn-claude' },
perplexity: { name: 'Perplexity', url: 'https://www.perplexity.ai/search/new?q=', className: 'btn-perplexity' }
};
document.addEventListener('DOMContentLoaded', function() {
// Platform cards
document.querySelectorAll('.platform-card').forEach(card => {
const checkbox = card.querySelector('.platform-checkbox');
card.addEventListener('click', function() {
checkbox.checked = !checkbox.checked;
card.classList.toggle('selected', checkbox.checked);
updatePreview();
});
});
// Radio cards
document.querySelectorAll('.radio-card').forEach(card => {
const radio = card.querySelector('.radio-input');
card.addEventListener('click', function() {
if (radio.name === 'urlType') {
document.querySelectorAll('input[name="urlType"]').forEach(r => {
r.closest('.radio-card').classList.remove('selected');
});
document.getElementById('staticUrl').disabled = radio.value === 'dynamic';
} else if (radio.name === 'placement') {
document.querySelectorAll('input[name="placement"]').forEach(r => {
r.closest('.radio-card').classList.remove('selected');
});
}
radio.checked = true;
card.classList.add('selected');
updatePreview();
});
});
// Form changes
document.querySelectorAll('input, select, textarea').forEach(element => {
element.addEventListener('change', updatePreview);
element.addEventListener('input', updatePreview);
});
updatePreview();
});
function updatePreview() {
const selectedPlatforms = Array.from(document.querySelectorAll('.platform-checkbox:checked')).map(cb => cb.value);
const buttonSize = document.getElementById('buttonSize').value;
const buttonShape = document.getElementById('buttonShape').value;
const placement = document.querySelector('input[name="placement"]:checked').value;
const previewButtons = document.getElementById('previewButtons');
if (selectedPlatforms.length === 0) {
previewButtons.innerHTML = '<div class="empty-state">Select platforms to see preview</div>';
return;
}
let buttonsHTML = '<div class="ai-share-buttons">';
selectedPlatforms.forEach(platformKey => {
const platform = platforms[platformKey];
buttonsHTML += `<a href="#" class="ai-share-button ${platform.className}" onclick="return false;">${platform.name}</a>`;
});
buttonsHTML += '</div>';
const container = document.createElement('div');
container.innerHTML = buttonsHTML;
container.className = `size-${buttonSize} shape-${buttonShape}`;
if (placement === 'floating') {
container.classList.add('ai-share-floating');
}
previewButtons.innerHTML = '';
previewButtons.appendChild(container);
}
function generateCode() {
const selectedPlatforms = Array.from(document.querySelectorAll('.platform-checkbox:checked')).map(cb => cb.value);
if (selectedPlatforms.length === 0) {
alert('Please select at least one AI platform.');
return;
}
const urlType = document.querySelector('input[name="urlType"]:checked').value;
const staticUrl = document.getElementById('staticUrl').value || '';
const promptTemplate = document.getElementById('promptTemplate').value;
const buttonSize = document.getElementById('buttonSize').value;
const buttonShape = document.getElementById('buttonShape').value;
const placement = document.querySelector('input[name="placement"]:checked').value;
const code = generateCompleteCode(selectedPlatforms, urlType, staticUrl, promptTemplate, buttonSize, buttonShape, placement);
document.getElementById('codeOutput').textContent = code;
}
function generateCompleteCode(selectedPlatforms, urlType, staticUrl, promptTemplate, buttonSize, buttonShape, placement) {
const lines = [];
lines.push('<!-- AI Share Buttons - Generated by Chris Lever SEO Tools -->');
const wrapperClass = 'ai-share-wrapper' + (placement === 'floating' ? ' ai-share-floating' : '');
lines.push(`<div class="${wrapperClass}">`);
lines.push(` <div class="ai-share-buttons size-${buttonSize} shape-${buttonShape}">`);
selectedPlatforms.forEach(platformKey => {
const platform = platforms[platformKey];
lines.push(` <a href="#" class="${platform.className}" onclick="shareToAI('${platformKey}'); return false;">${platform.name}</a>`);
});
lines.push(' </div>');
lines.push('</div>');
lines.push('');
lines.push('<' + 'script>');
lines.push('function shareToAI(platform) {');
lines.push(` const url = ${urlType === 'dynamic' ? 'window.location.href' : `"${staticUrl}"`};`);
lines.push(` const prompt = "${promptTemplate.replace(/"/g, '\\"')}".replace("{{url}}", url);`);
lines.push(' const urls = {');
Object.entries(platforms).forEach(([key, platform]) => {
lines.push(` ${key}: "${platform.url}",`);
});
lines.push(' };');
lines.push(' window.open(urls[platform] + encodeURIComponent(prompt), "_blank", "noopener,noreferrer");');
lines.push('}');
lines.push('</' + 'script>');
lines.push('');
lines.push('<style>');
lines.push('.ai-share-wrapper { margin: 20px 0; }');
if (placement === 'floating') {
lines.push('.ai-share-floating {');
lines.push(' position: fixed; bottom: 32px; right: 32px; z-index: 1000;');
lines.push(' background: white; padding: 20px; border-radius: 16px;');
lines.push(' box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);');
lines.push('}');
}
lines.push('.ai-share-buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }');
lines.push('.ai-share-buttons a {');
const sizes = {
small: 'padding: 12px 20px; font-size: 14px; border-radius: 10px',
medium: 'padding: 16px 28px; font-size: 15px; border-radius: 12px',
large: 'padding: 20px 36px; font-size: 16px; border-radius: 14px'
};
const shapes = { default: '', square: ' border-radius: 8px;', pill: ' border-radius: 50px;' };
lines.push(` ${sizes[buttonSize]};${buttonShape !== 'default' ? shapes[buttonShape] : ''}`);
lines.push(' font-weight: 700; color: white; text-decoration: none; position: relative;');
lines.push(' display: inline-flex; align-items: center; justify-content: center;');
lines.push(' transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden;');
lines.push(' box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);');
lines.push('}');
lines.push('.ai-share-buttons a::before {');
lines.push(' content: ""; position: absolute; inset: 0;');
lines.push(' background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);');
lines.push(' opacity: 0; transition: opacity 0.3s ease;');
lines.push('}');
lines.push('.ai-share-buttons a:hover::before { opacity: 1; }');
lines.push('.ai-share-buttons a:hover {');
lines.push(' transform: translateY(-3px) scale(1.02);');
lines.push(' box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 6px 6px rgba(0, 0, 0, 0.1);');
lines.push('}');
const colors = {
chatgpt: 'linear-gradient(135deg, #10a37f 0%, #0ea472 100%)',
claude: 'linear-gradient(135deg, #c93c3c 0%, #b73333 100%)',
perplexity: 'linear-gradient(135deg, #7a49f3 0%, #6d42e0 100%)'
};
Object.entries(platforms).forEach(([key, platform]) => {
lines.push(`.${platform.className} { background: ${colors[key]}; }`);
});
lines.push('</style>');
return lines.join('\n');
}
function copyToClipboard() {
const codeOutput = document.getElementById('codeOutput');
const text = codeOutput.textContent;
if (text.includes('Configure your options')) {
alert('Please generate the code first by clicking "Generate Code"');
return;
}
navigator.clipboard.writeText(text).then(() => {
const btn = document.querySelector('.copy-btn');
const originalText = btn.textContent;
btn.textContent = 'Copied!';
btn.classList.add('copied');
setTimeout(() => {
btn.textContent = originalText;
btn.classList.remove('copied');
}, 2000);
}).catch(() => {
alert('Failed to copy. Please select and copy the code manually.');
});
}
</script>
</body>
</html>