-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
229 lines (215 loc) · 7.88 KB
/
Copy pathindex.html
File metadata and controls
229 lines (215 loc) · 7.88 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Free OpenGraph Image Generator</title>
<!-- Primary Meta Tags -->
<meta name="title" content="Free OpenGraph Image Generator">
<meta name="description" content="Generate beautiful OpenGraph images for your social media links. Simple, fast, and free to use. Create images that look great when shared on Twitter, Facebook, LinkedIn, and more.">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://og-img.com">
<meta property="og:title" content="Free OpenGraph Image Generator">
<meta property="og:description" content="Generate beautiful OpenGraph images for your social media links. Simple, fast, and free to use. Create images that look great when shared on Twitter, Facebook, LinkedIn, and more.">
<meta property="og:image" content="https://og-img.com/Free%20OpenGraph%20Image%20Generator/og.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://og-img.com">
<meta property="twitter:title" content="Free OpenGraph Image Generator">
<meta property="twitter:description" content="Generate beautiful OpenGraph images for your social media links. Simple, fast, and free to use. Create images that look great when shared on Twitter, Facebook, LinkedIn, and more.">
<meta property="twitter:image" content="https://og-img.com/Free%20OpenGraph%20Image%20Generator/og.png">
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 40px auto;
padding: 20px;
background-color: #f5f5f5;
}
.container {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1 {
color: #333;
margin-bottom: 20px;
}
.byline {
margin-top: -15px;
margin-bottom: 25px;
color: #666;
}
.byline a:hover {
color: #007bff;
}
.explanation {
background-color: #f8f9fa;
padding: 20px;
border-radius: 8px;
margin-bottom: 30px;
line-height: 1.5;
}
.input-group {
margin-bottom: 20px;
position: relative;
}
input[type="text"] {
width: 100%;
padding: 12px;
font-size: 16px;
border: 2px solid #ddd;
border-radius: 4px;
margin-bottom: 10px;
}
.char-counter {
position: absolute;
right: 10px;
top: 12px;
color: #666;
font-size: 14px;
}
.result {
background-color: #f8f9fa;
padding: 15px;
border-radius: 4px;
margin-top: 20px;
word-break: break-all;
position: relative;
}
.copy-button {
position: absolute;
right: 15px;
top: 15px;
padding: 8px 16px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s;
}
.copy-button:hover {
background-color: #0056b3;
}
.preview {
margin-top: 20px;
text-align: center;
}
.preview img {
max-width: 100%;
height: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
code {
background-color: #e9ecef;
padding: 2px 6px;
border-radius: 4px;
font-family: monospace;
}
.success-message {
position: fixed;
top: 20px;
right: 20px;
background-color: #28a745;
color: white;
padding: 10px 20px;
border-radius: 4px;
display: none;
animation: fadeIn 0.3s, fadeOut 0.3s 1.7s;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeOut {
from { opacity: 1; }
to { opacity: 0; }
}
</style>
</head>
<body>
<div class="container">
<h1>Free OpenGraph Image Generator</h1>
<div class="byline">
by <a href="https://pskirde.com" target="_blank" style="color: #666; text-decoration: none; font-size: 14px; transition: color 0.2s;">Pascal</a>
</div>
<div class="explanation">
<h3>How it works:</h3>
<p>This tool generates OpenGraph images for your social media links. Here's how to use it:</p>
<ol>
<li>Enter your text in the field below (max 100 characters)</li>
<li>The text will automatically wrap to multiple lines if needed</li>
<li>Copy the generated URL and use it in your HTML meta tag like this:<br>
<code><meta property="og:image" content="YOUR_URL" /></code>
</li>
</ol>
<p>The image will appear when your link is shared on social media platforms like Twitter, Facebook, or LinkedIn.</p>
</div>
<div class="input-group">
<input type="text"
id="textInput"
placeholder="Enter your text"
maxlength="100"
oninput="updateURL(this.value)">
<span class="char-counter">
<span id="charCount">0</span>/100
</span>
</div>
<div class="result">
<strong>Generated URL:</strong>
<button class="copy-button" onclick="copyURL()">Copy URL</button>
<div id="generatedUrl" style="margin-top: 10px;"></div>
</div>
<div class="preview">
<h3>Preview:</h3>
<img id="previewImage" src="" alt="Preview will appear here">
</div>
</div>
<div id="successMessage" class="success-message">
URL copied to clipboard!
</div>
<script>
function updateURL(text) {
if (!text) {
text = 'Preview Text';
}
const encodedText = encodeURIComponent(text);
const baseUrl = window.location.origin;
const ogUrl = `${baseUrl}/${encodedText}/og.png`;
document.getElementById('generatedUrl').textContent = ogUrl;
document.getElementById('previewImage').src = ogUrl;
document.getElementById('charCount').textContent = text.length;
}
function copyURL() {
const urlText = document.getElementById('generatedUrl').textContent;
// Create temporary textarea
const textarea = document.createElement('textarea');
textarea.value = urlText;
textarea.style.position = 'fixed'; // Avoid scrolling to bottom
document.body.appendChild(textarea);
textarea.select();
try {
// Try to copy
document.execCommand('copy');
// Show success message
const successMessage = document.getElementById('successMessage');
successMessage.style.display = 'block';
setTimeout(() => {
successMessage.style.display = 'none';
}, 2000);
} catch (err) {
console.error('Failed to copy text:', err);
} finally {
// Clean up
document.body.removeChild(textarea);
}
}
// Initialize with default text
updateURL('Preview Text');
</script>
</body>
</html>