generated from fastai/fast_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux-tutorials.html
More file actions
803 lines (686 loc) · 28.5 KB
/
linux-tutorials.html
File metadata and controls
803 lines (686 loc) · 28.5 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Linux Tutorials - Capitalmind</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: #f5f5f5;
background: #262725;
min-height: 100vh;
overflow-x: hidden;
}
html {
background: #262725;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
.header {
text-align: center;
color: #f5f5f5;
margin-bottom: 3rem;
}
.header h1 {
font-size: 3rem;
margin-bottom: 0.5rem;
font-weight: 300;
color: #cc785c;
}
.header .subtitle {
font-size: 1.2rem;
opacity: 0.9;
margin-bottom: 2rem;
}
/* Navigation Menu */
.nav-menu {
display: flex;
justify-content: center;
gap: 1.5rem;
flex-wrap: wrap;
margin: 2rem 0;
}
.nav-menu a {
color: #cc785c;
text-decoration: none;
padding: 0.75rem 1.5rem;
border: 1px solid #cc785c;
border-radius: 5px;
transition: all 0.3s ease;
font-weight: 500;
}
.nav-menu a:hover {
background: #cc785c;
color: #f5f5f5;
}
.nav-menu a.active {
background: #cc785c;
color: #f5f5f5;
}
.links {
display: flex;
justify-content: center;
gap: 2rem;
margin-top: 2rem;
}
.links a {
color: #f5f5f5;
font-size: 1.5rem;
transition: transform 0.3s ease;
}
.links a:hover {
transform: scale(1.2);
}
.card {
background: #262725;
border-radius: 15px;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
transition: transform 0.3s ease;
border: 1px solid #3a3a3a;
}
.card h2 {
color: #cc785c;
margin-bottom: 1rem;
font-size: 1.5rem;
}
/* Command Bubbles Grid */
.commands-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 1rem;
margin-top: 2rem;
}
.command-bubble {
background: #3a3a3a;
border: 2px solid #cc785c;
border-radius: 12px;
padding: 1rem;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
height: 120px;
display: flex;
flex-direction: column;
justify-content: center;
}
.command-bubble:hover {
background: #cc785c;
color: #f5f5f5;
transform: translateY(-3px);
box-shadow: 0 8px 20px rgba(204, 120, 92, 0.3);
}
.command-bubble h3 {
font-size: 1.1rem;
margin-bottom: 0.3rem;
color: #cc785c;
}
.command-bubble:hover h3 {
color: #f5f5f5;
}
.command-bubble p {
font-size: 0.85rem;
opacity: 0.8;
}
.command-bubble .icon {
font-size: 1.5rem;
margin-bottom: 0.5rem;
color: #cc785c;
}
.command-bubble:hover .icon {
color: #f5f5f5;
}
/* Video Player Styles */
.video-display {
background: #1a1a1a;
border-radius: 10px;
padding: 2rem;
margin: 2rem 0;
border: 2px solid #3a3a3a;
min-height: 400px;
position: relative;
}
.video-display h3 {
color: #cc785c;
margin-bottom: 1rem;
font-size: 1.5rem;
}
.video-container {
position: relative;
margin-bottom: 1rem;
}
.demo-video {
width: 100%;
height: auto;
max-height: 60vh;
border-radius: 8px;
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
background: #000;
}
.video-controls {
display: flex;
justify-content: center;
gap: 1rem;
margin: 1rem 0;
flex-wrap: wrap;
}
.video-btn {
background: #cc785c;
color: #f5f5f5;
border: none;
padding: 0.5rem 1rem;
border-radius: 5px;
cursor: pointer;
font-size: 0.9rem;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 0.5rem;
}
.video-btn:hover {
background: #b8704a;
transform: translateY(-2px);
}
.video-btn:disabled {
background: #555;
cursor: not-allowed;
transform: none;
}
.fullscreen-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.95);
z-index: 1000;
display: none;
justify-content: center;
align-items: center;
}
.fullscreen-video {
width: 90vw;
height: 90vh;
max-width: 1920px;
max-height: 1080px;
object-fit: contain;
}
.fullscreen-close {
position: absolute;
top: 20px;
right: 20px;
background: #cc785c;
color: #f5f5f5;
border: none;
width: 50px;
height: 50px;
border-radius: 50%;
font-size: 1.5rem;
cursor: pointer;
z-index: 1001;
display: flex;
align-items: center;
justify-content: center;
}
.demo-description {
margin-top: 1rem;
padding: 1rem;
background: #2a2a2a;
border-radius: 8px;
border-left: 4px solid #cc785c;
}
.contact-info {
text-align: center;
color: #f5f5f5;
margin-top: 2rem;
}
/* Loading indicator */
.video-loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #cc785c;
font-size: 1.2rem;
}
@media (max-width: 768px) {
.header h1 {
font-size: 2rem;
}
.container {
padding: 1rem;
}
.commands-grid {
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 0.8rem;
}
.command-bubble {
height: 100px;
padding: 0.8rem;
}
.command-bubble .icon {
font-size: 1.2rem;
margin-bottom: 0.3rem;
}
.command-bubble h3 {
font-size: 1rem;
}
.command-bubble p {
font-size: 0.8rem;
}
.nav-menu {
gap: 0.5rem;
}
.nav-menu a {
padding: 0.5rem 1rem;
font-size: 0.9rem;
}
.video-controls {
gap: 0.5rem;
}
.video-btn {
padding: 0.4rem 0.8rem;
font-size: 0.8rem;
}
.fullscreen-video {
width: 95vw;
height: 85vh;
}
}
</style>
</head>
<body>
<div class="container">
<header class="header">
<h1>Linux Tutorials</h1>
<p class="subtitle">Interactive Command Demonstrations</p>
<!-- Navigation Menu -->
<nav class="nav-menu">
<a href="index.html">Home</a>
<a href="linux-tutorials.html" class="active">>_ Linux Tutorials</a>
<a href="machine-learning.html"><i class="fas fa-brain"></i> Machine Learning</a>
<a href="projects.html">Projects</a>
<a href="trading.html">Trading</a>
<a href="research.html">Research</a>
</nav>
<div class="links">
<a href="https://github.com/Capitalmind" title="GitHub" target="_blank" rel="noopener noreferrer"><i class="fab fa-github"></i></a>
<a href="mailto:tech@skynode.one" title="Email"><i class="fas fa-envelope"></i></a>
<a href="https://x.com/Alt_Samman" title="X (Twitter)" target="_blank" rel="noopener noreferrer"><i class="fab fa-twitter"></i></a>
</div>
</header>
<!-- Video Display Area -->
<div id="video-display" class="video-display">
<h3 id="demo-title">Welcome to Linux Tutorials</h3>
<div class="video-container">
<video
id="demo-video"
class="demo-video"
controls
preload="metadata"
autoplay
muted
poster=""
>
<source src="assets/welcome-demo.webm" type="video/webm">
Your browser does not support the video tag.
</video>
<div id="video-loading" class="video-loading" style="display: none;">
<i class="fas fa-spinner fa-spin"></i> Loading video...
</div>
</div>
<div class="video-controls">
<button id="play-pause-btn" class="video-btn">
<i class="fas fa-play"></i> Play/Pause
</button>
<button id="restart-btn" class="video-btn">
<i class="fas fa-redo"></i> Restart
</button>
<button id="fullscreen-btn" class="video-btn">
<i class="fas fa-expand"></i> Fullscreen
</button>
<button id="mute-btn" class="video-btn">
<i class="fas fa-volume-up"></i> Mute
</button>
</div>
<div class="demo-description">
<p id="demo-description">Click on any command below to see a live demonstration. These recordings show practical usage from decades of Linux experience.</p>
</div>
</div>
<!-- Fullscreen Overlay -->
<div id="fullscreen-overlay" class="fullscreen-overlay">
<button id="fullscreen-close" class="fullscreen-close">
<i class="fas fa-times"></i>
</button>
<video
id="fullscreen-video"
class="fullscreen-video"
controls
autoplay
>
<source src="" type="video/webm">
</video>
</div>
<div class="card">
<h2><i class="fas fa-terminal"></i> Command Demonstrations</h2>
<p>Click on any command below to see a live demonstration in the video player above.</p>
<div class="commands-grid">
<div class="command-bubble" onclick="showDemo('bash', 'Bash Shell Fundamentals', 'Master the most common Linux shell with essential commands and scripting')">
<div class="icon"><i class="fas fa-terminal"></i></div>
<h3>bash</h3>
<p>Shell basics</p>
</div>
<div class="command-bubble" onclick="showDemo('zsh', 'Zsh Advanced Features', 'Explore the powerful Z shell with advanced completion and customization')">
<div class="icon"><i class="fas fa-magic"></i></div>
<h3>zsh</h3>
<p>Advanced shell</p>
</div>
<div class="command-bubble" onclick="showDemo('fish', 'Fish Shell Innovation', 'Discover the user-friendly shell with intelligent autosuggestions')">
<div class="icon"><i class="fas fa-fish"></i></div>
<h3>fish</h3>
<p>Smart shell</p>
</div>
<div class="command-bubble" onclick="showDemo('alias', 'Shell aliases and shortcuts', 'Create custom shortcuts for frequently used commands')">
<div class="icon"><i class="fas fa-link"></i></div>
<h3>alias</h3>
<p>Shell shortcuts</p>
</div>
<div class="command-bubble" onclick="showDemo('awk', 'Text processing powerhouse', 'Advanced text manipulation and data extraction')">
<div class="icon"><i class="fas fa-code"></i></div>
<h3>awk</h3>
<p>Text processing</p>
</div>
<div class="command-bubble" onclick="showDemo('curl', 'Data transfer tool', 'Download files and interact with APIs')">
<div class="icon"><i class="fas fa-download"></i></div>
<h3>curl</h3>
<p>Data transfer</p>
</div>
<div class="command-bubble" onclick="showDemo('cut', 'Column extraction', 'Extract specific columns from text files')">
<div class="icon"><i class="fas fa-cut"></i></div>
<h3>cut</h3>
<p>Column extraction</p>
</div>
<div class="command-bubble" onclick="showDemo('find', 'File system search', 'Locate files and directories with powerful filters')">
<div class="icon"><i class="fas fa-search"></i></div>
<h3>find</h3>
<p>File search</p>
</div>
<div class="command-bubble" onclick="showDemo('grep', 'Pattern matching', 'Search text patterns in files and output')">
<div class="icon"><i class="fas fa-filter"></i></div>
<h3>grep</h3>
<p>Pattern search</p>
</div>
<div class="command-bubble" onclick="showDemo('head-tail', 'File head and tail', 'View beginning and end of files')">
<div class="icon"><i class="fas fa-file-alt"></i></div>
<h3>head/tail</h3>
<p>File viewing</p>
</div>
<div class="command-bubble" onclick="showDemo('jq', 'JSON processor', 'Parse and manipulate JSON data')">
<div class="icon"><i class="fas fa-code-branch"></i></div>
<h3>jq</h3>
<p>JSON parsing</p>
</div>
<div class="command-bubble" onclick="showDemo('log-analysis', 'Log file analysis', 'Analyze system and application logs')">
<div class="icon"><i class="fas fa-chart-line"></i></div>
<h3>log analysis</h3>
<p>Log parsing</p>
</div>
<div class="command-bubble" onclick="showDemo('ripgrep', 'Fast text search', 'Lightning-fast recursive text search')">
<div class="icon"><i class="fas fa-bolt"></i></div>
<h3>ripgrep</h3>
<p>Fast search</p>
</div>
<div class="command-bubble" onclick="showDemo('rsync', 'File synchronization', 'Efficiently sync files and directories')">
<div class="icon"><i class="fas fa-sync"></i></div>
<h3>rsync</h3>
<p>File sync</p>
</div>
<div class="command-bubble" onclick="showDemo('sed', 'Stream editor', 'Edit text streams and files')">
<div class="icon"><i class="fas fa-edit"></i></div>
<h3>sed</h3>
<p>Stream editing</p>
</div>
<div class="command-bubble" onclick="showDemo('sort', 'Text sorting', 'Sort lines of text files')">
<div class="icon"><i class="fas fa-sort"></i></div>
<h3>sort</h3>
<p>Text sorting</p>
</div>
<div class="command-bubble" onclick="showDemo('tar', 'Archive management', 'Create and extract compressed archives')">
<div class="icon"><i class="fas fa-file-archive"></i></div>
<h3>tar</h3>
<p>Archives</p>
</div>
<div class="command-bubble" onclick="showDemo('tmux', 'Terminal multiplexer', 'Manage multiple terminal sessions')">
<div class="icon"><i class="fas fa-window-restore"></i></div>
<h3>tmux</h3>
<p>Terminal sessions</p>
</div>
<div class="command-bubble" onclick="showDemo('uniq', 'Remove duplicates', 'Filter out duplicate lines')">
<div class="icon"><i class="fas fa-layer-group"></i></div>
<h3>uniq</h3>
<p>Deduplication</p>
</div>
<div class="command-bubble" onclick="showDemo('xargs', 'Argument builder', 'Build and execute commands from input')">
<div class="icon"><i class="fas fa-tools"></i></div>
<h3>xargs</h3>
<p>Command builder</p>
</div>
<div class="command-bubble" onclick="showDemo('glances', 'System monitoring', 'Real-time system performance monitoring')">
<div class="icon"><i class="fas fa-tachometer-alt"></i></div>
<h3>glances</h3>
<p>System monitor</p>
</div>
<div class="command-bubble" onclick="showDemo('htop', 'Process viewer', 'Interactive process viewer and manager')">
<div class="icon"><i class="fas fa-microchip"></i></div>
<h3>htop</h3>
<p>Process manager</p>
</div>
<div class="command-bubble" onclick="showDemo('fzf', 'Fuzzy finder', 'Command-line fuzzy finder for files and commands')">
<div class="icon"><i class="fas fa-search-plus"></i></div>
<h3>fzf</h3>
<p>Fuzzy search</p>
</div>
<div class="command-bubble" onclick="showDemo('fd', 'Modern find', 'Simple, fast and user-friendly alternative to find')">
<div class="icon"><i class="fas fa-rocket"></i></div>
<h3>fd</h3>
<p>Fast find</p>
</div>
<div class="command-bubble" onclick="showDemo('ncdu', 'Disk usage analyzer', 'Interactive disk usage analyzer with ncurses interface')">
<div class="icon"><i class="fas fa-chart-pie"></i></div>
<h3>ncdu</h3>
<p>Disk analyzer</p>
</div>
<div class="command-bubble" onclick="showDemo('ps-top-jobs', 'Process management', 'Monitor processes with ps, top, and job control')">
<div class="icon"><i class="fas fa-tasks"></i></div>
<h3>ps/top/jobs</h3>
<p>Process control</p>
</div>
<div class="command-bubble" onclick="showDemo('systemctl', 'Service management', 'Control systemd services and system state')">
<div class="icon"><i class="fas fa-cogs"></i></div>
<h3>systemctl</h3>
<p>Service control</p>
</div>
<div class="command-bubble" onclick="showDemo('cron', 'Task scheduling', 'Automate tasks with cron jobs and scheduling')">
<div class="icon"><i class="fas fa-clock"></i></div>
<h3>cron</h3>
<p>Task scheduler</p>
</div>
<div class="command-bubble" onclick="showDemo('docker', 'Container management', 'Build, run, and manage Docker containers')">
<div class="icon"><i class="fab fa-docker"></i></div>
<h3>docker</h3>
<p>Containers</p>
</div>
<div class="command-bubble" onclick="showDemo('git', 'Version control', 'Manage code repositories with Git version control')">
<div class="icon"><i class="fab fa-git-alt"></i></div>
<h3>git</h3>
<p>Version control</p>
</div>
<div class="command-bubble" onclick="showDemo('ssh', 'Secure shell', 'Remote access and secure file transfer')">
<div class="icon"><i class="fas fa-key"></i></div>
<h3>ssh</h3>
<p>Remote access</p>
</div>
<div class="command-bubble" onclick="showDemo('vim', 'Vim text editor', 'Powerful modal text editor with advanced editing capabilities')">
<div class="icon"><i class="fas fa-keyboard"></i></div>
<h3>vim</h3>
<p>Modal editor</p>
</div>
<div class="command-bubble" onclick="showDemo('ln', 'Create file links', 'Create hard and soft links between files and directories')">
<div class="icon"><i class="fas fa-link"></i></div>
<h3>ln</h3>
<p>File linking</p>
</div>
<div class="command-bubble" onclick="showDemo('df-du', 'Disk space analysis', 'Monitor disk usage and free space with df and du commands')">
<div class="icon"><i class="fas fa-hdd"></i></div>
<h3>df/du</h3>
<p>Disk usage</p>
</div>
<div class="command-bubble" onclick="showDemo('nano', 'Nano text editor', 'Simple and user-friendly command-line text editor')">
<div class="icon"><i class="fas fa-edit"></i></div>
<h3>nano</h3>
<p>Text editing</p>
</div>
</div>
</div>
<div class="contact-info">
<p>More tutorials coming soon! These demonstrations show practical usage patterns from decades of Linux experience.</p>
<p style="margin-top: 1rem; opacity: 0.8;">Now featuring 35 interactive video demonstrations including system administration, containers, version control, text editing, file linking, disk analysis, and remote access tools.</p>
</div>
</div>
<script>
// Get video elements and controls
const demoVideo = document.getElementById('demo-video');
const fullscreenVideo = document.getElementById('fullscreen-video');
const fullscreenOverlay = document.getElementById('fullscreen-overlay');
const videoLoading = document.getElementById('video-loading');
// Control buttons
const playPauseBtn = document.getElementById('play-pause-btn');
const restartBtn = document.getElementById('restart-btn');
const fullscreenBtn = document.getElementById('fullscreen-btn');
const muteBtn = document.getElementById('mute-btn');
const fullscreenCloseBtn = document.getElementById('fullscreen-close');
// Video control functions
function togglePlayPause() {
if (demoVideo.paused) {
demoVideo.play();
} else {
demoVideo.pause();
}
}
function restartVideo() {
demoVideo.currentTime = 0;
demoVideo.play();
}
function toggleMute() {
demoVideo.muted = !demoVideo.muted;
const icon = muteBtn.querySelector('i');
icon.className = demoVideo.muted ? 'fas fa-volume-mute' : 'fas fa-volume-up';
}
function openFullscreen() {
const currentSrc = demoVideo.querySelector('source').src;
fullscreenVideo.querySelector('source').src = currentSrc;
fullscreenVideo.load();
fullscreenVideo.currentTime = demoVideo.currentTime;
fullscreenOverlay.style.display = 'flex';
// Pause main video and play fullscreen video
demoVideo.pause();
fullscreenVideo.play();
}
function closeFullscreen() {
fullscreenOverlay.style.display = 'none';
fullscreenVideo.pause();
// Sync time back to main video
demoVideo.currentTime = fullscreenVideo.currentTime;
}
// Event listeners for controls
playPauseBtn.addEventListener('click', togglePlayPause);
restartBtn.addEventListener('click', restartVideo);
fullscreenBtn.addEventListener('click', openFullscreen);
muteBtn.addEventListener('click', toggleMute);
fullscreenCloseBtn.addEventListener('click', closeFullscreen);
// Close fullscreen on overlay click
fullscreenOverlay.addEventListener('click', function(e) {
if (e.target === fullscreenOverlay) {
closeFullscreen();
}
});
// Escape key to close fullscreen
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape' && fullscreenOverlay.style.display === 'flex') {
closeFullscreen();
}
});
// Video loading states
demoVideo.addEventListener('loadstart', function() {
videoLoading.style.display = 'block';
});
demoVideo.addEventListener('canplay', function() {
videoLoading.style.display = 'none';
});
demoVideo.addEventListener('error', function() {
videoLoading.style.display = 'none';
console.log('Video failed to load');
});
// Update play/pause button based on video state
demoVideo.addEventListener('play', function() {
playPauseBtn.innerHTML = '<i class="fas fa-pause"></i> Play/Pause';
});
demoVideo.addEventListener('pause', function() {
playPauseBtn.innerHTML = '<i class="fas fa-play"></i> Play/Pause';
});
// Main demo function
function showDemo(command, title, description) {
const demoTitle = document.getElementById('demo-title');
const demoDescription = document.getElementById('demo-description');
const demoDisplay = document.getElementById('video-display');
const videoSource = demoVideo.querySelector('source');
// Show loading indicator
videoLoading.style.display = 'block';
// Set content
demoTitle.textContent = title;
demoDescription.textContent = description;
// Update video source
videoSource.src = `assets/${command}-demo.webm`;
demoVideo.load();
// Auto-play the video
demoVideo.addEventListener('canplay', function() {
demoVideo.play();
}, { once: true });
// Scroll to video player
if (demoDisplay.scrollIntoView) {
demoDisplay.scrollIntoView({
behavior: 'smooth',
block: 'start',
inline: 'nearest'
});
} else {
window.scrollTo({
top: demoDisplay.offsetTop - 20,
behavior: 'smooth'
});
}
}
// Initialize with welcome video
window.addEventListener('load', function() {
// Set initial state
const demoTitle = document.getElementById('demo-title');
const demoDescription = document.getElementById('demo-description');
demoTitle.textContent = 'Welcome to Linux Tutorials';
demoDescription.textContent = 'Click on any command below to see a live demonstration. These recordings show practical usage from decades of Linux experience.';
});
</script>
</body>
</html>