-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpage.html
135 lines (113 loc) · 5.15 KB
/
webpage.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YouTube AI Chatbot</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- YouTube Link Input Section -->
<div class="container">
<h1 class="title">YouTube AI Chatbot</h1>
<input type="text" id="youtubeLink" placeholder="Enter YouTube video link here">
<button id="embedButton">Embed Video</button>
</div>
<!-- Video and Transcript Container -->
<div class="video-transcript-container">
<!-- Embedded YouTube Video -->
<div class="video-container" id="videoContainer">
<iframe id="youtubeVideo" src="" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
</div>
<!-- Transcript Section (Initially Empty) -->
<div class="transcript-container" id="transcriptContainer">
<h2>Video Transcript</h2>
<p id="transcriptContent">The transcript will appear here once the video is embedded.</p>
</div>
</div>
<!-- Chatbot Section -->
<div id="chatbotContainer">
<div id="chatbotHeader" onclick="toggleChatbot()">Chat about this Video</div>
<div id="chatDisplay"></div>
<div id="chatInputArea">
<input type="text" id="chatInput" placeholder="Type a message...">
<button id="sendButton">Send</button>
</div>
</div>
<script>
// Placeholder JavaScript for embedding YouTube video and adding transcript
document.getElementById('embedButton').addEventListener('click', function () {
const youtubeLink = document.getElementById('youtubeLink').value;
const videoId = youtubeLink.split('v=')[1];
if (videoId) {
document.getElementById('youtubeVideo').src = `https://www.youtube.com/embed/${videoId}`;
// Simulate fetching the transcript (replace with actual API call or scraping code)
document.getElementById('transcriptContent').textContent = "This is a simulated transcript for the video.";
} else {
alert("Please enter a valid YouTube link.");
}
});
function toggleChatbot() {
const chatbot = document.getElementById('chatbotContainer');
chatbot.style.display = chatbot.style.display === 'none' || chatbot.style.display === '' ? 'flex' : 'none';
}
</script>
</body><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>YouTube AI Chatbot</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- YouTube Link Input Section -->
<div class="container">
<h1 class="title">YouTube AI Chatbot</h1>
<input type="text" id="youtubeLink" placeholder="Enter YouTube video link here">
<button id="embedButton">Embed Video</button>
</div>
<!-- Video and Transcript Container -->
<div class="video-transcript-container">
<!-- Embedded YouTube Video -->
<div class="video-container" id="videoContainer">
<iframe id="youtubeVideo" src="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<!-- Transcript Section (Initially Empty) -->
<div class="transcript-container" id="transcriptContainer">
<h2>Video Transcript</h2>
<p id="transcriptContent">The transcript will appear here once the video is embedded.</p>
</div>
</div>
<!-- Chatbot Section -->
<div id="chatbotContainer">
<div id="chatbotHeader" onclick="toggleChatbot()">Chat about this Video</div>
<div id="chatDisplay"></div>
<div id="chatInputArea">
<input type="text" id="chatInput" placeholder="Type a message...">
<button id="sendButton">Send</button>
</div>
</div>
<script>
// Placeholder JavaScript for embedding YouTube video and adding transcript
document.getElementById('embedButton').addEventListener('click', function() {
const youtubeLink = document.getElementById('youtubeLink').value;
const videoId = youtubeLink.split('v=')[1];
if (videoId) {
document.getElementById('youtubeVideo').src = `https://www.youtube.com/embed/${videoId}`;
// Simulate fetching the transcript (replace with actual API call or scraping code)
document.getElementById('transcriptContent').textContent = "This is a simulated transcript for the video.";
} else {
alert("Please enter a valid YouTube link.");
}
});
function toggleChatbot() {
const chatbot = document.getElementById('chatbotContainer');
chatbot.style.display = chatbot.style.display === 'none' || chatbot.style.display === '' ? 'flex' : 'none';
}
</script>
</body>
</html>
</html>