zeynep7 commited on
Commit
335ea2a
·
verified ·
1 Parent(s): 4a87e8f

yüklediğim slaytların özetini çıkaran sayfa - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +324 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Slide Summary Generator
3
- emoji: 🌍
4
- colorFrom: gray
5
  colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: slide-summary-generator
3
+ emoji: 🐳
4
+ colorFrom: green
5
  colorTo: red
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,324 @@
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>Slide Summary Generator</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .dropzone {
11
+ border: 2px dashed #9CA3AF;
12
+ transition: all 0.3s ease;
13
+ }
14
+ .dropzone.active {
15
+ border-color: #3B82F6;
16
+ background-color: #EFF6FF;
17
+ }
18
+ .slide-preview {
19
+ transition: all 0.3s ease;
20
+ }
21
+ .slide-preview:hover {
22
+ transform: translateY(-5px);
23
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
24
+ }
25
+ .summary-card {
26
+ background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
27
+ }
28
+ .progress-bar {
29
+ transition: width 0.5s ease;
30
+ }
31
+ @keyframes pulse {
32
+ 0%, 100% { opacity: 1; }
33
+ 50% { opacity: 0.5; }
34
+ }
35
+ .animate-pulse {
36
+ animation: pulse 2s infinite;
37
+ }
38
+ </style>
39
+ </head>
40
+ <body class="bg-gray-50 min-h-screen">
41
+ <div class="container mx-auto px-4 py-8">
42
+ <!-- Header -->
43
+ <header class="mb-10 text-center">
44
+ <h1 class="text-4xl font-bold text-blue-600 mb-2">Slide Summary Generator</h1>
45
+ <p class="text-gray-600 max-w-2xl mx-auto">Upload your presentation slides and get a concise summary automatically generated for you.</p>
46
+ </header>
47
+
48
+ <!-- Main Content -->
49
+ <div class="flex flex-col lg:flex-row gap-8">
50
+ <!-- Upload Section -->
51
+ <div class="w-full lg:w-1/2">
52
+ <div id="dropzone" class="dropzone rounded-xl p-8 mb-6 text-center cursor-pointer">
53
+ <div class="flex flex-col items-center justify-center space-y-4">
54
+ <i class="fas fa-cloud-upload-alt text-5xl text-blue-400"></i>
55
+ <h3 class="text-xl font-semibold text-gray-700">Drag & Drop Your Slides Here</h3>
56
+ <p class="text-gray-500">or click to browse files</p>
57
+ <input type="file" id="fileInput" class="hidden" accept="image/*,.pdf" multiple>
58
+ <button id="uploadBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg transition">
59
+ Select Files
60
+ </button>
61
+ </div>
62
+ </div>
63
+
64
+ <!-- Upload Progress -->
65
+ <div id="uploadProgress" class="hidden bg-white rounded-xl shadow p-6 mb-6">
66
+ <div class="flex justify-between mb-2">
67
+ <span class="font-medium">Processing...</span>
68
+ <span id="progressPercent" class="text-blue-600">0%</span>
69
+ </div>
70
+ <div class="w-full bg-gray-200 rounded-full h-2.5">
71
+ <div id="progressBar" class="progress-bar bg-blue-600 h-2.5 rounded-full" style="width: 0%"></div>
72
+ </div>
73
+ </div>
74
+
75
+ <!-- Slide Previews -->
76
+ <div id="slidePreviews" class="hidden">
77
+ <h3 class="text-xl font-semibold mb-4 text-gray-700">Your Slides</h3>
78
+ <div id="previewContainer" class="grid grid-cols-2 md:grid-cols-3 gap-4">
79
+ <!-- Slide previews will be added here -->
80
+ </div>
81
+ </div>
82
+ </div>
83
+
84
+ <!-- Summary Section -->
85
+ <div class="w-full lg:w-1/2">
86
+ <div class="bg-white rounded-xl shadow p-6">
87
+ <div class="flex items-center justify-between mb-4">
88
+ <h2 class="text-2xl font-bold text-gray-800">Presentation Summary</h2>
89
+ <button id="generateBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg transition flex items-center disabled:opacity-50" disabled>
90
+ <i class="fas fa-magic mr-2"></i> Generate Summary
91
+ </button>
92
+ </div>
93
+
94
+ <!-- Summary Loading State -->
95
+ <div id="summaryLoading" class="hidden p-8 text-center">
96
+ <div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500 mx-auto mb-4"></div>
97
+ <p class="text-gray-600">Analyzing your slides and generating summary...</p>
98
+ <div class="mt-4 space-y-2">
99
+ <div class="h-4 bg-gray-200 rounded animate-pulse"></div>
100
+ <div class="h-4 bg-gray-200 rounded animate-pulse w-5/6 mx-auto"></div>
101
+ <div class="h-4 bg-gray-200 rounded animate-pulse w-2/3 mx-auto"></div>
102
+ </div>
103
+ </div>
104
+
105
+ <!-- Summary Content -->
106
+ <div id="summaryContent" class="hidden">
107
+ <div class="mb-4">
108
+ <h3 class="font-semibold text-lg text-gray-800 mb-2">Key Points</h3>
109
+ <ul id="keyPoints" class="list-disc pl-5 space-y-1 text-gray-700">
110
+ <!-- Key points will be added here -->
111
+ </ul>
112
+ </div>
113
+
114
+ <div class="mb-4">
115
+ <h3 class="font-semibold text-lg text-gray-800 mb-2">Detailed Summary</h3>
116
+ <div id="detailedSummary" class="text-gray-700 space-y-3">
117
+ <!-- Detailed summary will be added here -->
118
+ </div>
119
+ </div>
120
+
121
+ <div class="flex justify-end mt-6">
122
+ <button id="copyBtn" class="flex items-center text-blue-600 hover:text-blue-800">
123
+ <i class="fas fa-copy mr-2"></i> Copy Summary
124
+ </button>
125
+ </div>
126
+ </div>
127
+
128
+ <!-- Empty State -->
129
+ <div id="emptyState" class="p-8 text-center">
130
+ <i class="fas fa-file-alt text-4xl text-gray-300 mb-4"></i>
131
+ <h3 class="text-lg font-medium text-gray-500 mb-2">No Summary Yet</h3>
132
+ <p class="text-gray-400">Upload your slides and click "Generate Summary" to get started.</p>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+
139
+ <script>
140
+ document.addEventListener('DOMContentLoaded', function() {
141
+ // DOM Elements
142
+ const dropzone = document.getElementById('dropzone');
143
+ const fileInput = document.getElementById('fileInput');
144
+ const uploadBtn = document.getElementById('uploadBtn');
145
+ const uploadProgress = document.getElementById('uploadProgress');
146
+ const progressBar = document.getElementById('progressBar');
147
+ const progressPercent = document.getElementById('progressPercent');
148
+ const slidePreviews = document.getElementById('slidePreviews');
149
+ const previewContainer = document.getElementById('previewContainer');
150
+ const generateBtn = document.getElementById('generateBtn');
151
+ const summaryLoading = document.getElementById('summaryLoading');
152
+ const summaryContent = document.getElementById('summaryContent');
153
+ const emptyState = document.getElementById('emptyState');
154
+ const keyPoints = document.getElementById('keyPoints');
155
+ const detailedSummary = document.getElementById('detailedSummary');
156
+ const copyBtn = document.getElementById('copyBtn');
157
+
158
+ let uploadedFiles = [];
159
+
160
+ // Event Listeners
161
+ uploadBtn.addEventListener('click', () => fileInput.click());
162
+ fileInput.addEventListener('change', handleFileSelect);
163
+ dropzone.addEventListener('dragover', handleDragOver);
164
+ dropzone.addEventListener('dragleave', handleDragLeave);
165
+ dropzone.addEventListener('drop', handleDrop);
166
+ generateBtn.addEventListener('click', generateSummary);
167
+ copyBtn.addEventListener('click', copySummary);
168
+
169
+ // Functions
170
+ function handleFileSelect(e) {
171
+ const files = e.target.files;
172
+ if (files.length > 0) {
173
+ processFiles(files);
174
+ }
175
+ }
176
+
177
+ function handleDragOver(e) {
178
+ e.preventDefault();
179
+ dropzone.classList.add('active');
180
+ }
181
+
182
+ function handleDragLeave() {
183
+ dropzone.classList.remove('active');
184
+ }
185
+
186
+ function handleDrop(e) {
187
+ e.preventDefault();
188
+ dropzone.classList.remove('active');
189
+ const files = e.dataTransfer.files;
190
+ if (files.length > 0) {
191
+ processFiles(files);
192
+ }
193
+ }
194
+
195
+ function processFiles(files) {
196
+ // Reset previous uploads
197
+ uploadedFiles = [];
198
+ previewContainer.innerHTML = '';
199
+
200
+ // Show upload progress
201
+ uploadProgress.classList.remove('hidden');
202
+
203
+ // Simulate upload progress
204
+ let progress = 0;
205
+ const interval = setInterval(() => {
206
+ progress += 5;
207
+ progressBar.style.width = `${progress}%`;
208
+ progressPercent.textContent = `${progress}%`;
209
+
210
+ if (progress >= 100) {
211
+ clearInterval(interval);
212
+ uploadProgress.classList.add('hidden');
213
+
214
+ // Process each file
215
+ Array.from(files).forEach((file, index) => {
216
+ // In a real app, you would upload to a server here
217
+ // For demo, we'll just create previews
218
+ uploadedFiles.push(file);
219
+ createPreview(file, index);
220
+ });
221
+
222
+ slidePreviews.classList.remove('hidden');
223
+ generateBtn.disabled = false;
224
+ }
225
+ }, 100);
226
+ }
227
+
228
+ function createPreview(file, index) {
229
+ const reader = new FileReader();
230
+
231
+ reader.onload = function(e) {
232
+ const preview = document.createElement('div');
233
+ preview.className = 'slide-preview bg-white rounded-lg overflow-hidden shadow-md relative';
234
+
235
+ if (file.type.startsWith('image/')) {
236
+ preview.innerHTML = `
237
+ <img src="${e.target.result}" alt="Slide ${index + 1}" class="w-full h-32 object-cover">
238
+ <div class="p-2">
239
+ <p class="text-sm font-medium truncate">${file.name}</p>
240
+ <p class="text-xs text-gray-500">Slide ${index + 1}</p>
241
+ </div>
242
+ <div class="absolute top-2 right-2 bg-blue-600 text-white text-xs px-2 py-1 rounded-full">
243
+ ${index + 1}
244
+ </div>
245
+ `;
246
+ } else if (file.type === 'application/pdf') {
247
+ preview.innerHTML = `
248
+ <div class="bg-red-100 h-32 flex items-center justify-center">
249
+ <i class="fas fa-file-pdf text-4xl text-red-500"></i>
250
+ </div>
251
+ <div class="p-2">
252
+ <p class="text-sm font-medium truncate">${file.name}</p>
253
+ <p class="text-xs text-gray-500">PDF Document</p>
254
+ </div>
255
+ <div class="absolute top-2 right-2 bg-blue-600 text-white text-xs px-2 py-1 rounded-full">
256
+ ${index + 1}
257
+ </div>
258
+ `;
259
+ }
260
+
261
+ previewContainer.appendChild(preview);
262
+ };
263
+
264
+ reader.readAsDataURL(file);
265
+ }
266
+
267
+ function generateSummary() {
268
+ // Show loading state
269
+ summaryLoading.classList.remove('hidden');
270
+ emptyState.classList.add('hidden');
271
+ summaryContent.classList.add('hidden');
272
+ generateBtn.disabled = true;
273
+
274
+ // Simulate API call delay
275
+ setTimeout(() => {
276
+ // Hide loading state
277
+ summaryLoading.classList.add('hidden');
278
+
279
+ // Show summary content
280
+ summaryContent.classList.remove('hidden');
281
+
282
+ // Generate mock summary (in a real app, this would come from an API)
283
+ const mockKeyPoints = [
284
+ "Introduction to machine learning concepts",
285
+ "Types of machine learning: supervised, unsupervised, reinforcement",
286
+ "Key algorithms: linear regression, decision trees, neural networks",
287
+ "Applications in healthcare, finance, and automation",
288
+ "Future trends and ethical considerations"
289
+ ];
290
+
291
+ const mockDetailedSummary = `
292
+ <p>The presentation begins with an introduction to machine learning, defining it as a subset of artificial intelligence that enables systems to learn from data without being explicitly programmed.</p>
293
+ <p>It covers the three main types of machine learning: supervised learning (where models learn from labeled data), unsupervised learning (finding patterns in unlabeled data), and reinforcement learning (learning through rewards and punishments).</p>
294
+ <p>Key algorithms discussed include linear regression for predicting continuous values, decision trees for classification tasks, and neural networks for complex pattern recognition. The presentation highlights real-world applications in healthcare (diagnosis prediction), finance (fraud detection), and industrial automation.</p>
295
+ <p>Finally, it explores future trends like federated learning and the growing importance of addressing ethical considerations such as bias in algorithms and data privacy concerns.</p>
296
+ `;
297
+
298
+ // Populate summary
299
+ keyPoints.innerHTML = mockKeyPoints.map(point => `<li>${point}</li>`).join('');
300
+ detailedSummary.innerHTML = mockDetailedSummary;
301
+
302
+ // Enable generate button again
303
+ generateBtn.disabled = false;
304
+ }, 3000);
305
+ }
306
+
307
+ function copySummary() {
308
+ const summaryText = Array.from(keyPoints.querySelectorAll('li'))
309
+ .map(li => `• ${li.textContent}`)
310
+ .join('\n') + '\n\n' + detailedSummary.textContent;
311
+
312
+ navigator.clipboard.writeText(summaryText).then(() => {
313
+ // Show copied feedback
314
+ const originalText = copyBtn.innerHTML;
315
+ copyBtn.innerHTML = '<i class="fas fa-check mr-2"></i> Copied!';
316
+ setTimeout(() => {
317
+ copyBtn.innerHTML = originalText;
318
+ }, 2000);
319
+ });
320
+ }
321
+ });
322
+ </script>
323
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=zeynep7/slide-summary-generator" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
324
+ </html>