Added Open Graph Generator

This commit is contained in:
Тимур Абайдулин
2025-11-21 09:52:58 +03:00
parent 8ceb9e8781
commit 6b7b034d30
3 changed files with 193 additions and 2 deletions

View File

@@ -1,10 +1,31 @@
<!doctype html>
<html lang="en">
<html lang="ru">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Code Formatter</title>
<!-- Primary Meta Tags -->
<title>Code Formatter - Форматирование JSON и SQL</title>
<meta name="title" content="Code Formatter - Форматирование JSON и SQL" />
<meta name="description" content="Онлайн инструмент для форматирования и валидации JSON и SQL кода. Быстро, удобно, бесплатно." />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://formatter.abaidulin.ru/" />
<meta property="og:title" content="Code Formatter - Форматирование JSON и SQL" />
<meta property="og:description" content="Онлайн инструмент для форматирования и валидации JSON и SQL кода. Быстро, удобно, бесплатно." />
<meta property="og:image" content="https://formatter.abaidulin.ru/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://formatter.abaidulin.ru/" />
<meta property="twitter:title" content="Code Formatter - Форматирование JSON и SQL" />
<meta property="twitter:description" content="Онлайн инструмент для форматирования и валидации JSON и SQL кода. Быстро, удобно, бесплатно." />
<meta property="twitter:image" content="https://formatter.abaidulin.ru/og-image.png" />
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

143
og-preview-generator.html Normal file
View File

@@ -0,0 +1,143 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OG Image Generator</title>
<style>
body {
margin: 0;
padding: 20px;
background: #f0f0f0;
font-family: Arial, sans-serif;
}
.preview-container {
max-width: 1200px;
margin: 0 auto;
}
.og-image {
width: 1200px;
height: 630px;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
position: relative;
overflow: hidden;
box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.bracket-left {
position: absolute;
left: 60px;
top: 50px;
font-family: 'Courier New', monospace;
font-size: 180px;
color: #0f4c75;
opacity: 0.2;
font-weight: bold;
}
.bracket-right {
position: absolute;
right: 60px;
bottom: 50px;
font-family: 'Courier New', monospace;
font-size: 180px;
color: #0f4c75;
opacity: 0.2;
font-weight: bold;
}
.content {
position: relative;
z-index: 2;
text-align: center;
padding-top: 150px;
}
.title {
font-size: 84px;
font-weight: bold;
color: #ffffff;
margin: 0;
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.subtitle {
font-size: 42px;
color: #3282b8;
margin: 30px 0;
}
.features {
font-family: 'Courier New', monospace;
font-size: 32px;
color: #bbe1fa;
margin: 40px 0;
}
.url {
font-family: 'Courier New', monospace;
font-size: 28px;
color: #3282b8;
margin-top: 60px;
}
.instructions {
margin-top: 30px;
padding: 20px;
background: white;
border-radius: 8px;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
.instructions h2 {
margin-top: 0;
}
.instructions code {
background: #f5f5f5;
padding: 2px 6px;
border-radius: 3px;
font-family: monospace;
}
</style>
</head>
<body>
<div class="preview-container">
<div class="og-image" id="ogImage">
<div class="bracket-left">{</div>
<div class="bracket-right">}</div>
<div class="content">
<h1 class="title">Code Formatter</h1>
<div class="subtitle">Форматирование JSON и SQL</div>
<div class="features">✓ Валидация ✓ Подсветка ✓ Минификация</div>
<div class="url">formatter.abaidulin.ru</div>
</div>
</div>
<div class="instructions">
<h2>Инструкция по созданию og-image.png:</h2>
<ol>
<li>Откройте эту страницу в браузере</li>
<li>Сделайте скриншот области выше (1200x630px)</li>
<li>Или используйте инструменты разработчика:
<ul>
<li>Откройте DevTools (F12)</li>
<li>Введите в консоль команды ниже</li>
</ul>
</li>
<li>Сохраните как <code>og-image.png</code></li>
<li>Поместите в папку <code>/Users/at/python/claude-example/formatter/public/</code></li>
</ol>
<h3>Автоматическая генерация через консоль браузера:</h3>
<pre><code>const element = document.getElementById('ogImage');
html2canvas(element).then(canvas => {
const link = document.createElement('a');
link.download = 'og-image.png';
link.href = canvas.toDataURL();
link.click();
});
// Примечание: требуется библиотека html2canvas</code></pre>
</div>
</div>
<script>
console.log('Для автоматического сохранения можно использовать:');
console.log('1. Расширение браузера для скриншотов');
console.log('2. Онлайн сервисы: opengraph.xyz, og-image.vercel.app');
console.log('3. Команду: npm install -g pageres-cli && pageres og-preview-generator.html 1200x630 --filename=og-image');
</script>
</body>
</html>

27
public/og-image.svg Normal file
View File

@@ -0,0 +1,27 @@
<svg width="1200" height="630" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#1a1a2e;stop-opacity:1" />
<stop offset="100%" style="stop-color:#16213e;stop-opacity:1" />
</linearGradient>
</defs>
<!-- Background -->
<rect width="1200" height="630" fill="url(#bg)"/>
<!-- Decorative code brackets -->
<text x="100" y="150" font-family="monospace" font-size="120" fill="#0f4c75" opacity="0.3">{</text>
<text x="1050" y="500" font-family="monospace" font-size="120" fill="#0f4c75" opacity="0.3">}</text>
<!-- Main title -->
<text x="600" y="250" font-family="Arial, sans-serif" font-size="72" font-weight="bold" fill="#ffffff" text-anchor="middle">Code Formatter</text>
<!-- Subtitle -->
<text x="600" y="330" font-family="Arial, sans-serif" font-size="36" fill="#3282b8" text-anchor="middle">Форматирование JSON и SQL</text>
<!-- Features -->
<text x="600" y="420" font-family="monospace" font-size="28" fill="#bbe1fa" text-anchor="middle">✓ Валидация ✓ Подсветка синтаксиса ✓ Минификация</text>
<!-- URL -->
<text x="600" y="520" font-family="monospace" font-size="24" fill="#3282b8" text-anchor="middle">formatter.abaidulin.ru</text>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB