Novacibes commited on
Commit
00a112b
·
verified ·
1 Parent(s): ddf1d34

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +536 -19
index.html CHANGED
@@ -1,20 +1,537 @@
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>
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>AutoPaper — Academic Paper Generator</title>
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
+ <!-- ============ CSS ============ -->
9
+ <style>
10
+ /* ----- Reset & Base ----- */
11
+ * {
12
+ margin: 0;
13
+ padding: 0;
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ body {
18
+ font-family: 'Times New Roman', 'Palatino', Georgia, serif;
19
+ background: #f5f3f0;
20
+ color: #1a1a1a;
21
+ line-height: 1.7;
22
+ padding: 40px 20px;
23
+ }
24
+
25
+ .container {
26
+ max-width: 900px;
27
+ margin: 0 auto;
28
+ background: #ffffff;
29
+ box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
30
+ padding: 60px 80px;
31
+ border-radius: 4px;
32
+ }
33
+
34
+ /* ----- Typography (LaTeX-style) ----- */
35
+ h1 {
36
+ font-size: 28px;
37
+ font-weight: 700;
38
+ text-align: center;
39
+ margin-top: 10px;
40
+ margin-bottom: 6px;
41
+ letter-spacing: -0.3px;
42
+ line-height: 1.3;
43
+ }
44
+
45
+ .authors {
46
+ text-align: center;
47
+ font-size: 16px;
48
+ margin: 8px 0 4px 0;
49
+ color: #2c2c2c;
50
+ }
51
+
52
+ .affiliation {
53
+ text-align: center;
54
+ font-size: 14px;
55
+ color: #555;
56
+ margin-bottom: 20px;
57
+ }
58
+
59
+ .abstract-label {
60
+ font-weight: 700;
61
+ font-size: 15px;
62
+ text-transform: uppercase;
63
+ letter-spacing: 1px;
64
+ margin-top: 30px;
65
+ margin-bottom: 8px;
66
+ border-top: 1px solid #ddd;
67
+ padding-top: 18px;
68
+ }
69
+
70
+ .abstract-text {
71
+ font-size: 15px;
72
+ text-align: justify;
73
+ margin-bottom: 28px;
74
+ padding: 0 4px;
75
+ }
76
+
77
+ h2 {
78
+ font-size: 20px;
79
+ font-weight: 700;
80
+ margin-top: 32px;
81
+ margin-bottom: 12px;
82
+ border-bottom: 1px solid #eaeaea;
83
+ padding-bottom: 6px;
84
+ }
85
+
86
+ h3 {
87
+ font-size: 17px;
88
+ font-weight: 600;
89
+ margin-top: 22px;
90
+ margin-bottom: 8px;
91
+ font-style: italic;
92
+ }
93
+
94
+ p {
95
+ font-size: 15px;
96
+ text-align: justify;
97
+ margin-bottom: 12px;
98
+ text-indent: 1.8em;
99
+ }
100
+
101
+ p.no-indent {
102
+ text-indent: 0;
103
+ }
104
+
105
+ /* ----- Figures & Tables ----- */
106
+ .figure-box {
107
+ margin: 28px 0;
108
+ text-align: center;
109
+ background: #fafafa;
110
+ padding: 20px 10px 12px 10px;
111
+ border-radius: 4px;
112
+ border: 1px solid #eee;
113
+ }
114
+
115
+ .figure-box svg {
116
+ max-width: 100%;
117
+ height: auto;
118
+ }
119
+
120
+ .figure-box .caption {
121
+ font-size: 13px;
122
+ color: #444;
123
+ margin-top: 10px;
124
+ font-style: italic;
125
+ }
126
+
127
+ .table-wrap {
128
+ margin: 28px 0;
129
+ overflow-x: auto;
130
+ font-size: 14px;
131
+ }
132
+
133
+ .table-wrap table {
134
+ width: 100%;
135
+ border-collapse: collapse;
136
+ background: #fafafa;
137
+ }
138
+
139
+ .table-wrap th,
140
+ .table-wrap td {
141
+ border: 1px solid #ccc;
142
+ padding: 8px 14px;
143
+ text-align: center;
144
+ }
145
+
146
+ .table-wrap th {
147
+ background: #eee;
148
+ font-weight: 600;
149
+ }
150
+
151
+ .table-wrap .caption {
152
+ font-size: 13px;
153
+ color: #444;
154
+ margin-top: 8px;
155
+ font-style: italic;
156
+ text-align: center;
157
+ }
158
+
159
+ /* ----- Math ----- */
160
+ .math {
161
+ font-family: 'Cambria', 'Times New Roman', serif;
162
+ font-style: italic;
163
+ padding: 0 2px;
164
+ }
165
+
166
+ .math-block {
167
+ text-align: center;
168
+ font-size: 18px;
169
+ padding: 12px 0;
170
+ font-family: 'Cambria', 'Times New Roman', serif;
171
+ font-style: italic;
172
+ letter-spacing: 0.5px;
173
+ }
174
+
175
+ /* ----- References ----- */
176
+ .references {
177
+ margin-top: 40px;
178
+ border-top: 1px solid #ddd;
179
+ padding-top: 20px;
180
+ }
181
+
182
+ .references h2 {
183
+ border-bottom: none;
184
+ font-size: 18px;
185
+ }
186
+
187
+ .references ol {
188
+ padding-left: 28px;
189
+ font-size: 13px;
190
+ line-height: 1.8;
191
+ color: #222;
192
+ }
193
+
194
+ .references ol li {
195
+ margin-bottom: 4px;
196
+ }
197
+
198
+ /* ----- Controls (UI outside paper) ----- */
199
+ .controls {
200
+ max-width: 900px;
201
+ margin: 0 auto 30px auto;
202
+ display: flex;
203
+ flex-wrap: wrap;
204
+ gap: 12px;
205
+ justify-content: center;
206
+ align-items: center;
207
+ }
208
+
209
+ .controls button {
210
+ background: #1a1a1a;
211
+ color: #fff;
212
+ border: none;
213
+ padding: 12px 32px;
214
+ font-size: 15px;
215
+ font-family: 'Segoe UI', sans-serif;
216
+ border-radius: 30px;
217
+ cursor: pointer;
218
+ transition: background 0.2s;
219
+ letter-spacing: 0.3px;
220
+ }
221
+
222
+ .controls button:hover {
223
+ background: #333;
224
+ }
225
+
226
+ .controls button.secondary {
227
+ background: #e8e6e3;
228
+ color: #1a1a1a;
229
+ }
230
+
231
+ .controls button.secondary:hover {
232
+ background: #d5d2cd;
233
+ }
234
+
235
+ .controls .seed-input {
236
+ padding: 10px 16px;
237
+ font-size: 14px;
238
+ border: 1px solid #ccc;
239
+ border-radius: 30px;
240
+ font-family: 'Segoe UI', sans-serif;
241
+ width: 200px;
242
+ outline: none;
243
+ }
244
+
245
+ .controls .seed-input:focus {
246
+ border-color: #1a1a1a;
247
+ }
248
+
249
+ .badge {
250
+ font-size: 13px;
251
+ color: #777;
252
+ font-family: 'Segoe UI', sans-serif;
253
+ }
254
+
255
+ /* ----- Responsive ----- */
256
+ @media (max-width: 700px) {
257
+ .container {
258
+ padding: 30px 24px;
259
+ }
260
+
261
+ h1 {
262
+ font-size: 22px;
263
+ }
264
+
265
+ .controls {
266
+ flex-direction: column;
267
+ align-items: stretch;
268
+ }
269
+
270
+ .controls .seed-input {
271
+ width: 100%;
272
+ }
273
+ }
274
+
275
+ @media print {
276
+ body {
277
+ background: #fff;
278
+ padding: 0;
279
+ }
280
+ .container {
281
+ box-shadow: none;
282
+ padding: 40px 60px;
283
+ border-radius: 0;
284
+ }
285
+ .controls {
286
+ display: none !important;
287
+ }
288
+ .figure-box {
289
+ background: #fff;
290
+ border: 1px solid #ddd;
291
+ }
292
+ .table-wrap table {
293
+ background: #fff;
294
+ }
295
+ }
296
+ </style>
297
+ </head>
298
+
299
+ <body>
300
+
301
+ <!-- ============ CONTROLS ============ -->
302
+ <div class="controls">
303
+ <button id="generateBtn">⟳ Generate New Paper</button>
304
+ <button class="secondary" id="printBtn">🖨 Print / PDF</button>
305
+ <input type="text" id="seedInput" class="seed-input" placeholder="Seed (optional)" />
306
+ <span class="badge" id="seedDisplay">seed: random</span>
307
+ </div>
308
+
309
+ <!-- ============ PAPER ============ -->
310
+ <div class="container" id="paperContainer">
311
+ <!-- Everything inside is generated by JavaScript -->
312
+ </div>
313
+
314
+ <!-- ============ JAVASCRIPT ============ -->
315
+ <script>
316
+ // ================================================================
317
+ // SCIGEN — A Markov-chain academic paper generator
318
+ // Ported from the classic SCIgen (MIT) to pure JavaScript.
319
+ // Generates grammatically correct but semantically random CS papers.
320
+ // ================================================================
321
+
322
+ (function() {
323
+ 'use strict';
324
+
325
+ // ---- PRNG with seed support ----
326
+ let _seed = 42;
327
+
328
+ function setSeed(s) {
329
+ _seed = (typeof s === 'number' && !isNaN(s)) ? s : 42;
330
+ }
331
+
332
+ // Mulberry32 PRNG
333
+ function nextRandom() {
334
+ _seed = (_seed + 0x6D2B79F5) | 0;
335
+ let t = Math.imul(_seed ^ (_seed >>> 15), 1 | _seed);
336
+ t ^= t + Math.imul(t ^ (t >>> 7), 61 | t);
337
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
338
+ }
339
+
340
+ function randInt(min, max) {
341
+ return Math.floor(nextRandom() * (max - min + 1)) + min;
342
+ }
343
+
344
+ function pick(arr) {
345
+ return arr[randInt(0, arr.length - 1)];
346
+ }
347
+
348
+ // ---- Word lists (adapted from SCIgen) ----
349
+ const NOUNS = [
350
+ 'algorithm', 'network', 'system', 'method', 'approach', 'framework',
351
+ 'model', 'architecture', 'protocol', 'technique', 'paradigm', 'ontology',
352
+ 'heuristic', 'metric', 'kernel', 'schema', 'taxonomy', 'workflow',
353
+ 'pipeline', 'repository', 'infrastructure', 'interface', 'component',
354
+ 'module', 'agent', 'node', 'cluster', 'graph', 'tree', 'vector',
355
+ 'matrix', 'tensor', 'distribution', 'function', 'process', 'thread',
356
+ 'packet', 'stream', 'buffer', 'cache', 'proxy', 'gateway'
357
+ ];
358
+
359
+ const ADJECTIVES = [
360
+ 'adaptive', 'distributed', 'scalable', 'robust', 'efficient', 'novel',
361
+ 'hierarchical', 'incremental', 'probabilistic', 'deterministic',
362
+ 'stochastic', 'dynamic', 'static', 'recursive', 'iterative',
363
+ 'asymptotic', 'optimal', 'heuristic', 'greedy', 'genetic', 'neural',
364
+ 'bayesian', 'frequentist', 'semantic', 'syntactic', 'lexical',
365
+ 'morphological', 'phonological', 'cognitive', 'computational',
366
+ 'quantum', 'classical', 'relativistic', 'topological', 'algebraic'
367
+ ];
368
+
369
+ const VERBS = [
370
+ 'optimizes', 'computes', 'estimates', 'approximates', 'simulates',
371
+ 'generates', 'constructs', 'derives', 'formulates', 'solves',
372
+ 'classifies', 'clusters', 'regresses', 'predicts', 'interpolates',
373
+ 'extrapolates', 'normalizes', 'regularizes', 'converges', 'diverges',
374
+ 'encodes', 'decodes', 'encrypts', 'decrypts', 'compresses', 'decompresses'
375
+ ];
376
+
377
+ const ADVERBS = [
378
+ 'efficiently', 'robustly', 'adaptively', 'recursively', 'iteratively',
379
+ 'approximately', 'exactly', 'rapidly', 'gradually', 'significantly',
380
+ 'marginally', 'substantially', 'qualitatively', 'quantitatively'
381
+ ];
382
+
383
+ const PREPOSITIONS = [
384
+ 'of', 'in', 'for', 'on', 'with', 'at', 'by', 'through', 'across',
385
+ 'among', 'between', 'within', 'without', 'via', 'per'
386
+ ];
387
+
388
+ const CONJUNCTIONS = [
389
+ 'and', 'or', 'but', 'while', 'whereas', 'although', 'because', 'since'
390
+ ];
391
+
392
+ // ---- Paper sections ----
393
+ const SECTION_TITLES = [
394
+ 'Introduction', 'Background', 'Related Work', 'Methodology',
395
+ 'Experimental Setup', 'Results', 'Discussion', 'Conclusion',
396
+ 'Future Work', 'Limitations', 'Implementation Details'
397
+ ];
398
+
399
+ // ---- Sentence templates (produce grammatically correct English) ----
400
+ function generateSentence() {
401
+ const templates = [
402
+ function() { return `The ${pick(ADJECTIVES)} ${pick(NOUNS)} ${pick(VERBS)} the ${pick(ADJECTIVES)} ${pick(NOUNS)}.`; },
403
+ function() { return `We ${pick(VERBS)} the ${pick(NOUNS)} ${pick(ADVERBS)}.`; },
404
+ function() { return `Our ${pick(NOUNS)} ${pick(VERBS)} the ${pick(NOUNS)} ${pick(PREPOSITIONS)} ${pick(NOUNS)}.`; },
405
+ function() { return `This ${pick(ADJECTIVES)} ${pick(NOUNS)} ${pick(VERBS)} ${pick(ADVERBS)} ${pick(NOUNS)}.`; },
406
+ function() { return `The ${pick(NOUNS)} ${pick(VERBS)} ${pick(NOUNS)} ${pick(CONJUNCTIONS)} ${pick(NOUNS)}.`; },
407
+ function() { return `${pick(ADJECTIVES)} ${pick(NOUNS)} ${pick(VERBS)} the ${pick(ADJECTIVES)} ${pick(NOUNS)} ${pick(PREPOSITIONS)} ${pick(NOUNS)}.`; },
408
+ function() { return `We ${pick(VERBS)} ${pick(NOUNS)} ${pick(ADVERBS)} using ${pick(NOUNS)}.`; },
409
+ function() { return `The ${pick(NOUNS)} ${pick(VERBS)} ${pick(NOUNS)} ${pick(ADVERBS)}.`; },
410
+ function() { return `Our ${pick(ADJECTIVES)} ${pick(NOUNS)} ${pick(VERBS)} the ${pick(NOUNS)} ${pick(PREPOSITIONS)} ${pick(NOUNS)}.`; },
411
+ function() { return `This ${pick(NOUNS)} ${pick(VERBS)} ${pick(NOUNS)} ${pick(CONJUNCTIONS)} ${pick(NOUNS)}.`; },
412
+ ];
413
+ return pick(templates)();
414
+ }
415
+
416
+ function generateParagraph(sentences) {
417
+ const count = sentences || randInt(4, 8);
418
+ let paras = [];
419
+ for (let i = 0; i < count; i++) {
420
+ paras.push(generateSentence());
421
+ }
422
+ return paras.join(' ');
423
+ }
424
+
425
+ function generateTitle() {
426
+ const templates = [
427
+ function() { return `${pick(ADJECTIVES)} ${pick(NOUNS)} for ${pick(ADJECTIVES)} ${pick(NOUNS)}`; },
428
+ function() { return `Toward ${pick(ADJECTIVES)} ${pick(NOUNS)}: ${pick(VERBS)} ${pick(NOUNS)}`; },
429
+ function() { return `${pick(ADJECTIVES)} ${pick(NOUNS)} ${pick(PREPOSITIONS)} ${pick(NOUNS)}`; },
430
+ function() { return `${pick(NOUNS)} ${pick(VERBS)} ${pick(NOUNS)}: ${pick(ADJECTIVES)} ${pick(NOUNS)}`; },
431
+ function() { return `${pick(ADJECTIVES)} ${pick(NOUNS)} ${pick(CONJUNCTIONS)} ${pick(ADJECTIVES)} ${pick(NOUNS)}`; },
432
+ function() { return `On the ${pick(NOUNS)} ${pick(PREPOSITIONS)} ${pick(NOUNS)}`; },
433
+ function() { return `${pick(VERBS)} ${pick(NOUNS)} ${pick(ADVERBS)} ${pick(PREPOSITIONS)} ${pick(NOUNS)}`; },
434
+ ];
435
+ let t = pick(templates)();
436
+ return t.charAt(0).toUpperCase() + t.slice(1);
437
+ }
438
+
439
+ function generateAbstract() {
440
+ let sentences = [];
441
+ for (let i = 0; i < randInt(5, 9); i++) {
442
+ sentences.push(generateSentence());
443
+ }
444
+ return sentences.join(' ');
445
+ }
446
+
447
+ // ---- Fake authors ----
448
+ const FIRST_NAMES = ['John', 'Jane', 'Michael', 'Sarah', 'David', 'Emily',
449
+ 'Robert', 'Lisa', 'William', 'Karen', 'James', 'Nancy', 'Charles',
450
+ 'Betty', 'Thomas', 'Helen', 'Daniel', 'Sandra', 'Matthew', 'Donna'
451
+ ];
452
+ const LAST_NAMES = ['Smith', 'Johnson', 'Williams', 'Brown', 'Jones',
453
+ 'Garcia', 'Miller', 'Davis', 'Rodriguez', 'Martinez', 'Hernandez',
454
+ 'Lopez', 'Wilson', 'Anderson', 'Thomas', 'Taylor', 'Moore', 'Jackson',
455
+ 'Martin', 'Lee', 'Perez', 'Thompson', 'White', 'Harris', 'Sanchez'
456
+ ];
457
+ const UNIVS = ['MIT', 'Stanford University', 'UC Berkeley', 'Cambridge',
458
+ 'Oxford', 'ETH Zurich', 'Tsinghua University', 'University of Tokyo',
459
+ 'Carnegie Mellon', 'University of Washington', 'University of Toronto',
460
+ 'University of London'
461
+ ];
462
+
463
+ function generateAuthors() {
464
+ const count = randInt(1, 4);
465
+ let names = [];
466
+ for (let i = 0; i < count; i++) {
467
+ names.push(pick(FIRST_NAMES) + ' ' + pick(LAST_NAMES));
468
+ }
469
+ return names;
470
+ }
471
+
472
+ // ---- Fake figures (SVG) ----
473
+ function generateFigure() {
474
+ const chartType = pick(['bar', 'scatter', 'line']);
475
+ let svg = '';
476
+ const w = 420,
477
+ h = 220;
478
+
479
+ if (chartType === 'bar') {
480
+ const bars = randInt(5, 9);
481
+ const data = [];
482
+ let total = 0;
483
+ for (let i = 0; i < bars; i++) {
484
+ const v = nextRandom() * 0.7 + 0.1;
485
+ data.push(v);
486
+ total += v;
487
+ }
488
+ const maxVal = Math.max(...data) * 1.25;
489
+ const barWidth = w / (bars * 1.8);
490
+ const gap = barWidth * 0.6;
491
+ svg =
492
+ `<svg viewBox="0 0 ${w} ${h}" xmlns="http://www.w3.org/2000/svg" style="background:#fafafa;border-radius:4px;">`;
493
+ svg += `<rect x="0" y="0" width="${w}" height="${h}" fill="#fafafa" rx="4"/>`;
494
+ for (let i = 0; i < data.length; i++) {
495
+ const x = i * (barWidth + gap) + gap;
496
+ const barH = (data[i] / maxVal) * (h - 40);
497
+ const y = h - 20 - barH;
498
+ const hue = (i / data.length) * 270 + 180;
499
+ svg +=
500
+ `<rect x="${x}" y="${y}" width="${barWidth}" height="${barH}" fill="hsl(${hue},65%,55%)" rx="2"/>`;
501
+ }
502
+ svg += `<line x1="10" y1="${h-20}" x2="${w-10}" y2="${h-20}" stroke="#888" stroke-width="1"/>`;
503
+ svg +=
504
+ `<line x1="10" y1="10" x2="10" y2="${h-20}" stroke="#888" stroke-width="1"/>`;
505
+ svg += `</svg>`;
506
+ } else if (chartType === 'scatter') {
507
+ const points = randInt(15, 35);
508
+ svg =
509
+ `<svg viewBox="0 0 ${w} ${h}" xmlns="http://www.w3.org/2000/svg" style="background:#fafafa;border-radius:4px;">`;
510
+ svg += `<rect x="0" y="0" width="${w}" height="${h}" fill="#fafafa" rx="4"/>`;
511
+ for (let i = 0; i < points; i++) {
512
+ const x = nextRandom() * (w - 30) + 15;
513
+ const y = nextRandom() * (h - 30) + 15;
514
+ const r = nextRandom() * 4 + 2;
515
+ const hue = 200 + nextRandom() * 60;
516
+ svg +=
517
+ `<circle cx="${x}" cy="${y}" r="${r}" fill="hsla(${hue},70%,50%,0.7)" stroke="hsla(${hue},70%,40%,0.3)" stroke-width="0.5"/>`;
518
+ }
519
+ svg += `</svg>`;
520
+ } else { // line
521
+ const pts = randInt(8, 14);
522
+ svg =
523
+ `<svg viewBox="0 0 ${w} ${h}" xmlns="http://www.w3.org/2000/svg" style="background:#fafafa;border-radius:4px;">`;
524
+ svg += `<rect x="0" y="0" width="${w}" height="${h}" fill="#fafafa" rx="4"/>`;
525
+ let path = '';
526
+ let lastY = 0;
527
+ for (let i = 0; i < pts; i++) {
528
+ const x = (i / (pts - 1)) * (w - 30) + 15;
529
+ const y = h - 20 - (nextRandom() * 0.6 + 0.1) * (h - 40);
530
+ if (i === 0) path += `M ${x} ${y}`;
531
+ else path += ` L ${x} ${y}`;
532
+ lastY = y;
533
+ }
534
+ svg += `<polyline points="${path.substring(path.indexOf('M') + 2).trim()}" fill="none" stroke="#2563eb" stroke-width="2.5" stroke-linecap="round"/>`;
535
+ svg += `<circle cx="${15}" cy="${h-20-(nextRandom()*0.6+0.1)*(h-40)}" r="5" fill="#2563eb" opacity="0.3"/>`;
536
+ svg += `</svg>`;
537
+