-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
60 lines (58 loc) · 2.14 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SWOT Analysis Tool</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
.swot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.swot-section { border: 1px solid #ddd; padding: 15px; border-radius: 5px; }
textarea { width: 100%; height: 100px; margin-top: 10px; }
button { margin-top: 20px; padding: 10px 20px; }
</style>
</head>
<body>
<h1>SWOT Analysis Tool</h1>
<div class="swot-grid">
<div class="swot-section">
<h2>Strengths</h2>
<textarea id="strengths"></textarea>
</div>
<div class="swot-section">
<h2>Weaknesses</h2>
<textarea id="weaknesses"></textarea>
</div>
<div class="swot-section">
<h2>Opportunities</h2>
<textarea id="opportunities"></textarea>
</div>
<div class="swot-section">
<h2>Threats</h2>
<textarea id="threats"></textarea>
</div>
</div>
<button onclick="saveAnalysis()">Save Analysis</button>
<script>
async function saveAnalysis() {
const data = {
strengths: document.getElementById('strengths').value.split('\n'),
weaknesses: document.getElementById('weaknesses').value.split('\n'),
opportunities: document.getElementById('opportunities').value.split('\n'),
threats: document.getElementById('threats').value.split('\n')
};
try {
const response = await fetch('/api/swot', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
const result = await response.json();
alert('Analysis saved successfully!');
} catch (error) {
alert('Error saving analysis: ' + error.message);
}
}
</script>
</body>
</html>