-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
113 lines (96 loc) · 3.46 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MY PROJECT</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav>
<a href="#">Home</a>
<a href="#heading">Projects</a>
<a href="https://linktr.ee/satyam_kathait">Link Tree</a>
<a href="#aboutHeading">About</a>
<a href="#">Contact</a>
</nav>
<div class="main">
<div class="bgimage"></div>
<div class="intro">
<p>Video Insight Generator</p>
</div>
<div class="imp">
<form id="videoForm">
<input type="text" id="videoUrl" placeholder="Enter the Url here" required>
<button type="button" onclick="generate()">Generate</button>
</form>
</div>
<div class="content">
<div id="summaryContainer">
<h2>Summary:</h2>
<p id="summaryText">
</p>
</div>
<div id="notesContainer" >
<h2>Important points :</h2>
<pre id="notesText">
</pre>
</div>
<div id="error">
<h1> Some Error occur .<br>Please try again later</h1>
</div>
</div>
</div>
<footer>
<p>© 2023 My Website. All rights reserved.</p>
</footer>
<script>
async function generate(){
generateSummary();
generatenotes();
}
async function generateSummary() {
const videoUrl = document.getElementById('videoUrl').value;
const response = await fetch('http://localhost:3000/generate-summary', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ videoUrl }),
});
if (response.ok) {
const data = await response.json();
const summaryContainer = document.getElementById('summaryContainer');
const summaryText = document.getElementById('summaryText');
summaryText.innerText = data.summary;
summaryContainer.style.display = 'inline-block';
} else {
const error = document.getElementById('error');
error.style.display='inline-block'
console.error('Failed to generate summary');
}
}
async function generatenotes() {
const videoUrl = document.getElementById('videoUrl').value;
const response = await fetch('http://localhost:3000/generate-notes', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ videoUrl }),
});
if (response.ok) {
const data = await response.json();
const notesContainer = document.getElementById('notesContainer');
const notesText = document.getElementById('notesText');
notesText.innerText = data.summary;
notesContainer.style.display = 'inline-block';
} else {
const error = document.getElementById('error');
error.style.display='inline-block'
console.error('Failed to generate summary');
}
}
</script>
</body>
</html>