eaglelandsonce commited on
Commit
4d46e65
·
verified ·
1 Parent(s): ecd633f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +161 -18
index.html CHANGED
@@ -1,19 +1,162 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Interactive Layered Presentation</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
9
+ </head>
10
+ <body>
11
+ <!-- Sidebar -->
12
+ <div class="sidebar">
13
+ <div class="prompt-icon" id="promptIcon">
14
+ <img src="prompt-icon.png" alt="Prompt Icon">
15
+ <span>Prompt</span>
16
+ </div>
17
+ <div class="video-icon" id="videoIcon">
18
+ <img src="video-icon.png" alt="Video Icon">
19
+ <span>Video</span>
20
+ </div>
21
+ <div class="website-icon" id="websiteIcon">
22
+ <img src="website-icon.png" alt="Website Icon">
23
+ <span>Website</span>
24
+ </div>
25
+ </div>
26
+
27
+ <!-- Main Container -->
28
+ <div class="container">
29
+ <div class="top-bar">
30
+ <div class="nav-buttons">
31
+ <button id="prev-btn">&#8592; Previous</button>
32
+ <button id="next-btn">Next &#8594;</button>
33
+ </div>
34
+ <h1 id="slide-title">Interactive Presentation</h1>
35
+ </div>
36
+ <div class="main">
37
+ <div class="content">
38
+ <img id="slide-image" src="images/01_mg.png" alt="Slide Image">
39
+ <div class="prompt-box" id="promptBox">
40
+ <textarea id="promptText"></textarea>
41
+ <button id="queryButton">Query</button>
42
+ </div>
43
+ <div class="response-box" id="responseBox">
44
+ <div id="responseContent"></div>
45
+ </div>
46
+ <div class="website-layer" id="websiteLayer" style="display: none;">
47
+ <iframe id="websiteFrame" src="" frameborder="0"></iframe>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <div class="video-overlay" id="videoOverlay" style="display: none;">
52
+ <iframe id="videoPlayer" src="" allowfullscreen></iframe>
53
+ <button class="close-button" id="closeVideo">&times;</button>
54
+ </div>
55
+ </div>
56
+
57
+ <script>
58
+ const slideTitle = document.getElementById('slide-title');
59
+ const slideImage = document.getElementById('slide-image');
60
+ const prevBtn = document.getElementById('prev-btn');
61
+ const nextBtn = document.getElementById('next-btn');
62
+ const promptBox = document.getElementById('promptBox');
63
+ const promptText = document.getElementById('promptText');
64
+ const responseBox = document.getElementById('responseBox');
65
+ const responseContent = document.getElementById('responseContent');
66
+ const promptIcon = document.getElementById('promptIcon');
67
+ const videoIcon = document.getElementById('videoIcon');
68
+ const videoOverlay = document.getElementById('videoOverlay');
69
+ const videoPlayer = document.getElementById('videoPlayer');
70
+ const closeVideo = document.getElementById('closeVideo');
71
+ const queryButton = document.getElementById('queryButton');
72
+ const websiteIcon = document.getElementById('websiteIcon');
73
+ const websiteLayer = document.getElementById('websiteLayer');
74
+ const websiteFrame = document.getElementById('websiteFrame');
75
+
76
+ let slides = [];
77
+ let currentIndex = 0;
78
+ let websiteVisible = false;
79
+
80
+ async function fetchSlides() {
81
+ try {
82
+ const response = await fetch('config.json');
83
+ const data = await response.json();
84
+ slides = data.slides;
85
+ loadSlide(currentIndex);
86
+ } catch (error) {
87
+ console.error('Error loading slides:', error);
88
+ }
89
+ }
90
+
91
+ function loadSlide(index) {
92
+ if (!slides.length) return;
93
+ const slide = slides[index];
94
+ slideTitle.textContent = slide.id.replace('_', ' ');
95
+ slideImage.src = slide.image;
96
+ promptBox.style.display = 'none';
97
+ responseBox.style.display = 'none';
98
+ responseContent.innerHTML = '';
99
+ videoPlayer.src = '';
100
+ if (websiteVisible) {
101
+ toggleWebsiteLayer();
102
+ }
103
+ }
104
+
105
+ function toggleWebsiteLayer() {
106
+ if (websiteVisible) {
107
+ websiteLayer.style.display = 'none';
108
+ websiteFrame.src = '';
109
+ } else {
110
+ const websiteURL = "https://chatgpt.com/g/g-mYPbdl190-finstart-devops";
111
+ websiteFrame.src = websiteURL;
112
+ websiteLayer.style.display = 'block';
113
+ }
114
+ websiteVisible = !websiteVisible;
115
+ }
116
+
117
+ prevBtn.addEventListener('click', () => {
118
+ currentIndex = (currentIndex - 1 + slides.length) % slides.length;
119
+ loadSlide(currentIndex);
120
+ });
121
+
122
+ nextBtn.addEventListener('click', () => {
123
+ currentIndex = (currentIndex + 1) % slides.length;
124
+ loadSlide(currentIndex);
125
+ });
126
+
127
+ promptIcon.addEventListener('click', () => {
128
+ const slideText = slides[currentIndex]?.text || "No prompt text available.";
129
+ promptBox.style.display = promptBox.style.display === 'block' ? 'none' : 'block';
130
+ promptText.value = slideText;
131
+ });
132
+
133
+ videoIcon.addEventListener('click', () => {
134
+ const videoURL = slides[currentIndex]?.video || '';
135
+ if (videoURL) {
136
+ videoPlayer.src = videoURL;
137
+ videoOverlay.style.display = 'flex';
138
+ }
139
+ });
140
+
141
+ closeVideo.addEventListener('click', () => {
142
+ videoOverlay.style.display = 'none';
143
+ videoPlayer.src = '';
144
+ });
145
+
146
+ websiteIcon.addEventListener('click', toggleWebsiteLayer);
147
+
148
+ queryButton.addEventListener('click', async () => {
149
+ const userPrompt = promptText.value.trim();
150
+ if (!userPrompt) return;
151
+ responseBox.style.display = "block";
152
+ responseContent.innerHTML = "Processing...";
153
+ setTimeout(() => {
154
+ responseContent.innerHTML = "Response received: " + userPrompt;
155
+ }, 2000);
156
+ });
157
+
158
+ fetchSlides();
159
+ </script>
160
+ </body>
161
  </html>
162
+