-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseo-gap-analyzer-demo.html
More file actions
196 lines (175 loc) · 6.41 KB
/
Copy pathseo-gap-analyzer-demo.html
File metadata and controls
196 lines (175 loc) · 6.41 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SEO Content Gap Analyzer - WordPress Admin</title>
<style>
/* WordPress Admin Styles */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
background: #f1f1f1;
margin: 0;
padding: 0;
}
/* WordPress admin wrap class */
.wrap {
margin: 10px 0 0 20px;
background: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
max-width: 1200px;
}
.wrap h1 {
font-size: 23px;
font-weight: 400;
margin: 0 0 20px 0;
padding: 9px 0 4px 0;
color: #23282d;
}
/* Plugin specific styles from style.css */
#sg-fetch {
margin-top: 20px;
padding: 10px;
font-size: 16px;
background: #0073aa;
color: white;
border: none;
border-radius: 3px;
cursor: pointer;
transition: background-color 0.3s;
}
#sg-fetch:hover {
background: #005a87;
}
#sg-fetch:disabled {
background: #ccc;
cursor: not-allowed;
}
#sg-topic-chart {
border: 1px solid #ddd;
border-radius: 3px;
background: #fafafa;
max-width: 100%;
height: auto;
}
.chart-container {
position: relative;
height: 400px;
margin: 20px 0;
}
.loading {
text-align: center;
color: #666;
font-style: italic;
margin: 20px 0;
}
.plugin-description {
background: #e7f3ff;
border-left: 4px solid #0073aa;
padding: 15px;
margin-bottom: 20px;
border-radius: 0 3px 3px 0;
}
.plugin-description p {
margin: 0;
color: #0073aa;
}
</style>
</head>
<body>
<div class="wrap">
<h1>SEO Content Gap Analyzer</h1>
<div class="plugin-description">
<p><strong>SEO Content Gap Analyzer v1.0</strong> - Identify competitor content & keyword gaps with recommendations and visuals.</p>
</div>
<div class="chart-container">
<canvas id="sg-topic-chart" width="400" height="200"></canvas>
</div>
<button id="sg-fetch">Analyze Now</button>
<div id="loading" class="loading" style="display: none;">
Analyzing keyword gaps...
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Simulating jQuery functionality
document.getElementById('sg-fetch').addEventListener('click', function() {
const button = this;
const loading = document.getElementById('loading');
// Disable button and show loading
button.disabled = true;
button.textContent = 'Analyzing...';
loading.style.display = 'block';
// Simulate AJAX call delay
setTimeout(function() {
// Simulate the AJAX response data from your PHP
const responseData = {
success: true,
data: {
topics: ['Topic A', 'Topic B'],
gaps: [5, 3]
}
};
if (responseData.success) {
const ctx = document.getElementById('sg-topic-chart').getContext('2d');
// Destroy existing chart if it exists
if (window.sgChart) {
window.sgChart.destroy();
}
// Create new chart with the data from your plugin
window.sgChart = new Chart(ctx, {
type: 'bar',
data: {
labels: responseData.data.topics,
datasets: [{
label: 'Keyword Gap',
data: responseData.data.gaps,
backgroundColor: 'rgba(54, 162, 235, 0.5)',
borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Number of Gaps'
}
},
x: {
title: {
display: true,
text: 'Content Topics'
}
}
},
plugins: {
title: {
display: true,
text: 'SEO Content Gap Analysis'
},
legend: {
display: true,
position: 'top'
}
}
}
});
} else {
alert('Error: ' + responseData.data);
}
// Reset button state
button.disabled = false;
button.textContent = 'Analyze Now';
loading.style.display = 'none';
}, 1500);
});
</script>
</body>
</html>