.seo-field-wrap { margin-bottom: 15px; }
.seo-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; color: #1d2327; }
.seo-input { width: 100%; padding: 10px; border: 1px solid #8c8f94; border-radius: 4px; box-sizing: border-box; font-size: 16px; }
.seo-input:focus { border-color: #2271b1; outline: 2px solid #2271b1; outline-offset: -2px; }
.seo-submit-btn { background-color: #2271b1; color: #fff; border: none; padding: 12px 24px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 600; transition: background 0.2s ease; width: 100%; }
.seo-submit-btn:hover { background-color: #135e96; }
.seo-results-panel { margin-top: 20px; padding: 15px; border-radius: 4px; display: none; line-height: 1.6; }
.seo-score-good { background-color: #edfaef; border-left: 4px solid #00a32a; color: #135e23; }
.seo-score-bad { background-color: #fcf0f1; border-left: 4px solid #d63638; color: #8a2424; }
.seo-stat { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(0,0,0,0.05); padding: 5px 0; }
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Quick SEO Analyzer",
"operatingSystem": "Web",
"applicationCategory": "SEO Tool"
}
function performSeoAnalysis() {
var title = document.getElementById('seo-title-input').value;
var keyword = document.getElementById('seo-keyword-input').value.toLowerCase();
var content = document.getElementById('seo-content-input').value.toLowerCase();
var output = document.getElementById('seo-output');
if (!title || !keyword) {
alert('Please provide at least a title and a focus keyword.');
return;
}
var score = 0;
var feedback = "";
// Title Length Check
var titleLength = title.length;
if (titleLength >= 50 && titleLength <= 60) {
score += 30;
feedback += '
Real-Time Content Optimizer
Check your SEO title and keyword density before publishing.
Title Length (' + titleLength + ') ✅ Perfect
';
} else {
feedback += 'Title Length (' + titleLength + ') ⚠️ Aim for 50-60 chars
';
}
// Keyword in Title
if (title.toLowerCase().indexOf(keyword) !== -1) {
score += 30;
feedback += 'Keyword in Title ✅ Found
';
} else {
feedback += 'Keyword in Title ❌ Missing
';
}
// Keyword Density
var words = content.split(/\s+/);
var count = 0;
for (var i = 0; i 0.5 && density < 2.5) {
score += 40;
feedback += 'Keyword Density ✅ ' + density.toFixed(2) + '%
';
} else {
feedback += 'Keyword Density ⚠️ ' + density.toFixed(2) + '% (Aim for 1-2%)
';
}
output.style.display = 'block';
output.className = score >= 70 ? 'seo-results-panel seo-score-good' : 'seo-results-panel seo-score-bad';
output.innerHTML = 'SEO Score: ' + score + '/100
' + feedback;
}