Skip to content

Commit 0227efa

Browse files
author
Adarsh Mishra
committed
Changes for title add in image and other css ui improvement
1 parent ef08bb9 commit 0227efa

4 files changed

Lines changed: 56 additions & 5 deletions

File tree

index.html

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,45 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Code Image Generator</title>
7+
<!-- Primary Meta Tags -->
8+
<title>Code Image Generator | Create Code Snippets in macOS & Windows Styles</title>
9+
<meta name="title" content="Code Image Generator | Create Code Snippets in macOS & Windows Styles">
10+
<meta name="description"
11+
content="Generate beautiful code snippet images with OS-specific themes like macOS, Windows 10, Windows 11, Ubuntu, and more. Customize your code style and instantly create shareable code images.">
12+
13+
<meta name="keywords"
14+
content="code image generator, code screenshot generator, macOS code style, windows code style, code snippet image, developer tool, syntax highlighter, code to image converter, shareable code snippet, OS themed code image">
15+
16+
<meta name="robots" content="index, follow">
17+
<meta name="language" content="en">
18+
<meta name="author" content="Adarsh Mishra">
19+
20+
<!-- Open Graph / Facebook -->
21+
<meta property="og:type" content="website">
22+
<meta property="og:title" content="Code Image Generator | macOS & Windows Code Snippet Creator">
23+
<meta property="og:description"
24+
content="Create high-quality code snippet images with OS-specific window styles like macOS, Windows 10/11, and Linux. Perfect for blogs, tutorials, and social media.">
25+
<meta property="og:image" content="https://codeimage.netlify.app/logo.png">
26+
<link rel="icon" type="image/png" href="logo.png">
27+
<meta property="og:url" content="https://codeimage.netlify.app/">
28+
829
<link rel="preconnect" href="https://fonts.googleapis.com">
930
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1031
<link
1132
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Fira+Code:wght@400;500&display=swap"
1233
rel="stylesheet">
1334
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" />
1435
<link rel="stylesheet" href="style.css">
36+
37+
<!-- Google tag (gtag.js) -->
38+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FCQ4VH6CK8"></script>
39+
<script>
40+
window.dataLayer = window.dataLayer || [];
41+
function gtag() { dataLayer.push(arguments); }
42+
gtag('js', new Date());
43+
44+
gtag('config', 'G-FCQ4VH6CK8');
45+
</script>
1546
</head>
1647

1748
<body>
@@ -24,9 +55,14 @@ <h1>CodeSnap</h1>
2455
<p>Beautiful code screenshots</p>
2556
</header>
2657

58+
<div class="control-group">
59+
<label>Window Title</label>
60+
<input type="text" id="titleInput" value="Untitled-1" placeholder="Enter title here...">
61+
</div>
62+
2763
<div class="control-group">
2864
<label>Code Input</label>
29-
<textarea id="codeInput" placeholder="Paste your code here...">module.exports = leftpad;
65+
<textarea id="codeInput" placeholder="Paste your code here..." spellcheck="false">module.exports = leftpad;
3066

3167
function leftpad(str, len, ch) {
3268
str = String(str);
@@ -73,7 +109,7 @@ <h1>CodeSnap</h1>
73109
<span class="control minimize"></span>
74110
<span class="control maximize"></span>
75111
</div>
76-
<div class="window-title">Untitled-1</div>
112+
<div class="window-title" id="windowTitle">Untitled-1</div>
77113
</div>
78114
<div class="window-content">
79115
<pre><code id="codeDisplay" class="language-javascript"></code></pre>

logo.png

410 KB
Loading

script.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
document.addEventListener('DOMContentLoaded', () => {
22
const codeInput = document.getElementById('codeInput');
3+
const titleInput = document.getElementById('titleInput');
34
const codeDisplay = document.getElementById('codeDisplay');
45
const windowFrame = document.getElementById('windowFrame');
56
const bgColorInput = document.getElementById('bgColor');
@@ -15,7 +16,7 @@ document.addEventListener('DOMContentLoaded', () => {
1516

1617
// Event Listeners
1718
codeInput.addEventListener('input', updateCode);
18-
19+
titleInput.addEventListener('input', updateWindowTitle);
1920
bgColorInput.addEventListener('input', (e) => {
2021
captureContainer.style.backgroundColor = e.target.value;
2122
});
@@ -69,6 +70,11 @@ document.addEventListener('DOMContentLoaded', () => {
6970
}
7071
});
7172

73+
function updateWindowTitle() {
74+
const windowTitle = document.getElementById('windowTitle');
75+
windowTitle.textContent = titleInput.value;
76+
}
77+
7278
function updateCode() {
7379
// Escape HTML to prevent injection and display correctly
7480
const rawCode = codeInput.value;

style.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pre[class*=language-] {
3232

3333
/* Sidebar */
3434
.sidebar {
35-
width: 320px;
35+
width: 35%;
3636
background-color: var(--sidebar-bg);
3737
padding: 2rem;
3838
border-right: 1px solid var(--border-color);
@@ -94,6 +94,15 @@ textarea {
9494
resize: vertical;
9595
min-height: 150px;
9696
outline: none;
97+
scrollbar-width: thin;
98+
}
99+
100+
#titleInput {
101+
background-color: #0f172a;
102+
border: 1px solid var(--border-color);
103+
border-radius: 0.5rem;
104+
padding: 0.75rem;
105+
color: white;
97106
}
98107

99108
textarea:focus {

0 commit comments

Comments
 (0)