Aashish34 commited on
Commit
745192b
Β·
1 Parent(s): dd5924f

add prompt enginnering

Browse files
README.md CHANGED
@@ -1,163 +1,133 @@
1
  # πŸ“Š DataScience Learning Hub
2
 
3
- Welcome to a comprehensive collection of educational web projects for learning data science! This repository contains multiple interactive courses and resources covering statistics, machine learning, visualization, mathematics, and feature engineering.
4
-
5
- ## 🎯 Live Demos
6
-
7
- Visit our courses directly in your browser:
8
-
9
- - [πŸ“ˆ Interactive Statistics Course](https://aashishgarg13.github.io/DataScience/complete-statistics/)
10
- - [πŸ€– Machine Learning Guide](https://aashishgarg13.github.io/DataScience/ml_complete-all-topics/)
11
- - [πŸ“Š Data Visualization](https://aashishgarg13.github.io/DataScience/Visualization/)
12
- - [πŸ”’ Mathematics for Data Science](https://aashishgarg13.github.io/DataScience/math-ds-complete/)
13
- - [βš™οΈ Feature Engineering Guide](https://aashishgarg13.github.io/DataScience/feature-engineering/)
14
-
15
- ## πŸ“š Contents
16
-
17
- ### πŸ“ˆ Complete Statistics Course
18
- - **Location:** `complete-statistics/`
19
- - **Features:**
20
- - 40+ Interactive Topics
21
- - Descriptive Statistics
22
- - Probability & Distributions
23
- - Hypothesis Testing
24
- - Interactive Visualizations & Canvas
25
- - Hands-on Learning Experience
26
-
27
- ### πŸ€– Machine Learning Guide
28
- - **Location:** `ml_complete-all-topics/`
29
- - **Features:**
30
- - Comprehensive ML Topics
31
- - Interactive Demonstrations
32
- - Visual Learning Aids
33
- - Step-by-Step Explanations
34
-
35
- ### πŸ“Š Data Visualization
36
- - **Location:** `Visualization/`
37
- - **Features:**
38
- - Interactive Data Visualization Examples
39
- - Chart Types and Best Practices
40
- - Dynamic Visualization Techniques
41
- - Data Presentation Guidelines
42
-
43
- ### πŸ”’ Mathematics for Data Science
44
- - **Location:** `math-ds-complete/`
45
- - **Features:**
46
- - Linear Algebra Fundamentals
47
- - Calculus for Machine Learning
48
- - Statistical Mathematics
49
- - Optimization Theory
50
-
51
- ### βš™οΈ Feature Engineering Guide
52
- - **Location:** `feature-engineering/`
53
- - **Features:**
54
- - Data Preprocessing Techniques
55
- - Feature Selection Methods
56
- - Feature Transformation
57
- - Dimensionality Reduction
58
-
59
- > πŸ’‘ Both projects are pure static websites - no server needed! Open directly in your browser or use a simple static server.
60
-
61
- ## πŸš€ Quick Start
62
-
63
- ### Option A: View Online
64
- Visit our GitHub Pages hosted versions:
65
- 1. [Statistics Course](https://aashishgarg13.github.io/DataScience/complete-statistics/)
66
- 2. [Machine Learning Guide](https://aashishgarg13.github.io/DataScience/ml_complete-all-topics/)
67
-
68
- ### Option B: Run Locally (Recommended for Development)
69
-
70
- #### Simple Browser Opening:
71
- 1. Clone this repository
72
- 2. Navigate to either project folder
73
- 3. Double-click `index.html`
74
-
75
- #### Using Local Server (Recommended to avoid CORS issues):
76
-
77
- From the repository root, run one of the following in a terminal:
78
 
79
  ```bash
80
- # Python 3 (simple static server, available on macOS):
81
  python3 -m http.server 8000
82
 
83
- # or using Node.js http-server (if installed):
84
- npx http-server -c-1 . 8000
 
 
 
 
85
  ```
86
 
87
- Then open http://localhost:8000/complete-statistics/ or http://localhost:8000/ml_complete-all-topics/ in your browser.
88
 
89
- ## Deploy to GitHub Pages
90
 
91
- 1. Push your changes to the `main` branch on GitHub (already done for this repo).
92
- 2. In your repository settings on GitHub, go to "Pages" and select the `main` branch and root (`/`) as the source, or set the `gh-pages` branch if you prefer.
93
- 3. Save β€” GitHub Pages will publish the site. For multi-site repos you can add a `docs/` folder or create separate branches, or create a small repo per site.
94
 
95
- Because these are static sites you can also host them on Netlify, Vercel, or any static host.
96
 
97
- ## πŸ“ Project Structure
98
 
99
- ### Statistics Course
100
- ```
101
  complete-statistics/
102
- β”œβ”€β”€ index.html # Main course interface
103
- β”œβ”€β”€ style.css # Course styling
104
- └── app.js # Interactive visualizations
105
- ```
106
 
107
- ### Machine Learning Guide
108
- ```
109
  ml_complete-all-topics/
110
- β”œβ”€β”€ index.html # Main guide interface
111
- β”œβ”€β”€ style.css # Guide styling
112
- └── app.js # Interactive components
113
- ```
114
 
115
- ### Data Visualization
116
- ```
117
  Visualization/
118
- β”œβ”€β”€ index.html # Visualization examples
119
- β”œβ”€β”€ style.css # Visualization styling
120
- └── app.js # Interactive charts
121
- ```
122
 
123
- ### Mathematics for Data Science
124
- ```
125
  math-ds-complete/
126
- β”œβ”€β”€ index.html # Mathematics course interface
127
- β”œβ”€β”€ style.css # Course styling
128
- └── app.js # Interactive math demonstrations
129
- ```
130
 
131
- ### Feature Engineering Guide
132
- ```
133
  feature-engineering/
134
- β”œβ”€β”€ index.html # Feature engineering guide
135
- β”œβ”€β”€ style.css # Guide styling
136
- └── app.js # Interactive examples
137
- ```
 
 
 
 
 
 
 
138
 
139
- ## Notes about repository cleanup
140
 
141
- While repairing the repository I removed macOS Finder metadata files (names beginning with `._`) that had been added inside the `.git` metadata and working tree. Those `._*` files are resource-fork metadata and are not project code. A `.gitignore` entry was added to ignore these moving forward:
142
 
143
  ```
144
  ._*
145
  .DS_Store
146
- >__MACOSX/
147
  ```
148
 
149
- If you want to inspect any backup I created of the original `.git`, look for directories named `.git.broken_<timestamp>` in the repository root β€” they contain the backed-up git metadata.
150
 
151
- ## Contributing
 
 
 
 
 
152
 
153
- If you'd like me to expand this README with:
154
 
155
- - per-subproject detailed run instructions and screenshots
156
- - short descriptions of each interactive demo and what files to edit
157
- - automated preview script to open both sites in the browser
158
 
159
- Tell me which of the above you want and I will add it.
160
 
161
  ## License
162
 
163
- Use or adapt however you like (no license file present; if you want one, tell me which license and I'll add it).
 
 
1
  # πŸ“Š DataScience Learning Hub
2
 
3
+ Welcome β€” a single repo that hosts several static, interactive learning resources for data science. Everything here is pure HTML/CSS/JS and works either by opening the `index.html` files in your browser or by serving the repo with a simple static server.
4
+
5
+ ## 🎯 Live demos (GitHub Pages)
6
+
7
+ Open the projects directly (after you enable GitHub Pages for the repo):
8
+
9
+ - πŸ“ˆ Interactive Statistics Course β€” https://aashishgarg13.github.io/DataScience/complete-statistics/
10
+ - πŸ€– Machine Learning Guide β€” https://aashishgarg13.github.io/DataScience/ml_complete-all-topics/
11
+ - πŸ“Š Data Visualization β€” https://aashishgarg13.github.io/DataScience/Visualization/
12
+ - πŸ”’ Mathematics for Data Science β€” https://aashishgarg13.github.io/DataScience/math-ds-complete/
13
+ - βš™οΈ Feature Engineering Guide β€” https://aashishgarg13.github.io/DataScience/feature-engineering/
14
+
15
+ If you want me to set up a small demo page that lists these and includes thumbnails, I can add it.
16
+
17
+ ## πŸ”— Prompt engineering resources
18
+
19
+ This repo focuses on data science, but many workflows now rely on well-crafted prompts. Useful prompt-engineering references:
20
+
21
+ - Learn Prompting (interactive guide): https://learnprompting.org/
22
+ - Prompt Engineering Guide (community-maintained): https://github.com/dair-ai/Prompt-Engineering-Guide
23
+
24
+ Add one of these links to your docs or course materials where you introduce LLMs and prompts.
25
+
26
+ ---
27
+
28
+ ## πŸ“š What’s inside (folders)
29
+
30
+ Each folder contains a standalone static site (open `index.html`). Brief overview:
31
+
32
+ - `complete-statistics/` β€” Interactive Statistics Course (40+ topics, visualizations, canvas demos).
33
+ - `ml_complete-all-topics/` β€” Large Mathematics / ML / Statistics learning platform (125+ topics across subjects; uses many canvas visualizations and interactive examples).
34
+ - `Visualization/` β€” Data visualization examples and interactive charts.
35
+ - `math-ds-complete/` β€” Mathematics for data science: linear algebra, calculus, optimization.
36
+ - `feature-engineering/` β€” Feature engineering notes and interactive examples.
37
+
38
+ All folders are static. No server-side code.
39
+
40
+ ## πŸš€ Quick start β€” view locally
41
+
42
+ Option 1 β€” open file directly:
43
+
44
+ 1. In Finder or your OS file manager, double-click the folder you want and open `index.html`.
45
+
46
+ Option 2 β€” run a local static server (recommended):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
  ```bash
49
+ # from repository root
50
  python3 -m http.server 8000
51
 
52
+ # then open one of:
53
+ http://localhost:8000/complete-statistics/
54
+ http://localhost:8000/ml_complete-all-topics/
55
+ http://localhost:8000/Visualization/
56
+ http://localhost:8000/math-ds-complete/
57
+ http://localhost:8000/feature-engineering/
58
  ```
59
 
60
+ Tip: using a local server avoids some browser restrictions (CORS, file:// quirks) and provides consistent behaviour for the JS visualizations.
61
 
62
+ ## βœ… Local file checks I ran
63
 
64
+ - Verified `ml_complete-all-topics/` contains `index.html`, `style.css`, and `app.js` (these are referenced by the page).
65
+ - No external CDN dependencies are required by the core sites (the pages use local CSS/JS and canvas APIs).
66
+ - No image assets referenced directly inside `ml_complete-all-topics/index.html` (no missing .png/.jpg/.svg references found).
67
 
68
+ If you'd like, I can add a tiny verification script (Python) that scans each `index.html` for href/src and confirms the referenced files exist.
69
 
70
+ ## πŸ“ Project file layout (example)
71
 
 
 
72
  complete-statistics/
73
+ β”œβ”€β”€ index.html
74
+ β”œβ”€β”€ style.css
75
+ └── app.js
 
76
 
 
 
77
  ml_complete-all-topics/
78
+ β”œβ”€β”€ index.html
79
+ β”œβ”€β”€ style.css
80
+ └── app.js
 
81
 
 
 
82
  Visualization/
83
+ β”œβ”€β”€ index.html
84
+ β”œβ”€β”€ style.css
85
+ └── app.js
 
86
 
 
 
87
  math-ds-complete/
88
+ β”œβ”€β”€ index.html
89
+ β”œβ”€β”€ style.css
90
+ └── app.js
 
91
 
 
 
92
  feature-engineering/
93
+ β”œβ”€β”€ index.html
94
+ β”œβ”€β”€ style.css
95
+ └── app.js
96
+
97
+ ## βš™οΈ Deploying (GitHub Pages)
98
+
99
+ 1. Push the `main` branch to GitHub (already done for this repo).
100
+ 2. In the repository on GitHub -> Settings -> Pages, set the source to `main` branch and `/ (root)` or use `docs/` if you prefer.
101
+ 3. Wait a few minutes; the site will be available at `https://<username>.github.io/<repo>/` (e.g. the links at the top of this README).
102
+
103
+ Note: the sites use relative paths (`style.css`, `app.js`), so they work fine when served from a subpath such as `/DataScience/complete-statistics/`.
104
 
105
+ ## 🧹 Notes about cleanup
106
 
107
+ During repo cleanup I removed macOS Finder resource files (`._*`) and added a `.gitignore` entry to prevent them from being re-added. Example entries:
108
 
109
  ```
110
  ._*
111
  .DS_Store
112
+ __MACOSX/
113
  ```
114
 
115
+ If you see `.git.broken_<timestamp>` directories, they contain backups of previous `.git` metadata.
116
 
117
+ ## πŸ™‹ Next steps (I can help)
118
+
119
+ - Add screenshots/thumbnails to the README and to each project folder.
120
+ - Add an automated verification script that scans all `index.html` files and confirms local assets exist. I can create a small `scripts/verify_assets.py`.
121
+ - Split very long single-page projects into per-topic pages (if you want better maintainability).
122
+ - Add a small 'demo index' page that lists live links and embeds screenshots.
123
 
124
+ Tell me which of the above you'd like and I'll implement it.
125
 
126
+ ## Contributing
 
 
127
 
128
+ PRs, suggestions and fixes welcome. If you want me to add more documentation for a folder (detailed topic list, how-to-edit, or tests), say which folder and I'll add it.
129
 
130
  ## License
131
 
132
+ No license file is included. If you'd like one (MIT, Apache-2.0, CC BY, etc.), tell me and I will add it.
133
+
math-ds-complete/app.js CHANGED
@@ -55,7 +55,8 @@ function switchSubject(subject) {
55
  'statistics': 'Statistics Content',
56
  'linear-algebra': 'Linear Algebra Content',
57
  'calculus': 'Calculus Content',
58
- 'data-science': 'Data Science Content'
 
59
  };
60
  const sidebarTitle = document.getElementById('sidebarTitle');
61
  if (sidebarTitle) {
@@ -496,6 +497,265 @@ function initializeAllVisualizations() {
496
  initPCACanvas();
497
  initGradientDescentCanvas();
498
  initLossLandscapeCanvas();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  }
500
 
501
  // ===== LINEAR ALGEBRA VISUALIZATIONS =====
@@ -1676,6 +1936,6 @@ function initLossLandscapeCanvas() {
1676
  draw();
1677
  }
1678
 
1679
- console.log('%cπŸ“Š Mathematics Mastery Platform Loaded', 'color: #64ffda; font-size: 16px; font-weight: bold;');
1680
- console.log('%cReady to explore 85 comprehensive topics across 4 subjects!', 'color: #4a90e2; font-size: 14px;');
1681
- console.log('%cβœ“ Statistics (1-41) βœ“ Linear Algebra (42-57) βœ“ Calculus (58-69) βœ“ Data Science (70-85)', 'color: #51cf66; font-size: 12px;');
 
55
  'statistics': 'Statistics Content',
56
  'linear-algebra': 'Linear Algebra Content',
57
  'calculus': 'Calculus Content',
58
+ 'data-science': 'Data Science Content',
59
+ 'machine-learning': 'Machine Learning Algorithms'
60
  };
61
  const sidebarTitle = document.getElementById('sidebarTitle');
62
  if (sidebarTitle) {
 
497
  initPCACanvas();
498
  initGradientDescentCanvas();
499
  initLossLandscapeCanvas();
500
+
501
+ // Machine Learning visualizations
502
+ initMLLinearRegressionCanvas();
503
+ initMLKMeansCanvas();
504
+ }
505
+
506
+ // ===== MACHINE LEARNING VISUALIZATIONS =====
507
+
508
+ function initMLLinearRegressionCanvas() {
509
+ const canvas = document.getElementById('canvas-ml-1');
510
+ if (!canvas) return;
511
+
512
+ const ctx = canvas.getContext('2d');
513
+ let showLine = false;
514
+
515
+ // House price data from worked example
516
+ const data = [
517
+ {x: 1000, y: 150},
518
+ {x: 1500, y: 200},
519
+ {x: 2000, y: 250},
520
+ {x: 3000, y: 350}
521
+ ];
522
+
523
+ function draw() {
524
+ clearCanvas(ctx, canvas);
525
+
526
+ const padding = 80;
527
+ const width = canvas.width - 2 * padding;
528
+ const height = canvas.height - 2 * padding;
529
+
530
+ const maxX = 3500;
531
+ const maxY = 400;
532
+
533
+ // Draw axes
534
+ drawLine(ctx, padding, canvas.height - padding, canvas.width - padding, canvas.height - padding, COLORS.text, 2);
535
+ drawLine(ctx, padding, padding, padding, canvas.height - padding, COLORS.text, 2);
536
+
537
+ // Draw grid
538
+ for (let i = 0; i <= 7; i++) {
539
+ const x = padding + (i / 7) * width;
540
+ const xVal = (i * 500).toString();
541
+ drawLine(ctx, x, canvas.height - padding, x, canvas.height - padding + 5, COLORS.textSecondary, 1);
542
+ drawText(ctx, xVal, x, canvas.height - padding + 20, 10, COLORS.textSecondary);
543
+ }
544
+
545
+ for (let i = 0; i <= 8; i++) {
546
+ const y = canvas.height - padding - (i / 8) * height;
547
+ const yVal = (i * 50).toString();
548
+ drawLine(ctx, padding - 5, y, padding, y, COLORS.textSecondary, 1);
549
+ drawText(ctx, yVal, padding - 15, y + 4, 10, COLORS.textSecondary, 'right');
550
+ }
551
+
552
+ // Draw labels
553
+ drawText(ctx, 'Size (sq ft)', canvas.width / 2, canvas.height - 10, 12, COLORS.cyan);
554
+ ctx.save();
555
+ ctx.translate(20, canvas.height / 2);
556
+ ctx.rotate(-Math.PI / 2);
557
+ drawText(ctx, 'Price ($1000s)', 0, 0, 12, COLORS.cyan);
558
+ ctx.restore();
559
+
560
+ // Draw data points
561
+ data.forEach(point => {
562
+ const px = padding + (point.x / maxX) * width;
563
+ const py = canvas.height - padding - (point.y / maxY) * height;
564
+ drawCircle(ctx, px, py, 8, COLORS.cyan);
565
+ drawText(ctx, `${point.y}k`, px + 15, py - 10, 10, COLORS.cyan, 'left');
566
+ });
567
+
568
+ // Draw regression line if enabled
569
+ if (showLine) {
570
+ // From worked example: y = 50 + 0.1x
571
+ const slope = 0.1;
572
+ const intercept = 50;
573
+
574
+ const x1 = 0;
575
+ const y1 = intercept;
576
+ const x2 = maxX;
577
+ const y2 = intercept + slope * x2;
578
+
579
+ const px1 = padding + (x1 / maxX) * width;
580
+ const py1 = canvas.height - padding - (y1 / maxY) * height;
581
+ const px2 = padding + (x2 / maxX) * width;
582
+ const py2 = canvas.height - padding - (y2 / maxY) * height;
583
+
584
+ drawLine(ctx, px1, py1, px2, py2, COLORS.orange, 3);
585
+
586
+ // Show equation
587
+ drawText(ctx, 'y = 50 + 0.10x', canvas.width / 2, 30, 16, COLORS.orange);
588
+ drawText(ctx, 'RΒ² = 1.00 (Perfect Fit!)', canvas.width / 2, 50, 14, COLORS.green);
589
+
590
+ // Highlight prediction point (2500, 300)
591
+ const predX = 2500;
592
+ const predY = 50 + 0.1 * predX;
593
+ const ppx = padding + (predX / maxX) * width;
594
+ const ppy = canvas.height - padding - (predY / maxY) * height;
595
+ drawCircle(ctx, ppx, ppy, 10, COLORS.green);
596
+ drawText(ctx, '2500 sq ft β†’ $300k', ppx - 80, ppy - 15, 12, COLORS.green, 'left');
597
+ }
598
+ }
599
+
600
+ const fitBtn = document.getElementById('btn-ml-1-fit');
601
+ const resetBtn = document.getElementById('btn-ml-1-reset');
602
+
603
+ if (fitBtn) {
604
+ fitBtn.addEventListener('click', () => {
605
+ showLine = true;
606
+ draw();
607
+ });
608
+ }
609
+
610
+ if (resetBtn) {
611
+ resetBtn.addEventListener('click', () => {
612
+ showLine = false;
613
+ draw();
614
+ });
615
+ }
616
+
617
+ draw();
618
+ }
619
+
620
+ function initMLKMeansCanvas() {
621
+ const canvas = document.getElementById('canvas-ml-15');
622
+ if (!canvas) return;
623
+
624
+ const ctx = canvas.getContext('2d');
625
+ let clustered = false;
626
+
627
+ // Customer data from worked example
628
+ const customers = [
629
+ {name: 'A', age: 25, income: 40, cluster: null},
630
+ {name: 'B', age: 30, income: 50, cluster: null},
631
+ {name: 'C', age: 28, income: 45, cluster: null},
632
+ {name: 'D', age: 55, income: 80, cluster: null},
633
+ {name: 'E', age: 60, income: 90, cluster: null},
634
+ {name: 'F', age: 52, income: 75, cluster: null}
635
+ ];
636
+
637
+ let centroids = [
638
+ {age: 25, income: 40, color: COLORS.cyan},
639
+ {age: 60, income: 90, color: COLORS.orange}
640
+ ];
641
+
642
+ function assignClusters() {
643
+ customers.forEach(customer => {
644
+ // Calculate distance to each centroid
645
+ const d1 = Math.sqrt(Math.pow(customer.age - centroids[0].age, 2) + Math.pow(customer.income - centroids[0].income, 2));
646
+ const d2 = Math.sqrt(Math.pow(customer.age - centroids[1].age, 2) + Math.pow(customer.income - centroids[1].income, 2));
647
+
648
+ customer.cluster = d1 < d2 ? 0 : 1;
649
+ });
650
+
651
+ // Update centroids
652
+ const cluster0 = customers.filter(c => c.cluster === 0);
653
+ const cluster1 = customers.filter(c => c.cluster === 1);
654
+
655
+ if (cluster0.length > 0) {
656
+ centroids[0].age = cluster0.reduce((s, c) => s + c.age, 0) / cluster0.length;
657
+ centroids[0].income = cluster0.reduce((s, c) => s + c.income, 0) / cluster0.length;
658
+ }
659
+ if (cluster1.length > 0) {
660
+ centroids[1].age = cluster1.reduce((s, c) => s + c.age, 0) / cluster1.length;
661
+ centroids[1].income = cluster1.reduce((s, c) => s + c.income, 0) / cluster1.length;
662
+ }
663
+ }
664
+
665
+ function draw() {
666
+ clearCanvas(ctx, canvas);
667
+
668
+ const padding = 80;
669
+ const width = canvas.width - 2 * padding;
670
+ const height = canvas.height - 2 * padding;
671
+
672
+ const minAge = 20, maxAge = 70;
673
+ const minIncome = 30, maxIncome = 100;
674
+
675
+ // Draw axes
676
+ drawLine(ctx, padding, canvas.height - padding, canvas.width - padding, canvas.height - padding, COLORS.text, 2);
677
+ drawLine(ctx, padding, padding, padding, canvas.height - padding, COLORS.text, 2);
678
+
679
+ // Draw grid
680
+ for (let age = 20; age <= 70; age += 10) {
681
+ const x = padding + ((age - minAge) / (maxAge - minAge)) * width;
682
+ drawLine(ctx, x, canvas.height - padding, x, canvas.height - padding + 5, COLORS.textSecondary, 1);
683
+ drawText(ctx, age.toString(), x, canvas.height - padding + 20, 10, COLORS.textSecondary);
684
+ }
685
+
686
+ for (let income = 30; income <= 100; income += 10) {
687
+ const y = canvas.height - padding - ((income - minIncome) / (maxIncome - minIncome)) * height;
688
+ drawLine(ctx, padding - 5, y, padding, y, COLORS.textSecondary, 1);
689
+ drawText(ctx, `$${income}k`, padding - 40, y + 4, 10, COLORS.textSecondary, 'right');
690
+ }
691
+
692
+ // Draw labels
693
+ drawText(ctx, 'Age', canvas.width / 2, canvas.height - 10, 12, COLORS.cyan);
694
+ ctx.save();
695
+ ctx.translate(20, canvas.height / 2);
696
+ ctx.rotate(-Math.PI / 2);
697
+ drawText(ctx, 'Income ($k)', 0, 0, 12, COLORS.cyan);
698
+ ctx.restore();
699
+
700
+ // Draw customers
701
+ customers.forEach(customer => {
702
+ const px = padding + ((customer.age - minAge) / (maxAge - minAge)) * width;
703
+ const py = canvas.height - padding - ((customer.income - minIncome) / (maxIncome - minIncome)) * height;
704
+
705
+ const color = clustered ? (customer.cluster === 0 ? COLORS.cyan : COLORS.orange) : COLORS.primary;
706
+ drawCircle(ctx, px, py, 10, color);
707
+ drawText(ctx, customer.name, px, py - 15, 12, COLORS.text);
708
+ });
709
+
710
+ // Draw centroids if clustered
711
+ if (clustered) {
712
+ centroids.forEach((centroid, i) => {
713
+ const cx = padding + ((centroid.age - minAge) / (maxAge - minAge)) * width;
714
+ const cy = canvas.height - padding - ((centroid.income - minIncome) / (maxIncome - minIncome)) * height;
715
+
716
+ // Draw X marker for centroid
717
+ ctx.strokeStyle = centroid.color;
718
+ ctx.lineWidth = 4;
719
+ ctx.beginPath();
720
+ ctx.moveTo(cx - 12, cy - 12);
721
+ ctx.lineTo(cx + 12, cy + 12);
722
+ ctx.moveTo(cx + 12, cy - 12);
723
+ ctx.lineTo(cx - 12, cy + 12);
724
+ ctx.stroke();
725
+
726
+ drawText(ctx, `C${i+1} [${centroid.age.toFixed(1)}, ${centroid.income.toFixed(1)}]`,
727
+ cx + 20, cy, 11, centroid.color, 'left');
728
+ });
729
+
730
+ drawText(ctx, 'Cluster 1 (Young, Lower Income)', 150, 30, 12, COLORS.cyan);
731
+ drawText(ctx, 'Cluster 2 (Mature, Higher Income)', 150, 50, 12, COLORS.orange);
732
+ }
733
+ }
734
+
735
+ const clusterBtn = document.getElementById('btn-ml-15-cluster');
736
+ const resetBtn = document.getElementById('btn-ml-15-reset');
737
+
738
+ if (clusterBtn) {
739
+ clusterBtn.addEventListener('click', () => {
740
+ clustered = true;
741
+ assignClusters();
742
+ draw();
743
+ });
744
+ }
745
+
746
+ if (resetBtn) {
747
+ resetBtn.addEventListener('click', () => {
748
+ clustered = false;
749
+ customers.forEach(c => c.cluster = null);
750
+ centroids = [
751
+ {age: 25, income: 40, color: COLORS.cyan},
752
+ {age: 60, income: 90, color: COLORS.orange}
753
+ ];
754
+ draw();
755
+ });
756
+ }
757
+
758
+ draw();
759
  }
760
 
761
  // ===== LINEAR ALGEBRA VISUALIZATIONS =====
 
1936
  draw();
1937
  }
1938
 
1939
+ console.log('%cπŸ“Š Ultimate Learning Platform Loaded', 'color: #64ffda; font-size: 16px; font-weight: bold;');
1940
+ console.log('%cReady to explore 125+ comprehensive topics across 5 subjects!', 'color: #4a90e2; font-size: 14px;');
1941
+ console.log('%cβœ“ Statistics (41) βœ“ Linear Algebra (16) βœ“ Calculus (12) βœ“ Data Science (16) βœ“ Machine Learning (40+)', 'color: #51cf66; font-size: 12px;');
math-ds-complete/index.html CHANGED
The diff for this file is too large to render. See raw diff
 
math-ds-complete/style.css CHANGED
@@ -952,6 +952,35 @@ body {
952
  background: linear-gradient(135deg, #51cf66, #40c057);
953
  }
954
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
955
  .topic-section[data-subject="linear-algebra"] .topic-header h2 {
956
  color: #b47aea;
957
  }
@@ -964,6 +993,35 @@ body {
964
  color: #51cf66;
965
  }
966
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
967
  /* Topic Section */
968
  .topic-section {
969
  margin-bottom: 4rem;
 
952
  background: linear-gradient(135deg, #51cf66, #40c057);
953
  }
954
 
955
+ .topic-section[data-subject="machine-learning"] .topic-number {
956
+ background: linear-gradient(135deg, #ff6b9d, #c44569);
957
+ }
958
+
959
+ /* ML-specific topic number colors by category */
960
+ .topic-number.ml-regression {
961
+ background: linear-gradient(135deg, #4a90e2, #64ffda);
962
+ }
963
+
964
+ .topic-number.ml-classification {
965
+ background: linear-gradient(135deg, #ff6b9d, #ffa94d);
966
+ }
967
+
968
+ .topic-number.ml-clustering {
969
+ background: linear-gradient(135deg, #51cf66, #40c057);
970
+ }
971
+
972
+ .topic-number.ml-reduction {
973
+ background: linear-gradient(135deg, #b47aea, #e66af5);
974
+ }
975
+
976
+ .topic-number.ml-reinforcement {
977
+ background: linear-gradient(135deg, #c44569, #ff6b9d);
978
+ }
979
+
980
+ .topic-number.ml-advanced {
981
+ background: linear-gradient(135deg, #ffa94d, #f39c12);
982
+ }
983
+
984
  .topic-section[data-subject="linear-algebra"] .topic-header h2 {
985
  color: #b47aea;
986
  }
 
993
  color: #51cf66;
994
  }
995
 
996
+ .topic-section[data-subject="machine-learning"] .topic-header h2 {
997
+ color: #ff6b9d;
998
+ }
999
+
1000
+ /* ML section styling */
1001
+ .ml-section {
1002
+ border-left: 4px solid rgba(255, 107, 157, 0.3);
1003
+ padding-left: 20px;
1004
+ }
1005
+
1006
+ .ml-section .worked-example-section {
1007
+ border: 2px solid rgba(255, 107, 157, 0.2);
1008
+ }
1009
+
1010
+ .ml-section .code-block {
1011
+ background: rgba(0, 0, 0, 0.4);
1012
+ padding: 20px;
1013
+ border-radius: 8px;
1014
+ border-left: 4px solid #ff6b9d;
1015
+ font-family: 'Courier New', monospace;
1016
+ overflow-x: auto;
1017
+ }
1018
+
1019
+ .ml-section .code-block code {
1020
+ color: #64ffda;
1021
+ font-size: 14px;
1022
+ line-height: 1.8;
1023
+ }
1024
+
1025
  /* Topic Section */
1026
  .topic-section {
1027
  margin-bottom: 4rem;
ml_complete-all-topics/app.js CHANGED
The diff for this file is too large to render. See raw diff
 
ml_complete-all-topics/index.html CHANGED
The diff for this file is too large to render. See raw diff
 
ml_complete-all-topics/style.css CHANGED
@@ -738,1230 +738,892 @@ select.form-control {
738
  }
739
 
740
  /* END PERPLEXITY DESIGN SYSTEM */
741
- /* Reset and Base Styles */
742
- * {
743
- margin: 0;
744
- padding: 0;
745
- box-sizing: border-box;
746
- }
747
-
748
- html {
749
- scroll-behavior: smooth;
750
- }
751
-
752
- body {
753
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
754
- background-color: #1a1a2e;
755
- color: #e1e1e1;
756
- line-height: 1.6;
757
- overflow-x: hidden;
758
- }
759
-
760
- /* Subject Tabs */
761
- .subject-tabs {
762
- display: flex;
763
- gap: 1rem;
764
- margin-top: 1rem;
765
- }
766
-
767
- .subject-tab {
768
- padding: 0.6rem 1.5rem;
769
- background: rgba(74, 144, 226, 0.2);
770
- border: 2px solid transparent;
771
- border-radius: 8px;
772
- color: #a0a0a0;
773
- font-weight: 600;
774
- cursor: pointer;
775
- transition: all 0.3s ease;
776
- font-size: 0.9rem;
777
- }
778
-
779
- .subject-tab:hover {
780
- background: rgba(74, 144, 226, 0.3);
781
- color: #64ffda;
782
- }
783
-
784
- .subject-tab.active {
785
- background: linear-gradient(135deg, #4a90e2, #64ffda);
786
- color: #1a1a2e;
787
- border-color: #64ffda;
788
- box-shadow: 0 4px 15px rgba(100, 255, 218, 0.3);
789
- }
790
-
791
- /* Top Navigation */
792
- .top-nav {
793
- position: sticky;
794
- top: 0;
795
- background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
796
- padding: 1rem 0;
797
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
798
- z-index: 1000;
799
- border-bottom: 2px solid #4a90e2;
800
- }
801
-
802
- .nav-container {
803
- max-width: 1400px;
804
- margin: 0 auto;
805
- padding: 0 2rem;
806
- display: flex;
807
- flex-direction: column;
808
- gap: 1rem;
809
- }
810
-
811
- .course-title {
812
- font-size: 1.8rem;
813
- color: #64ffda;
814
- font-weight: 700;
815
- text-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
816
- }
817
-
818
- .mobile-menu-btn {
819
- display: none;
820
- flex-direction: column;
821
- background: none;
822
- border: none;
823
- cursor: pointer;
824
- padding: 0.5rem;
825
- }
826
-
827
- .mobile-menu-btn span {
828
- width: 25px;
829
- height: 3px;
830
- background: #64ffda;
831
- margin: 3px 0;
832
- border-radius: 3px;
833
- transition: all 0.3s ease;
834
- }
835
-
836
- /* Main Container */
837
- .main-container {
838
- display: flex;
839
- max-width: 1400px;
840
- margin: 0 auto;
841
- min-height: calc(100vh - 80px);
842
- }
843
-
844
- /* Sidebar */
845
- .sidebar {
846
- width: 280px;
847
- background: #16213e;
848
- padding: 2rem 1rem;
849
- position: sticky;
850
- top: 80px;
851
- height: calc(100vh - 80px);
852
- overflow-y: auto;
853
- border-right: 2px solid #0f3460;
854
- transition: transform 0.3s ease;
855
- }
856
-
857
- .sidebar-content h3 {
858
- color: #64ffda;
859
- margin-bottom: 1.5rem;
860
- font-size: 1.3rem;
861
- text-align: center;
862
- }
863
-
864
- .module {
865
- margin-bottom: 2rem;
866
- }
867
-
868
- .module-title {
869
- color: #4a90e2;
870
- font-size: 0.9rem;
871
- text-transform: uppercase;
872
- letter-spacing: 1px;
873
- margin-bottom: 0.8rem;
874
- padding: 0.5rem;
875
- background: rgba(74, 144, 226, 0.1);
876
- border-radius: 5px;
877
- border-left: 3px solid #4a90e2;
878
- }
879
-
880
- .topic-list {
881
- list-style: none;
882
- }
883
-
884
- .topic-list li {
885
- margin-bottom: 0.5rem;
886
- }
887
-
888
- .topic-link {
889
- display: block;
890
- padding: 0.6rem 0.8rem;
891
- color: #a0a0a0;
892
- text-decoration: none;
893
- border-radius: 5px;
894
- transition: all 0.3s ease;
895
- font-size: 0.9rem;
896
- border-left: 3px solid transparent;
897
- }
898
-
899
- .topic-link:hover {
900
- background: rgba(100, 255, 218, 0.1);
901
- color: #64ffda;
902
- border-left-color: #64ffda;
903
- transform: translateX(5px);
904
- }
905
-
906
- .topic-link.active {
907
- background: rgba(100, 255, 218, 0.15);
908
- color: #64ffda;
909
- border-left-color: #64ffda;
910
- font-weight: 600;
911
- }
912
-
913
- /* Scrollbar Styling */
914
- .sidebar::-webkit-scrollbar {
915
- width: 8px;
916
- }
917
 
918
- .sidebar::-webkit-scrollbar-track {
919
- background: #0f3460;
920
- }
 
 
 
 
 
 
921
 
922
- .sidebar::-webkit-scrollbar-thumb {
923
- background: #4a90e2;
924
- border-radius: 4px;
925
- }
 
 
 
 
 
926
 
927
- .sidebar::-webkit-scrollbar-thumb:hover {
928
- background: #64ffda;
929
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
930
 
931
- /* Main Content */
932
- .content {
933
- flex: 1;
934
- padding: 3rem;
935
- background: #1a1a2e;
936
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
937
 
938
- /* Subject-specific styling */
939
- .topic-section[data-subject="statistics"] .topic-number {
940
- background: linear-gradient(135deg, #4a90e2, #64ffda);
941
- }
 
 
 
 
 
 
 
 
 
942
 
943
- .topic-section[data-subject="linear-algebra"] .topic-number {
944
- background: linear-gradient(135deg, #b47aea, #e66af5);
945
- }
 
 
 
946
 
947
- .topic-section[data-subject="calculus"] .topic-number {
948
- background: linear-gradient(135deg, #ff6b6b, #ffa94d);
949
- }
 
 
 
950
 
951
- .topic-section[data-subject="data-science"] .topic-number {
952
- background: linear-gradient(135deg, #51cf66, #40c057);
 
 
953
  }
954
 
955
- .topic-section[data-subject="machine-learning"] .topic-number {
956
- background: linear-gradient(135deg, #ff6b9d, #c44569);
957
- }
 
 
 
958
 
959
- /* ML-specific topic number colors by category */
960
- .topic-number.ml-regression {
961
- background: linear-gradient(135deg, #4a90e2, #64ffda);
962
- }
 
 
 
 
963
 
964
- .topic-number.ml-classification {
965
- background: linear-gradient(135deg, #ff6b9d, #ffa94d);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
966
  }
967
 
968
- .topic-number.ml-clustering {
969
- background: linear-gradient(135deg, #51cf66, #40c057);
 
970
  }
971
 
972
- .topic-number.ml-reduction {
973
- background: linear-gradient(135deg, #b47aea, #e66af5);
 
 
974
  }
975
 
976
- .topic-number.ml-reinforcement {
977
- background: linear-gradient(135deg, #c44569, #ff6b9d);
 
 
 
 
 
 
978
  }
979
 
980
- .topic-number.ml-advanced {
981
- background: linear-gradient(135deg, #ffa94d, #f39c12);
 
 
982
  }
983
 
984
- .topic-section[data-subject="linear-algebra"] .topic-header h2 {
985
- color: #b47aea;
 
 
 
 
 
 
986
  }
987
 
988
- .topic-section[data-subject="calculus"] .topic-header h2 {
989
- color: #ff6b6b;
 
990
  }
991
 
992
- .topic-section[data-subject="data-science"] .topic-header h2 {
993
- color: #51cf66;
 
 
 
994
  }
995
 
996
- .topic-section[data-subject="machine-learning"] .topic-header h2 {
997
- color: #ff6b9d;
 
998
  }
999
 
1000
- /* ML section styling */
1001
- .ml-section {
1002
- border-left: 4px solid rgba(255, 107, 157, 0.3);
1003
- padding-left: 20px;
1004
  }
1005
 
1006
- .ml-section .worked-example-section {
1007
- border: 2px solid rgba(255, 107, 157, 0.2);
 
 
 
 
 
 
 
1008
  }
1009
 
1010
- .ml-section .code-block {
1011
- background: rgba(0, 0, 0, 0.4);
1012
- padding: 20px;
1013
- border-radius: 8px;
1014
- border-left: 4px solid #ff6b9d;
1015
- font-family: 'Courier New', monospace;
1016
- overflow-x: auto;
1017
  }
1018
 
1019
- .ml-section .code-block code {
1020
- color: #64ffda;
1021
- font-size: 14px;
1022
- line-height: 1.8;
1023
  }
1024
 
1025
- /* Topic Section */
1026
- .topic-section {
1027
- margin-bottom: 4rem;
1028
- opacity: 0;
1029
- transform: translateY(20px);
1030
- animation: fadeInUp 0.6s ease forwards;
1031
  }
1032
 
1033
- @keyframes fadeInUp {
1034
- to {
1035
- opacity: 1;
1036
- transform: translateY(0);
1037
- }
 
 
 
 
1038
  }
1039
 
1040
- .topic-header {
1041
- margin-bottom: 2rem;
1042
- padding-bottom: 1.5rem;
1043
- border-bottom: 3px solid #0f3460;
1044
  }
1045
 
1046
- .topic-number {
1047
- display: inline-block;
1048
- background: linear-gradient(135deg, #4a90e2, #64ffda);
1049
- color: #1a1a2e;
1050
- padding: 0.3rem 1rem;
1051
- border-radius: 20px;
1052
- font-size: 0.85rem;
1053
- font-weight: 700;
1054
- margin-bottom: 0.8rem;
1055
  }
1056
 
1057
- .topic-header h2 {
1058
- font-size: 2.5rem;
1059
- color: #64ffda;
1060
- margin-bottom: 0.5rem;
1061
- text-shadow: 0 0 20px rgba(100, 255, 218, 0.2);
1062
  }
1063
 
1064
- .topic-subtitle {
1065
- color: #a0a0a0;
1066
- font-size: 1.1rem;
1067
- font-style: italic;
1068
  }
1069
 
1070
- /* Content Cards */
1071
- .content-card {
1072
- background: #16213e;
1073
- padding: 2rem;
1074
- border-radius: 12px;
1075
- margin-bottom: 2rem;
1076
- border: 1px solid #0f3460;
1077
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
1078
- transition: transform 0.3s ease, box-shadow 0.3s ease;
1079
  }
1080
 
1081
- .content-card:hover {
1082
- transform: translateY(-2px);
1083
- box-shadow: 0 6px 25px rgba(74, 144, 226, 0.2);
1084
  }
1085
 
1086
- .content-card h3 {
1087
- color: #4a90e2;
1088
- margin-bottom: 1rem;
1089
- font-size: 1.5rem;
1090
  }
1091
 
1092
- .content-card h4 {
1093
- margin-top: 1rem;
1094
- margin-bottom: 0.8rem;
1095
- font-size: 1.2rem;
1096
  }
1097
 
1098
- .content-card p {
1099
- margin-bottom: 1rem;
1100
- color: #d0d0d0;
1101
- line-height: 1.8;
 
 
1102
  }
1103
 
1104
- .content-card ul,
1105
- .content-card ol {
1106
- margin-left: 2rem;
1107
- margin-bottom: 1rem;
1108
  }
1109
 
1110
- .content-card li {
1111
- margin-bottom: 0.5rem;
1112
- color: #d0d0d0;
1113
  }
1114
 
1115
- /* Callout Boxes */
1116
- .callout-box {
1117
- padding: 1.5rem;
1118
- border-radius: 10px;
1119
- margin-bottom: 2rem;
1120
- border-left: 4px solid;
1121
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
1122
  }
1123
 
1124
- .callout-header {
1125
- font-weight: 700;
1126
- font-size: 1rem;
1127
- margin-bottom: 0.8rem;
1128
- display: flex;
1129
- align-items: center;
1130
- gap: 0.5rem;
1131
  }
1132
 
1133
- .callout-box.insight {
1134
- background: rgba(100, 255, 218, 0.1);
1135
- border-left-color: #64ffda;
1136
  }
1137
 
1138
- .callout-box.insight .callout-header {
1139
- color: #64ffda;
 
 
 
 
 
1140
  }
1141
 
1142
- .callout-box.warning {
1143
- background: rgba(255, 107, 107, 0.1);
1144
- border-left-color: #ff6b6b;
 
1145
  }
1146
 
1147
- .callout-box.warning .callout-header {
1148
- color: #ff6b6b;
 
1149
  }
1150
 
1151
- .callout-box.tip {
1152
- background: rgba(81, 207, 102, 0.1);
1153
- border-left-color: #51cf66;
1154
  }
1155
 
1156
- .callout-box.tip .callout-header {
1157
- color: #51cf66;
 
 
 
1158
  }
1159
 
1160
- .callout-box.example {
1161
- background: rgba(74, 144, 226, 0.1);
1162
- border-left-color: #4a90e2;
1163
  }
1164
 
1165
- .callout-box.example .callout-header {
1166
- color: #4a90e2;
1167
  }
1168
 
1169
- .callout-box p,
1170
- .callout-box ul,
1171
- .callout-box ol {
1172
- color: #d0d0d0;
 
1173
  }
1174
 
1175
- /* Formula Cards */
1176
- .formula-card {
1177
- background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
1178
- padding: 2rem;
1179
- border-radius: 12px;
1180
- margin-bottom: 1.5rem;
1181
- border: 2px solid #4a90e2;
1182
- box-shadow: 0 4px 20px rgba(74, 144, 226, 0.2);
1183
  }
1184
 
1185
- .formula-header {
1186
- color: #64ffda;
1187
- font-size: 1.2rem;
1188
- font-weight: 700;
1189
- margin-bottom: 1rem;
1190
- text-align: center;
1191
- text-transform: uppercase;
1192
- letter-spacing: 1px;
1193
  }
1194
 
1195
- .formula-main {
1196
- font-size: 1.8rem;
1197
- text-align: center;
1198
- margin: 1.5rem 0;
1199
- color: #fff;
1200
- font-family: 'Courier New', monospace;
1201
  }
1202
 
1203
- .formula-symbol {
1204
- color: #64ffda;
1205
- font-weight: 700;
1206
- font-size: 2rem;
 
1207
  }
1208
 
1209
- .formula-var {
1210
- color: #64ffda;
1211
- font-weight: 600;
 
 
1212
  }
1213
 
1214
- .formula-fraction {
1215
- display: inline-flex;
1216
- flex-direction: column;
1217
- align-items: center;
1218
- margin: 0 0.5rem;
1219
- vertical-align: middle;
1220
  }
1221
 
1222
- .formula-numerator,
1223
- .formula-denominator {
1224
- padding: 0.2rem 0.5rem;
1225
  }
1226
 
1227
- .formula-line {
1228
- width: 100%;
1229
- height: 2px;
1230
- background: #fff;
1231
- margin: 0.2rem 0;
1232
  }
1233
 
1234
- .formula-steps {
1235
- margin-top: 1rem;
1236
- padding-top: 1rem;
1237
- border-top: 1px solid rgba(255, 255, 255, 0.1);
1238
  }
1239
 
1240
- .formula-steps p {
1241
- color: #a0a0a0;
1242
- margin-bottom: 0.5rem;
1243
  }
1244
 
1245
- .formula-steps ol,
1246
- .formula-steps ul {
1247
- margin-left: 2rem;
1248
- color: #d0d0d0;
1249
  }
1250
 
1251
- .formula-steps li {
1252
- margin-bottom: 0.5rem;
 
 
 
1253
  }
1254
 
1255
- /* Interactive Container */
1256
- .interactive-container {
1257
- background: #16213e;
1258
- padding: 2rem;
1259
- border-radius: 12px;
1260
- margin-bottom: 2rem;
1261
- border: 2px solid #4a90e2;
1262
- box-shadow: 0 4px 20px rgba(74, 144, 226, 0.3);
1263
  }
1264
 
1265
- .interactive-container h3 {
1266
- color: #64ffda;
1267
- margin-bottom: 1.5rem;
1268
- text-align: center;
1269
- font-size: 1.5rem;
1270
  }
1271
 
1272
- .interactive-container canvas {
1273
- display: block;
1274
- max-width: 100%;
1275
- height: auto;
1276
- margin: 0 auto 1.5rem;
1277
- background: #0f3460;
1278
- border-radius: 8px;
1279
- border: 1px solid #4a90e2;
1280
  }
1281
 
1282
  /* Controls */
1283
  .controls {
1284
- display: flex;
1285
- flex-direction: column;
1286
- gap: 1rem;
1287
- align-items: center;
1288
- }
1289
-
1290
- .input-group {
1291
- display: flex;
1292
- flex-direction: column;
1293
- gap: 0.8rem;
1294
- width: 100%;
1295
- max-width: 600px;
1296
- }
1297
-
1298
- .input-group label {
1299
- color: #64ffda;
1300
- font-weight: 600;
1301
  }
1302
 
1303
- .form-control {
1304
- padding: 0.8rem;
1305
- background: #0f3460;
1306
- border: 2px solid #4a90e2;
1307
- border-radius: 8px;
1308
- color: #e1e1e1;
1309
- font-size: 1rem;
1310
- transition: all 0.3s ease;
1311
  }
1312
 
1313
- .form-control:focus {
1314
- outline: none;
1315
- border-color: #64ffda;
1316
- box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
1317
  }
1318
 
1319
- .slider-group {
1320
- display: flex;
1321
- flex-direction: column;
1322
- gap: 0.5rem;
1323
- width: 100%;
 
 
1324
  }
1325
 
1326
- .slider-group label {
1327
- color: #64ffda;
1328
- font-weight: 600;
 
 
 
 
 
1329
  }
1330
 
1331
- .slider {
1332
- width: 100%;
1333
- height: 8px;
1334
- border-radius: 5px;
1335
- background: #0f3460;
1336
- outline: none;
1337
- -webkit-appearance: none;
1338
  }
1339
 
1340
- .slider::-webkit-slider-thumb {
1341
- -webkit-appearance: none;
1342
- appearance: none;
1343
- width: 20px;
1344
- height: 20px;
1345
- border-radius: 50%;
1346
- background: #64ffda;
1347
- cursor: pointer;
1348
- box-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
1349
- transition: all 0.3s ease;
1350
  }
1351
 
1352
- .slider::-webkit-slider-thumb:hover {
1353
- background: #4a90e2;
1354
- transform: scale(1.2);
 
 
 
1355
  }
1356
 
1357
- .slider::-moz-range-thumb {
1358
- width: 20px;
1359
- height: 20px;
1360
- border-radius: 50%;
1361
- background: #64ffda;
1362
- cursor: pointer;
1363
- border: none;
1364
- box-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
1365
  }
1366
 
1367
  /* Buttons */
1368
  .btn {
1369
- padding: 0.8rem 2rem;
1370
- border: none;
1371
- border-radius: 8px;
1372
- font-size: 1rem;
1373
- font-weight: 600;
1374
- cursor: pointer;
1375
- transition: all 0.3s ease;
1376
- text-transform: uppercase;
1377
- letter-spacing: 1px;
1378
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
1379
- }
1380
-
1381
- .btn-primary {
1382
- background: linear-gradient(135deg, #4a90e2, #64ffda);
1383
- color: #1a1a2e;
1384
- }
1385
-
1386
- .btn-primary:hover {
1387
- transform: translateY(-2px);
1388
- box-shadow: 0 6px 20px rgba(100, 255, 218, 0.4);
1389
- }
1390
-
1391
- .btn-secondary {
1392
- background: #0f3460;
1393
- color: #64ffda;
1394
- border: 2px solid #4a90e2;
1395
- }
1396
-
1397
- .btn-secondary:hover {
1398
- background: #16213e;
1399
- transform: translateY(-2px);
1400
- }
1401
-
1402
- /* Results Display */
1403
- .results {
1404
- display: grid;
1405
- grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
1406
- gap: 1rem;
1407
- width: 100%;
1408
- margin-top: 1rem;
1409
- }
1410
-
1411
- .result-item {
1412
- background: #0f3460;
1413
- padding: 1rem;
1414
- border-radius: 8px;
1415
- text-align: center;
1416
- border: 2px solid #4a90e2;
1417
- }
1418
-
1419
- .result-label {
1420
- display: block;
1421
- color: #64ffda;
1422
- font-weight: 600;
1423
- margin-bottom: 0.5rem;
1424
- font-size: 0.9rem;
1425
- }
1426
-
1427
- .result-item span:last-child {
1428
- display: block;
1429
- color: #fff;
1430
- font-size: 1.5rem;
1431
- font-weight: 700;
1432
- }
1433
-
1434
- /* Tables */
1435
- .comparison-table {
1436
- width: 100%;
1437
- border-collapse: collapse;
1438
- margin: 1rem 0;
1439
- background: #0f3460;
1440
- border-radius: 8px;
1441
- overflow: hidden;
1442
- }
1443
-
1444
- .comparison-table thead {
1445
- background: linear-gradient(135deg, #4a90e2, #64ffda);
1446
- color: #1a1a2e;
1447
- }
1448
-
1449
- .comparison-table th,
1450
- .comparison-table td {
1451
- padding: 1rem;
1452
- text-align: left;
1453
- border-bottom: 1px solid #16213e;
1454
- }
1455
-
1456
- .comparison-table th {
1457
- font-weight: 700;
1458
- text-transform: uppercase;
1459
- font-size: 0.9rem;
1460
- letter-spacing: 1px;
1461
- }
1462
-
1463
- .comparison-table tbody tr {
1464
- transition: background 0.3s ease;
1465
- }
1466
-
1467
- .comparison-table tbody tr:hover {
1468
- background: rgba(74, 144, 226, 0.1);
1469
- }
1470
-
1471
- .comparison-table td {
1472
- color: #d0d0d0;
1473
- }
1474
-
1475
- /* Two Column Layout */
1476
- .two-column {
1477
- display: grid;
1478
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
1479
- gap: 2rem;
1480
- margin: 1.5rem 0;
1481
- }
1482
-
1483
- .column {
1484
- background: #0f3460;
1485
- padding: 1.5rem;
1486
- border-radius: 8px;
1487
- border: 2px solid rgba(74, 144, 226, 0.3);
1488
- }
1489
-
1490
- /* Comparison Grid */
1491
- .comparison-grid {
1492
- display: grid;
1493
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
1494
- gap: 1.5rem;
1495
- margin: 1.5rem 0;
1496
- }
1497
-
1498
- .comparison-item {
1499
- background: #0f3460;
1500
- padding: 1.5rem;
1501
- border-radius: 8px;
1502
- border-left: 4px solid #4a90e2;
1503
- }
1504
-
1505
- /* Data Tree */
1506
- .data-tree {
1507
- display: flex;
1508
- flex-direction: column;
1509
- align-items: center;
1510
- gap: 2rem;
1511
- padding: 2rem;
1512
- margin: 1.5rem 0;
1513
- }
1514
-
1515
- .tree-level-1,
1516
- .tree-level-2,
1517
- .tree-level-3 {
1518
- display: flex;
1519
- gap: 2rem;
1520
- justify-content: center;
1521
- flex-wrap: wrap;
1522
- }
1523
-
1524
- .tree-node {
1525
- padding: 1rem 2rem;
1526
- background: #0f3460;
1527
- border: 2px solid #4a90e2;
1528
- border-radius: 8px;
1529
- color: #64ffda;
1530
- font-weight: 600;
1531
- position: relative;
1532
- transition: all 0.3s ease;
1533
  }
1534
 
1535
- .tree-node:hover {
1536
- transform: scale(1.05);
1537
- box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
1538
  }
1539
 
1540
- .tree-node.main {
1541
- font-size: 1.3rem;
1542
- background: linear-gradient(135deg, #4a90e2, #64ffda);
1543
- color: #1a1a2e;
1544
  }
1545
 
1546
- .tree-node.categorical {
1547
- border-color: #64ffda;
 
1548
  }
1549
 
1550
- .tree-node.numerical {
1551
- border-color: #ff6b6b;
1552
  }
1553
 
1554
- /* Use Case List */
1555
- .use-case-list {
1556
- list-style: none;
1557
- margin-left: 0;
 
 
 
1558
  }
1559
 
1560
- .use-case-list li {
1561
- padding: 1rem;
1562
- margin-bottom: 1rem;
1563
- background: #0f3460;
1564
- border-radius: 8px;
1565
- border-left: 4px solid #4a90e2;
1566
- transition: all 0.3s ease;
1567
  }
1568
 
1569
- .use-case-list li:hover {
1570
- transform: translateX(5px);
1571
- border-left-color: #64ffda;
 
1572
  }
1573
 
1574
- /* Example Solution */
1575
- .example-solution {
1576
- background: #0f3460;
1577
- padding: 1.5rem;
1578
- border-radius: 8px;
1579
- margin-top: 1rem;
1580
- font-family: 'Courier New', monospace;
1581
  }
1582
 
1583
- .example-solution p {
1584
- margin-bottom: 0.8rem;
1585
- color: #d0d0d0;
 
 
 
1586
  }
1587
 
1588
- .example-solution strong {
1589
- color: #64ffda;
 
 
1590
  }
1591
 
1592
- /* Summary Card */
1593
- .summary-card {
1594
- background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
1595
- padding: 2rem;
1596
- border-radius: 12px;
1597
- border: 2px solid #64ffda;
1598
- box-shadow: 0 4px 20px rgba(100, 255, 218, 0.3);
1599
- margin-bottom: 2rem;
1600
  }
1601
 
1602
- .summary-card h3 {
1603
- color: #64ffda;
1604
- margin-bottom: 1rem;
1605
- font-size: 1.5rem;
1606
- text-align: center;
1607
  }
1608
 
1609
- .summary-card ul {
1610
- list-style: none;
1611
- margin-left: 0;
1612
  }
1613
 
1614
- .summary-card li {
1615
- padding: 0.8rem;
1616
- margin-bottom: 0.8rem;
1617
- background: rgba(100, 255, 218, 0.05);
1618
- border-radius: 6px;
1619
- border-left: 3px solid #64ffda;
1620
- color: #d0d0d0;
 
1621
  }
1622
 
1623
- .summary-card li::before {
1624
- content: "βœ“";
1625
- color: #64ffda;
1626
- font-weight: 700;
1627
- margin-right: 0.8rem;
 
1628
  }
1629
 
1630
- /* Data Examples Table */
1631
- .data-examples-table {
1632
- width: 100%;
1633
- border-collapse: collapse;
1634
- margin-top: 1rem;
 
 
1635
  }
1636
 
1637
- .data-examples-table th,
1638
- .data-examples-table td {
1639
- padding: 1rem;
1640
- text-align: left;
1641
- border-bottom: 1px solid rgba(74, 144, 226, 0.2);
1642
  }
1643
 
1644
- .data-examples-table th {
1645
- background: rgba(74, 144, 226, 0.2);
1646
- color: #64ffda;
1647
- font-weight: 600;
1648
  }
1649
 
1650
- /* Responsive Design */
1651
- @media (max-width: 1024px) {
1652
- .subject-tabs {
1653
- flex-wrap: wrap;
1654
- gap: 0.5rem;
1655
- }
1656
-
1657
- .subject-tab {
1658
- font-size: 0.8rem;
1659
- padding: 0.5rem 1rem;
1660
- }
1661
- .main-container {
1662
- flex-direction: column;
1663
- }
1664
-
1665
- .sidebar {
1666
- width: 100%;
1667
- height: auto;
1668
- position: static;
1669
- transform: translateX(-100%);
1670
- }
1671
-
1672
- .sidebar.active {
1673
- transform: translateX(0);
1674
- }
1675
-
1676
- .mobile-menu-btn {
1677
- display: flex;
1678
- }
1679
-
1680
- .content {
1681
- padding: 2rem 1.5rem;
1682
- }
1683
-
1684
- .topic-header h2 {
1685
- font-size: 2rem;
1686
- }
1687
-
1688
- .two-column {
1689
- grid-template-columns: 1fr;
1690
- }
1691
  }
1692
 
1693
- @media (max-width: 768px) {
1694
- .course-title {
1695
- font-size: 1.3rem;
1696
- }
1697
-
1698
- .content {
1699
- padding: 1.5rem 1rem;
1700
- }
1701
-
1702
- .topic-header h2 {
1703
- font-size: 1.6rem;
1704
- }
1705
-
1706
- .formula-main {
1707
- font-size: 1.3rem;
1708
- }
1709
-
1710
- .comparison-grid {
1711
- grid-template-columns: 1fr;
1712
- }
1713
-
1714
- .results {
1715
- grid-template-columns: 1fr;
1716
- }
1717
-
1718
- .interactive-container canvas {
1719
- max-width: 100%;
1720
- height: auto;
1721
- }
1722
  }
1723
 
1724
- /* Worked Example Section Styles */
1725
- .worked-example-section {
1726
- background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
1727
- border-radius: 12px;
1728
- padding: 30px;
1729
- margin: 40px 0;
1730
- border-left: 5px solid #64ffda;
1731
- box-shadow: 0 8px 16px rgba(0,0,0,0.3);
1732
  }
1733
 
1734
- .example-problem {
1735
- background: rgba(255,255,255,0.08);
1736
- padding: 25px;
1737
- border-radius: 10px;
1738
- margin-bottom: 30px;
1739
- border: 2px solid #64ffda;
1740
  }
1741
 
1742
- .problem-statement {
1743
- font-size: 19px;
1744
- font-weight: 600;
1745
- color: #64ffda;
1746
- line-height: 1.6;
1747
  }
1748
 
1749
- .solution-step {
1750
- display: flex;
1751
- gap: 20px;
1752
- margin: 25px 0;
1753
- padding: 25px;
1754
- background: rgba(0,0,0,0.3);
1755
- border-radius: 10px;
1756
- border-left: 4px solid #4a90e2;
1757
- transition: all 0.3s ease;
1758
  }
1759
 
1760
- .solution-step:hover {
1761
- background: rgba(0,0,0,0.4);
1762
- border-left-width: 6px;
1763
- transform: translateX(5px);
1764
  }
1765
 
1766
- .step-number {
1767
- font-weight: 700;
1768
- color: #64ffda;
1769
- font-size: 20px;
1770
- min-width: 90px;
1771
- flex-shrink: 0;
1772
  }
1773
 
1774
- .step-content {
1775
- flex: 1;
 
 
 
 
1776
  }
1777
 
1778
- .step-description {
1779
- font-size: 16px;
1780
- font-weight: 600;
1781
- color: #fff;
1782
- margin-bottom: 12px;
 
 
 
 
1783
  }
1784
 
1785
- .step-work {
1786
- background: rgba(0,0,0,0.4);
1787
- padding: 18px;
1788
- border-radius: 8px;
1789
- margin: 12px 0;
1790
- font-family: 'Courier New', monospace;
1791
- border-left: 3px solid #ff6b6b;
1792
- overflow-x: auto;
1793
  }
1794
 
1795
- .step-work code {
1796
- display: block;
1797
- color: #e1e1e1;
1798
- font-size: 14px;
1799
- line-height: 1.8;
1800
- margin: 4px 0;
1801
  }
1802
 
1803
- .step-explanation {
1804
- font-style: italic;
1805
- color: #a0a0a0;
1806
- font-size: 14px;
1807
- margin-top: 10px;
 
1808
  }
1809
 
1810
- .calculation-table {
1811
- width: 100%;
1812
- border-collapse: collapse;
1813
- margin: 15px 0;
1814
- background: rgba(0,0,0,0.2);
1815
- border-radius: 8px;
1816
- overflow: hidden;
1817
  }
1818
 
1819
- .calculation-table th,
1820
- .calculation-table td {
1821
- padding: 12px;
1822
- border: 1px solid rgba(255,255,255,0.1);
1823
- text-align: center;
1824
  }
1825
 
1826
- .calculation-table th {
1827
- background: #4a90e2;
1828
- font-weight: 600;
1829
- color: #fff;
 
1830
  }
1831
 
1832
- .calculation-table tbody tr:hover {
1833
- background: rgba(100, 255, 218, 0.1);
 
 
 
1834
  }
1835
 
1836
- .final-answer {
1837
- background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
1838
- padding: 25px;
1839
- border-radius: 10px;
1840
- margin-top: 30px;
1841
- text-align: center;
1842
- font-size: 18px;
1843
- box-shadow: 0 4px 12px rgba(81,207,102,0.3);
1844
  }
1845
 
1846
- .answer-highlight {
1847
- font-weight: 700;
1848
- font-size: 24px;
1849
- color: white;
1850
- display: block;
1851
- margin-top: 12px;
1852
- text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
1853
  }
1854
 
1855
- .verification {
1856
- background: rgba(100, 255, 218, 0.1);
1857
- padding: 20px;
1858
- border-radius: 8px;
1859
- border-left: 4px solid #51cf66;
1860
- margin-top: 20px;
1861
  }
1862
 
1863
- .verification strong {
1864
- color: #51cf66;
1865
- font-size: 16px;
 
 
 
 
 
 
1866
  }
1867
 
1868
- .verification p {
1869
- color: #d0d0d0;
1870
- margin-top: 10px;
1871
- line-height: 1.6;
 
1872
  }
1873
 
1874
- .practice-problems {
1875
- background: rgba(74, 144, 226, 0.1);
1876
- padding: 25px;
1877
- border-radius: 10px;
1878
- margin-top: 30px;
1879
- border: 2px solid #4a90e2;
1880
  }
1881
 
1882
- .practice-problems h4 {
1883
- color: #64ffda;
1884
- margin-bottom: 15px;
1885
- font-size: 18px;
1886
  }
1887
 
1888
- .practice-problems ol {
1889
- margin: 15px 0 15px 25px;
1890
- color: #d0d0d0;
 
 
 
 
 
1891
  }
1892
 
1893
- .practice-problems li {
1894
- margin-bottom: 10px;
1895
- line-height: 1.6;
 
 
 
 
 
 
 
1896
  }
1897
 
1898
- .show-answers-btn {
1899
- background: #4a90e2;
1900
- color: white;
1901
- border: none;
1902
- padding: 10px 20px;
1903
- border-radius: 6px;
1904
- cursor: pointer;
1905
- font-weight: 600;
1906
- margin: 10px 0;
1907
- transition: all 0.3s ease;
1908
  }
1909
 
1910
- .show-answers-btn:hover {
1911
- background: #64ffda;
1912
- color: #1a1a2e;
1913
- transform: translateY(-2px);
1914
  }
1915
 
1916
- .practice-answers {
1917
- background: rgba(0,0,0,0.3);
1918
- padding: 20px;
1919
- border-radius: 8px;
1920
- margin-top: 15px;
1921
- border-left: 4px solid #51cf66;
1922
  }
1923
 
1924
- .practice-answers p strong {
1925
- color: #51cf66;
 
1926
  }
1927
 
1928
- .practice-answers ol {
1929
- margin-left: 25px;
1930
- color: #e1e1e1;
 
1931
  }
1932
 
1933
- /* Animations */
1934
- @keyframes pulse {
1935
- 0%, 100% {
1936
- opacity: 1;
1937
- }
1938
- 50% {
1939
- opacity: 0.5;
1940
- }
1941
  }
1942
 
1943
- .pulse {
1944
- animation: pulse 2s ease-in-out infinite;
 
 
1945
  }
1946
 
1947
- /* Loading State */
1948
- .loading {
1949
- display: inline-block;
1950
- width: 20px;
1951
- height: 20px;
1952
- border: 3px solid rgba(100, 255, 218, 0.3);
1953
- border-radius: 50%;
1954
- border-top-color: #64ffda;
1955
- animation: spin 1s ease-in-out infinite;
1956
  }
1957
 
1958
- @keyframes spin {
1959
- to {
1960
- transform: rotate(360deg);
1961
- }
 
 
 
 
1962
  }
1963
 
1964
- /* Smooth Transitions */
1965
- * {
1966
- transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
 
 
 
 
 
 
 
 
 
 
 
 
 
1967
  }
 
738
  }
739
 
740
  /* END PERPLEXITY DESIGN SYSTEM */
741
+ :root {
742
+ /* Primitive Color Tokens */
743
+ --color-white: rgba(255, 255, 255, 1);
744
+ --color-black: rgba(0, 0, 0, 1);
745
+ --color-cream-50: rgba(252, 252, 249, 1);
746
+ --color-cream-100: rgba(255, 255, 253, 1);
747
+ --color-gray-200: rgba(245, 245, 245, 1);
748
+ --color-gray-300: rgba(167, 169, 169, 1);
749
+ --color-gray-400: rgba(119, 124, 124, 1);
750
+ --color-slate-500: rgba(98, 108, 113, 1);
751
+ --color-brown-600: rgba(94, 82, 64, 1);
752
+ --color-charcoal-700: rgba(31, 33, 33, 1);
753
+ --color-charcoal-800: rgba(38, 40, 40, 1);
754
+ --color-slate-900: rgba(19, 52, 59, 1);
755
+ --color-teal-300: rgba(50, 184, 198, 1);
756
+ --color-teal-400: rgba(45, 166, 178, 1);
757
+ --color-teal-500: rgba(33, 128, 141, 1);
758
+ --color-teal-600: rgba(29, 116, 128, 1);
759
+ --color-teal-700: rgba(26, 104, 115, 1);
760
+ --color-teal-800: rgba(41, 150, 161, 1);
761
+ --color-red-400: rgba(255, 84, 89, 1);
762
+ --color-red-500: rgba(192, 21, 47, 1);
763
+ --color-orange-400: rgba(230, 129, 97, 1);
764
+ --color-orange-500: rgba(168, 75, 47, 1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
 
766
+ /* RGB versions for opacity control */
767
+ --color-brown-600-rgb: 94, 82, 64;
768
+ --color-teal-500-rgb: 33, 128, 141;
769
+ --color-slate-900-rgb: 19, 52, 59;
770
+ --color-slate-500-rgb: 98, 108, 113;
771
+ --color-red-500-rgb: 192, 21, 47;
772
+ --color-red-400-rgb: 255, 84, 89;
773
+ --color-orange-500-rgb: 168, 75, 47;
774
+ --color-orange-400-rgb: 230, 129, 97;
775
 
776
+ /* Background color tokens (Light Mode) */
777
+ --color-bg-1: rgba(59, 130, 246, 0.08);
778
+ --color-bg-2: rgba(245, 158, 11, 0.08);
779
+ --color-bg-3: rgba(34, 197, 94, 0.08);
780
+ --color-bg-4: rgba(239, 68, 68, 0.08);
781
+ --color-bg-5: rgba(147, 51, 234, 0.08);
782
+ --color-bg-6: rgba(249, 115, 22, 0.08);
783
+ --color-bg-7: rgba(236, 72, 153, 0.08);
784
+ --color-bg-8: rgba(6, 182, 212, 0.08);
785
 
786
+ /* Semantic Color Tokens (Light Mode) */
787
+ --color-background: var(--color-cream-50);
788
+ --color-surface: var(--color-cream-100);
789
+ --color-text: var(--color-slate-900);
790
+ --color-text-secondary: var(--color-slate-500);
791
+ --color-primary: var(--color-teal-500);
792
+ --color-primary-hover: var(--color-teal-600);
793
+ --color-primary-active: var(--color-teal-700);
794
+ --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
795
+ --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
796
+ --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
797
+ --color-border: rgba(var(--color-brown-600-rgb), 0.2);
798
+ --color-btn-primary-text: var(--color-cream-50);
799
+ --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
800
+ --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
801
+ --color-error: var(--color-red-500);
802
+ --color-success: var(--color-teal-500);
803
+ --color-warning: var(--color-orange-500);
804
+ --color-info: var(--color-slate-500);
805
+ --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
806
+ --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);
807
 
808
+ /* Typography */
809
+ --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
810
+ --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
811
+ --font-size-xs: 11px;
812
+ --font-size-sm: 12px;
813
+ --font-size-base: 14px;
814
+ --font-size-md: 14px;
815
+ --font-size-lg: 16px;
816
+ --font-size-xl: 18px;
817
+ --font-size-2xl: 20px;
818
+ --font-size-3xl: 24px;
819
+ --font-size-4xl: 30px;
820
+ --font-weight-normal: 400;
821
+ --font-weight-medium: 500;
822
+ --font-weight-semibold: 550;
823
+ --font-weight-bold: 600;
824
+ --line-height-tight: 1.2;
825
+ --line-height-normal: 1.5;
826
+ --letter-spacing-tight: -0.01em;
827
 
828
+ /* Spacing */
829
+ --space-0: 0;
830
+ --space-1: 1px;
831
+ --space-2: 2px;
832
+ --space-4: 4px;
833
+ --space-6: 6px;
834
+ --space-8: 8px;
835
+ --space-10: 10px;
836
+ --space-12: 12px;
837
+ --space-16: 16px;
838
+ --space-20: 20px;
839
+ --space-24: 24px;
840
+ --space-32: 32px;
841
 
842
+ /* Border Radius */
843
+ --radius-sm: 6px;
844
+ --radius-base: 8px;
845
+ --radius-md: 10px;
846
+ --radius-lg: 12px;
847
+ --radius-full: 9999px;
848
 
849
+ /* Shadows */
850
+ --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
851
+ --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
852
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
853
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
854
+ --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.03);
855
 
856
+ /* Animation */
857
+ --duration-fast: 150ms;
858
+ --duration-normal: 250ms;
859
+ --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
860
  }
861
 
862
+ @media (prefers-color-scheme: dark) {
863
+ :root {
864
+ --color-gray-400-rgb: 119, 124, 124;
865
+ --color-teal-300-rgb: 50, 184, 198;
866
+ --color-gray-300-rgb: 167, 169, 169;
867
+ --color-gray-200-rgb: 245, 245, 245;
868
 
869
+ --color-bg-1: rgba(29, 78, 216, 0.15);
870
+ --color-bg-2: rgba(180, 83, 9, 0.15);
871
+ --color-bg-3: rgba(21, 128, 61, 0.15);
872
+ --color-bg-4: rgba(185, 28, 28, 0.15);
873
+ --color-bg-5: rgba(107, 33, 168, 0.15);
874
+ --color-bg-6: rgba(194, 65, 12, 0.15);
875
+ --color-bg-7: rgba(190, 24, 93, 0.15);
876
+ --color-bg-8: rgba(8, 145, 178, 0.15);
877
 
878
+ --color-background: var(--color-charcoal-700);
879
+ --color-surface: var(--color-charcoal-800);
880
+ --color-text: var(--color-gray-200);
881
+ --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
882
+ --color-primary: var(--color-teal-300);
883
+ --color-primary-hover: var(--color-teal-400);
884
+ --color-primary-active: var(--color-teal-800);
885
+ --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
886
+ --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
887
+ --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
888
+ --color-border: rgba(var(--color-gray-400-rgb), 0.3);
889
+ --color-error: var(--color-red-400);
890
+ --color-success: var(--color-teal-300);
891
+ --color-warning: var(--color-orange-400);
892
+ --color-info: var(--color-gray-300);
893
+ --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
894
+ --color-btn-primary-text: var(--color-slate-900);
895
+ --color-card-border: rgba(var(--color-gray-400-rgb), 0.2);
896
+ --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
897
+ --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
898
+ }
899
  }
900
 
901
+ @font-face {
902
+ font-family: 'FKGroteskNeue';
903
+ src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2') format('woff2');
904
  }
905
 
906
+ * {
907
+ margin: 0;
908
+ padding: 0;
909
+ box-sizing: border-box;
910
  }
911
 
912
+ html, body {
913
+ height: 100%;
914
+ font-family: var(--font-family-base);
915
+ font-size: var(--font-size-base);
916
+ line-height: var(--line-height-normal);
917
+ color: var(--color-text);
918
+ background-color: var(--color-background);
919
+ -webkit-font-smoothing: antialiased;
920
  }
921
 
922
+ .app-container {
923
+ display: flex;
924
+ height: 100vh;
925
+ overflow: hidden;
926
  }
927
 
928
+ /* Sidebar Navigation */
929
+ .sidebar {
930
+ width: 260px;
931
+ background-color: var(--color-surface);
932
+ border-right: 1px solid var(--color-border);
933
+ display: flex;
934
+ flex-direction: column;
935
+ overflow-y: auto;
936
  }
937
 
938
+ .sidebar-header {
939
+ padding: var(--space-24) var(--space-20);
940
+ border-bottom: 1px solid var(--color-border);
941
  }
942
 
943
+ .sidebar-header h1 {
944
+ font-size: var(--font-size-2xl);
945
+ font-weight: var(--font-weight-bold);
946
+ color: var(--color-text);
947
+ margin-bottom: var(--space-4);
948
  }
949
 
950
+ .sidebar-header p {
951
+ font-size: var(--font-size-sm);
952
+ color: var(--color-text-secondary);
953
  }
954
 
955
+ .nav-menu {
956
+ list-style: none;
957
+ padding: var(--space-12);
 
958
  }
959
 
960
+ .nav-item {
961
+ display: flex;
962
+ align-items: center;
963
+ padding: var(--space-12) var(--space-16);
964
+ margin-bottom: var(--space-4);
965
+ border-radius: var(--radius-base);
966
+ cursor: pointer;
967
+ transition: all var(--duration-fast) var(--ease-standard);
968
+ color: var(--color-text);
969
  }
970
 
971
+ .nav-item:hover {
972
+ background-color: var(--color-secondary);
 
 
 
 
 
973
  }
974
 
975
+ .nav-item.active {
976
+ background-color: var(--color-primary);
977
+ color: var(--color-btn-primary-text);
 
978
  }
979
 
980
+ /* TOC Category Styles */
981
+ .toc-category {
982
+ margin-bottom: var(--space-8);
 
 
 
983
  }
984
 
985
+ .toc-category-header {
986
+ display: flex;
987
+ align-items: center;
988
+ padding: var(--space-12) var(--space-16);
989
+ background-color: rgba(var(--color-teal-500-rgb), 0.15);
990
+ border-radius: var(--radius-base);
991
+ cursor: pointer;
992
+ transition: all var(--duration-fast) var(--ease-standard);
993
+ margin-bottom: var(--space-8);
994
  }
995
 
996
+ .toc-category-header:hover {
997
+ background-color: rgba(var(--color-teal-500-rgb), 0.25);
 
 
998
  }
999
 
1000
+ .toc-category-header[data-category="supervised"] {
1001
+ background-color: rgba(106, 169, 255, 0.15);
 
 
 
 
 
 
 
1002
  }
1003
 
1004
+ .toc-category-header[data-category="supervised"]:hover {
1005
+ background-color: rgba(106, 169, 255, 0.25);
 
 
 
1006
  }
1007
 
1008
+ .toc-category-header[data-category="unsupervised"] {
1009
+ background-color: rgba(126, 240, 212, 0.15);
 
 
1010
  }
1011
 
1012
+ .toc-category-header[data-category="unsupervised"]:hover {
1013
+ background-color: rgba(126, 240, 212, 0.25);
 
 
 
 
 
 
 
1014
  }
1015
 
1016
+ .toc-category-header[data-category="reinforcement"] {
1017
+ background-color: rgba(255, 140, 106, 0.15);
 
1018
  }
1019
 
1020
+ .toc-category-header[data-category="reinforcement"]:hover {
1021
+ background-color: rgba(255, 140, 106, 0.25);
 
 
1022
  }
1023
 
1024
+ .category-icon {
1025
+ font-size: var(--font-size-xl);
1026
+ margin-right: var(--space-8);
 
1027
  }
1028
 
1029
+ .category-title {
1030
+ flex: 1;
1031
+ font-size: var(--font-size-sm);
1032
+ font-weight: var(--font-weight-bold);
1033
+ color: var(--color-text);
1034
+ letter-spacing: 0.5px;
1035
  }
1036
 
1037
+ .category-toggle {
1038
+ font-size: var(--font-size-sm);
1039
+ color: var(--color-text-secondary);
1040
+ transition: transform var(--duration-normal) var(--ease-standard);
1041
  }
1042
 
1043
+ .category-toggle.collapsed {
1044
+ transform: rotate(-90deg);
 
1045
  }
1046
 
1047
+ .toc-category-content {
1048
+ padding-left: var(--space-16);
1049
+ max-height: 1000px;
1050
+ overflow: hidden;
1051
+ transition: max-height var(--duration-normal) var(--ease-standard);
 
 
1052
  }
1053
 
1054
+ .toc-category-content.collapsed {
1055
+ max-height: 0;
 
 
 
 
 
1056
  }
1057
 
1058
+ .toc-subcategory {
1059
+ margin-bottom: var(--space-12);
 
1060
  }
1061
 
1062
+ .toc-subcategory-title {
1063
+ font-size: var(--font-size-xs);
1064
+ font-weight: var(--font-weight-semibold);
1065
+ color: var(--color-text-secondary);
1066
+ text-transform: uppercase;
1067
+ letter-spacing: 1px;
1068
+ padding: var(--space-8) var(--space-8) var(--space-4) var(--space-8);
1069
  }
1070
 
1071
+ .toc-link.toc-sub {
1072
+ padding: var(--space-8) var(--space-12);
1073
+ font-size: var(--font-size-sm);
1074
+ margin-bottom: var(--space-4);
1075
  }
1076
 
1077
+ .nav-icon {
1078
+ font-size: var(--font-size-xl);
1079
+ margin-right: var(--space-12);
1080
  }
1081
 
1082
+ .nav-label {
1083
+ font-size: var(--font-size-base);
1084
+ font-weight: var(--font-weight-medium);
1085
  }
1086
 
1087
+ /* Main Content */
1088
+ .main-content {
1089
+ flex: 1;
1090
+ overflow-y: auto;
1091
+ padding: var(--space-32);
1092
  }
1093
 
1094
+ .module {
1095
+ max-width: 1400px;
1096
+ margin: 0 auto;
1097
  }
1098
 
1099
+ .module-header {
1100
+ margin-bottom: var(--space-32);
1101
  }
1102
 
1103
+ .module-header h2 {
1104
+ font-size: var(--font-size-4xl);
1105
+ font-weight: var(--font-weight-bold);
1106
+ margin-bottom: var(--space-8);
1107
+ color: var(--color-text);
1108
  }
1109
 
1110
+ .module-header p {
1111
+ font-size: var(--font-size-lg);
1112
+ color: var(--color-text-secondary);
 
 
 
 
 
1113
  }
1114
 
1115
+ .content-grid {
1116
+ display: grid;
1117
+ grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
1118
+ gap: var(--space-24);
 
 
 
 
1119
  }
1120
 
1121
+ .section {
1122
+ background-color: var(--color-surface);
1123
+ border: 1px solid var(--color-card-border);
1124
+ border-radius: var(--radius-lg);
1125
+ padding: var(--space-24);
 
1126
  }
1127
 
1128
+ .section h3 {
1129
+ font-size: var(--font-size-xl);
1130
+ font-weight: var(--font-weight-semibold);
1131
+ margin-bottom: var(--space-16);
1132
+ color: var(--color-text);
1133
  }
1134
 
1135
+ .section h4 {
1136
+ font-size: var(--font-size-lg);
1137
+ font-weight: var(--font-weight-medium);
1138
+ margin-bottom: var(--space-12);
1139
+ color: var(--color-text);
1140
  }
1141
 
1142
+ .chart-section {
1143
+ display: flex;
1144
+ flex-direction: column;
1145
+ align-items: center;
 
 
1146
  }
1147
 
1148
+ .chart-section canvas {
1149
+ max-width: 100%;
1150
+ height: auto;
1151
  }
1152
 
1153
+ .full-width {
1154
+ grid-column: 1 / -1;
 
 
 
1155
  }
1156
 
1157
+ /* Tables */
1158
+ .table-container {
1159
+ overflow-x: auto;
 
1160
  }
1161
 
1162
+ .data-table {
1163
+ width: 100%;
1164
+ border-collapse: collapse;
1165
  }
1166
 
1167
+ .data-table thead {
1168
+ background-color: var(--color-secondary);
 
 
1169
  }
1170
 
1171
+ .data-table th,
1172
+ .data-table td {
1173
+ padding: var(--space-12);
1174
+ text-align: left;
1175
+ border-bottom: 1px solid var(--color-border);
1176
  }
1177
 
1178
+ .data-table th {
1179
+ font-weight: var(--font-weight-semibold);
1180
+ font-size: var(--font-size-sm);
1181
+ color: var(--color-text);
 
 
 
 
1182
  }
1183
 
1184
+ .data-table td {
1185
+ font-size: var(--font-size-base);
1186
+ color: var(--color-text);
 
 
1187
  }
1188
 
1189
+ .data-table tbody tr:hover {
1190
+ background-color: var(--color-secondary);
 
 
 
 
 
 
1191
  }
1192
 
1193
  /* Controls */
1194
  .controls {
1195
+ display: flex;
1196
+ flex-direction: column;
1197
+ gap: var(--space-16);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198
  }
1199
 
1200
+ .control-group {
1201
+ display: flex;
1202
+ flex-direction: column;
1203
+ gap: var(--space-8);
 
 
 
 
1204
  }
1205
 
1206
+ .control-group label {
1207
+ font-size: var(--font-size-sm);
1208
+ font-weight: var(--font-weight-medium);
1209
+ color: var(--color-text);
1210
  }
1211
 
1212
+ .control-group input[type="range"] {
1213
+ width: 100%;
1214
+ height: 6px;
1215
+ border-radius: var(--radius-full);
1216
+ background: var(--color-secondary);
1217
+ outline: none;
1218
+ cursor: pointer;
1219
  }
1220
 
1221
+ .control-group input[type="range"]::-webkit-slider-thumb {
1222
+ -webkit-appearance: none;
1223
+ appearance: none;
1224
+ width: 18px;
1225
+ height: 18px;
1226
+ border-radius: 50%;
1227
+ background: var(--color-primary);
1228
+ cursor: pointer;
1229
  }
1230
 
1231
+ .control-group input[type="range"]::-moz-range-thumb {
1232
+ width: 18px;
1233
+ height: 18px;
1234
+ border-radius: 50%;
1235
+ background: var(--color-primary);
1236
+ cursor: pointer;
1237
+ border: none;
1238
  }
1239
 
1240
+ .radio-group {
1241
+ display: flex;
1242
+ gap: var(--space-16);
1243
+ flex-wrap: wrap;
 
 
 
 
 
 
1244
  }
1245
 
1246
+ .radio-group label {
1247
+ display: flex;
1248
+ align-items: center;
1249
+ gap: var(--space-6);
1250
+ cursor: pointer;
1251
+ font-size: var(--font-size-base);
1252
  }
1253
 
1254
+ .radio-group input[type="radio"] {
1255
+ cursor: pointer;
 
 
 
 
 
 
1256
  }
1257
 
1258
  /* Buttons */
1259
  .btn {
1260
+ display: inline-flex;
1261
+ align-items: center;
1262
+ justify-content: center;
1263
+ padding: var(--space-10) var(--space-20);
1264
+ border-radius: var(--radius-base);
1265
+ font-size: var(--font-size-base);
1266
+ font-weight: var(--font-weight-medium);
1267
+ cursor: pointer;
1268
+ transition: all var(--duration-normal) var(--ease-standard);
1269
+ border: none;
1270
+ text-decoration: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1271
  }
1272
 
1273
+ .btn--primary {
1274
+ background: var(--color-primary);
1275
+ color: var(--color-btn-primary-text);
1276
  }
1277
 
1278
+ .btn--primary:hover {
1279
+ background: var(--color-primary-hover);
 
 
1280
  }
1281
 
1282
+ .btn--secondary {
1283
+ background: var(--color-secondary);
1284
+ color: var(--color-text);
1285
  }
1286
 
1287
+ .btn--secondary:hover {
1288
+ background: var(--color-secondary-hover);
1289
  }
1290
 
1291
+ /* Info Cards */
1292
+ .info-card {
1293
+ background-color: var(--color-bg-1);
1294
+ border: 1px solid var(--color-border);
1295
+ border-radius: var(--radius-base);
1296
+ padding: var(--space-16);
1297
+ margin-top: var(--space-16);
1298
  }
1299
 
1300
+ .info-card h4 {
1301
+ font-size: var(--font-size-sm);
1302
+ font-weight: var(--font-weight-medium);
1303
+ color: var(--color-text-secondary);
1304
+ margin-bottom: var(--space-8);
 
 
1305
  }
1306
 
1307
+ .metric-value {
1308
+ font-size: var(--font-size-3xl);
1309
+ font-weight: var(--font-weight-bold);
1310
+ color: var(--color-primary);
1311
  }
1312
 
1313
+ .metric-detail {
1314
+ font-size: var(--font-size-sm);
1315
+ color: var(--color-text-secondary);
1316
+ margin-top: var(--space-4);
 
 
 
1317
  }
1318
 
1319
+ /* Explanation Cards */
1320
+ .explanation-card {
1321
+ background-color: var(--color-bg-2);
1322
+ border: 1px solid var(--color-border);
1323
+ border-radius: var(--radius-base);
1324
+ padding: var(--space-20);
1325
  }
1326
 
1327
+ .explanation-card h4 {
1328
+ font-size: var(--font-size-lg);
1329
+ font-weight: var(--font-weight-semibold);
1330
+ margin-bottom: var(--space-12);
1331
  }
1332
 
1333
+ .explanation-card p {
1334
+ margin-bottom: var(--space-12);
1335
+ line-height: 1.6;
 
 
 
 
 
1336
  }
1337
 
1338
+ .explanation-card ul {
1339
+ padding-left: var(--space-20);
1340
+ margin-top: var(--space-12);
 
 
1341
  }
1342
 
1343
+ .explanation-card li {
1344
+ margin-bottom: var(--space-8);
1345
+ line-height: 1.6;
1346
  }
1347
 
1348
+ .formula {
1349
+ font-family: var(--font-family-mono);
1350
+ background-color: var(--color-surface);
1351
+ padding: var(--space-8) var(--space-12);
1352
+ border-radius: var(--radius-sm);
1353
+ display: inline-block;
1354
+ margin: var(--space-8) 0;
1355
+ border: 1px solid var(--color-border);
1356
  }
1357
 
1358
+ /* Confusion Matrix */
1359
+ .confusion-matrix {
1360
+ display: grid;
1361
+ grid-template-columns: 1fr 1fr;
1362
+ gap: var(--space-12);
1363
+ margin-bottom: var(--space-20);
1364
  }
1365
 
1366
+ .cm-cell {
1367
+ padding: var(--space-20);
1368
+ border-radius: var(--radius-base);
1369
+ text-align: center;
1370
+ display: flex;
1371
+ flex-direction: column;
1372
+ gap: var(--space-8);
1373
  }
1374
 
1375
+ .cm-label {
1376
+ font-size: var(--font-size-sm);
1377
+ font-weight: var(--font-weight-medium);
1378
+ color: var(--color-text-secondary);
 
1379
  }
1380
 
1381
+ .cm-value {
1382
+ font-size: var(--font-size-3xl);
1383
+ font-weight: var(--font-weight-bold);
 
1384
  }
1385
 
1386
+ .cm-tn {
1387
+ background-color: var(--color-bg-3);
1388
+ border: 2px solid var(--color-success);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1389
  }
1390
 
1391
+ .cm-tn .cm-value {
1392
+ color: var(--color-success);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1393
  }
1394
 
1395
+ .cm-fp {
1396
+ background-color: var(--color-bg-4);
1397
+ border: 2px solid var(--color-error);
 
 
 
 
 
1398
  }
1399
 
1400
+ .cm-fp .cm-value {
1401
+ color: var(--color-error);
 
 
 
 
1402
  }
1403
 
1404
+ .cm-fn {
1405
+ background-color: var(--color-bg-4);
1406
+ border: 2px solid var(--color-error);
 
 
1407
  }
1408
 
1409
+ .cm-fn .cm-value {
1410
+ color: var(--color-error);
 
 
 
 
 
 
 
1411
  }
1412
 
1413
+ .cm-tp {
1414
+ background-color: var(--color-bg-3);
1415
+ border: 2px solid var(--color-success);
 
1416
  }
1417
 
1418
+ .cm-tp .cm-value {
1419
+ color: var(--color-success);
 
 
 
 
1420
  }
1421
 
1422
+ /* Metrics Panel */
1423
+ .metrics-panel {
1424
+ display: flex;
1425
+ gap: var(--space-20);
1426
+ flex-wrap: wrap;
1427
+ margin-top: var(--space-16);
1428
  }
1429
 
1430
+ .metric-item {
1431
+ flex: 1;
1432
+ min-width: 150px;
1433
+ padding: var(--space-12);
1434
+ background-color: var(--color-secondary);
1435
+ border-radius: var(--radius-base);
1436
+ display: flex;
1437
+ flex-direction: column;
1438
+ gap: var(--space-4);
1439
  }
1440
 
1441
+ .metric-label {
1442
+ font-size: var(--font-size-sm);
1443
+ color: var(--color-text-secondary);
 
 
 
 
 
1444
  }
1445
 
1446
+ .metric-val {
1447
+ font-size: var(--font-size-xl);
1448
+ font-weight: var(--font-weight-bold);
1449
+ color: var(--color-text);
 
 
1450
  }
1451
 
1452
+ /* Three Charts Layout */
1453
+ .three-charts {
1454
+ display: grid;
1455
+ grid-template-columns: repeat(3, 1fr);
1456
+ gap: var(--space-20);
1457
+ width: 100%;
1458
  }
1459
 
1460
+ .chart-container {
1461
+ display: flex;
1462
+ flex-direction: column;
1463
+ align-items: center;
1464
+ gap: var(--space-12);
 
 
1465
  }
1466
 
1467
+ .chart-container h4 {
1468
+ font-size: var(--font-size-base);
1469
+ font-weight: var(--font-weight-semibold);
1470
+ text-align: center;
 
1471
  }
1472
 
1473
+ .chart-desc {
1474
+ font-size: var(--font-size-sm);
1475
+ color: var(--color-text-secondary);
1476
+ text-align: center;
1477
+ margin-top: var(--space-8);
1478
  }
1479
 
1480
+ /* Calculation Panel */
1481
+ .calculation-panel {
1482
+ display: flex;
1483
+ flex-direction: column;
1484
+ gap: var(--space-12);
1485
  }
1486
 
1487
+ .calc-item {
1488
+ display: flex;
1489
+ justify-content: space-between;
1490
+ align-items: center;
1491
+ padding: var(--space-12);
1492
+ background-color: var(--color-secondary);
1493
+ border-radius: var(--radius-base);
 
1494
  }
1495
 
1496
+ .calc-item strong {
1497
+ font-weight: var(--font-weight-medium);
 
 
 
 
 
1498
  }
1499
 
1500
+ .calc-item span {
1501
+ font-family: var(--font-family-mono);
1502
+ color: var(--color-primary);
1503
+ font-weight: var(--font-weight-semibold);
 
 
1504
  }
1505
 
1506
+ /* Responsive adjustments */
1507
+ @media (max-width: 1200px) {
1508
+ .content-grid {
1509
+ grid-template-columns: 1fr;
1510
+ }
1511
+
1512
+ .three-charts {
1513
+ grid-template-columns: 1fr;
1514
+ }
1515
  }
1516
 
1517
+ /* Pipeline Flow */
1518
+ .pipeline-flow {
1519
+ display: grid;
1520
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
1521
+ gap: var(--space-16);
1522
  }
1523
 
1524
+ .pipeline-stage {
1525
+ background: var(--color-bg-1);
1526
+ border: 1px solid var(--color-border);
1527
+ border-radius: var(--radius-base);
1528
+ padding: var(--space-16);
 
1529
  }
1530
 
1531
+ .pipeline-stage h4 {
1532
+ font-size: var(--font-size-base);
1533
+ margin-bottom: var(--space-12);
1534
+ color: var(--color-primary);
1535
  }
1536
 
1537
+ /* Workflow Container */
1538
+ .workflow-container {
1539
+ display: flex;
1540
+ align-items: center;
1541
+ justify-content: space-between;
1542
+ flex-wrap: wrap;
1543
+ gap: var(--space-16);
1544
+ padding: var(--space-24);
1545
  }
1546
 
1547
+ .workflow-stage {
1548
+ flex: 1;
1549
+ min-width: 140px;
1550
+ background: var(--color-bg-1);
1551
+ border: 2px solid var(--color-border);
1552
+ border-radius: var(--radius-lg);
1553
+ padding: var(--space-20);
1554
+ text-align: center;
1555
+ transition: all var(--duration-normal) var(--ease-standard);
1556
+ cursor: pointer;
1557
  }
1558
 
1559
+ .workflow-stage:hover {
1560
+ transform: translateY(-4px);
1561
+ box-shadow: var(--shadow-lg);
1562
+ border-color: var(--color-primary);
 
 
 
 
 
 
1563
  }
1564
 
1565
+ .workflow-stage.active {
1566
+ background: var(--color-primary);
1567
+ color: var(--color-btn-primary-text);
1568
+ border-color: var(--color-primary);
1569
  }
1570
 
1571
+ .stage-icon {
1572
+ font-size: 32px;
1573
+ margin-bottom: var(--space-8);
 
 
 
1574
  }
1575
 
1576
+ .workflow-stage h4 {
1577
+ font-size: var(--font-size-base);
1578
+ margin-bottom: var(--space-8);
1579
  }
1580
 
1581
+ .workflow-stage p {
1582
+ font-size: var(--font-size-sm);
1583
+ color: var(--color-text-secondary);
1584
+ margin-bottom: var(--space-12);
1585
  }
1586
 
1587
+ .workflow-stage.active p {
1588
+ color: var(--color-btn-primary-text);
1589
+ opacity: 0.9;
 
 
 
 
 
1590
  }
1591
 
1592
+ .workflow-arrow {
1593
+ font-size: 24px;
1594
+ color: var(--color-primary);
1595
+ font-weight: bold;
1596
  }
1597
 
1598
+ .stage-btn {
1599
+ font-size: var(--font-size-sm);
1600
+ padding: var(--space-6) var(--space-12);
 
 
 
 
 
 
1601
  }
1602
 
1603
+ @media (max-width: 1200px) {
1604
+ .workflow-container {
1605
+ flex-direction: column;
1606
+ }
1607
+
1608
+ .workflow-arrow {
1609
+ transform: rotate(90deg);
1610
+ }
1611
  }
1612
 
1613
+ @media (max-width: 768px) {
1614
+ .sidebar {
1615
+ width: 80px;
1616
+ }
1617
+
1618
+ .nav-label {
1619
+ display: none;
1620
+ }
1621
+
1622
+ .sidebar-header h1 {
1623
+ font-size: var(--font-size-lg);
1624
+ }
1625
+
1626
+ .sidebar-header p {
1627
+ display: none;
1628
+ }
1629
  }
prompt-engineering-guide/app.js ADDED
@@ -0,0 +1,628 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Topics data
2
+ const topics = [
3
+ { id: 1, title: "Introduction to Prompt Engineering", subtitle: "What & Why" },
4
+ { id: 2, title: "Prompt Structure", subtitle: "Building Blocks" },
5
+ { id: 3, title: "Clarity & Specificity", subtitle: "Writing Precise Prompts" },
6
+ { id: 4, title: "Context & Background", subtitle: "Providing Information" },
7
+ { id: 5, title: "Output Format", subtitle: "Specifying Structure" },
8
+ { id: 6, title: "Iterative Refinement", subtitle: "Testing & Improving" },
9
+ { id: 7, title: "Advanced Techniques", subtitle: "Expert Methods" },
10
+ { id: 8, title: "Real-World Applications", subtitle: "Putting It Together" }
11
+ ];
12
+
13
+ // State management
14
+ let currentTopic = 1;
15
+ let completedTopics = [];
16
+
17
+ // Initialize app
18
+ function init() {
19
+ renderTopicList();
20
+ initializeCanvases();
21
+ updateProgress();
22
+ showContextExample('minimal');
23
+ showFormatExample('list');
24
+ showIteration(1);
25
+ updateSpecificity();
26
+ setChallenge('email');
27
+ }
28
+
29
+ // Render topic list in sidebar
30
+ function renderTopicList() {
31
+ const topicList = document.getElementById('topicList');
32
+ topicList.innerHTML = topics.map(topic => `
33
+ <li class="topic-item ${topic.id === currentTopic ? 'active' : ''}" onclick="navigateTo(${topic.id})">
34
+ <h3>${topic.id}. ${topic.title}</h3>
35
+ <p>${topic.subtitle}</p>
36
+ </li>
37
+ `).join('');
38
+ }
39
+
40
+ // Navigate to topic
41
+ function navigateTo(topicId) {
42
+ // Hide current section
43
+ const currentSection = document.querySelector('.content-section.active');
44
+ if (currentSection) {
45
+ currentSection.classList.remove('active');
46
+ }
47
+
48
+ // Show new section
49
+ const newSection = document.getElementById(`topic-${topicId}`);
50
+ if (newSection) {
51
+ newSection.classList.add('active');
52
+ currentTopic = topicId;
53
+
54
+ // Mark previous topics as completed
55
+ if (!completedTopics.includes(topicId - 1) && topicId > 1) {
56
+ completedTopics.push(topicId - 1);
57
+ }
58
+
59
+ renderTopicList();
60
+ updateProgress();
61
+ window.scrollTo({ top: 0, behavior: 'smooth' });
62
+ }
63
+ }
64
+
65
+ // Update progress bar
66
+ function updateProgress() {
67
+ const progress = (currentTopic / topics.length) * 100;
68
+ const progressBar = document.getElementById('progressBar');
69
+ progressBar.style.width = `${progress}%`;
70
+ }
71
+
72
+ // Prompt quality evaluation
73
+ function updatePromptQuality() {
74
+ const role = document.getElementById('roleInput').value;
75
+ const context = document.getElementById('contextInput').value;
76
+ const task = document.getElementById('taskInput').value;
77
+ const format = document.getElementById('formatInput').value;
78
+
79
+ const components = [role, context, task, format];
80
+ const filledComponents = components.filter(c => c.trim().length > 0).length;
81
+
82
+ const qualityGrade = document.getElementById('qualityGrade');
83
+ const combinedPrompt = document.getElementById('combinedPrompt');
84
+
85
+ let gradeText = '';
86
+ let gradeClass = '';
87
+
88
+ if (filledComponents === 0) {
89
+ gradeText = 'Quality: Poor';
90
+ gradeClass = 'grade-poor';
91
+ combinedPrompt.textContent = 'Start filling in the components above...';
92
+ } else if (filledComponents <= 2) {
93
+ gradeText = 'Quality: Poor';
94
+ gradeClass = 'grade-poor';
95
+ } else if (filledComponents === 3) {
96
+ gradeText = 'Quality: Good';
97
+ gradeClass = 'grade-good';
98
+ } else {
99
+ gradeText = 'Quality: Excellent';
100
+ gradeClass = 'grade-excellent';
101
+ }
102
+
103
+ qualityGrade.textContent = gradeText;
104
+ qualityGrade.className = 'quality-grade ' + gradeClass;
105
+
106
+ if (filledComponents > 0) {
107
+ const parts = [];
108
+ if (role) parts.push(role);
109
+ if (context) parts.push(context);
110
+ if (task) parts.push(task);
111
+ if (format) parts.push(format);
112
+ combinedPrompt.textContent = parts.join(' ');
113
+ }
114
+ }
115
+
116
+ // Specificity slider
117
+ const specificityLevels = [
118
+ {
119
+ level: 1,
120
+ prompt: "Write about AI.",
121
+ quality: "Poor - Too vague, could mean anything"
122
+ },
123
+ {
124
+ level: 2,
125
+ prompt: "Write about machine learning.",
126
+ quality: "Poor - Still too broad, no specific focus"
127
+ },
128
+ {
129
+ level: 3,
130
+ prompt: "Explain how machine learning works in simple terms.",
131
+ quality: "Good - More specific, mentions simplicity"
132
+ },
133
+ {
134
+ level: 4,
135
+ prompt: "Explain how machine learning works in 200 words, using simple terms for beginners.",
136
+ quality: "Very Good - Specifies length and audience"
137
+ },
138
+ {
139
+ level: 5,
140
+ prompt: "Write a 200-word beginner's guide explaining how machine learning works, using a coffee shop analogy. Keep language simple for 10th graders.",
141
+ quality: "Excellent - Specific length, audience, analogy, and complexity level"
142
+ }
143
+ ];
144
+
145
+ function updateSpecificity() {
146
+ const slider = document.getElementById('specificitySlider');
147
+ const value = parseInt(slider.value);
148
+ document.getElementById('specificityValue').textContent = value;
149
+
150
+ const level = specificityLevels[value - 1];
151
+ document.getElementById('specificityPrompt').textContent = level.prompt;
152
+ document.getElementById('specificityQuality').textContent = level.quality;
153
+ }
154
+
155
+ // Context examples
156
+ const contextExamples = {
157
+ minimal: {
158
+ prompt: "Write a marketing email.",
159
+ quality: "⚠️ Poor - No context about product, audience, or goal"
160
+ },
161
+ moderate: {
162
+ prompt: "Write a marketing email for our new coffee subscription service. Target coffee enthusiasts.",
163
+ quality: "⚑ Good - Has product and audience, but could use more details"
164
+ },
165
+ rich: {
166
+ prompt: "Write a marketing email for our new coffee subscription service. We're a sustainable brand targeting environmentally-conscious coffee enthusiasts aged 25-40. The service delivers ethically-sourced beans monthly. Tone should be warm and knowledgeable. Email should introduce the service, highlight sustainability, and include a 20% off first order offer. Keep it under 200 words.",
167
+ quality: "βœ“ Excellent - Complete context with audience, brand voice, key points, and constraints"
168
+ }
169
+ };
170
+
171
+ function showContextExample(level) {
172
+ // Update button states
173
+ const buttons = document.querySelectorAll('#topic-4 .scenario-btn');
174
+ buttons.forEach(btn => btn.classList.remove('active'));
175
+ event.target.classList.add('active');
176
+
177
+ const example = contextExamples[level];
178
+ document.getElementById('contextPromptText').textContent = example.prompt;
179
+ document.getElementById('contextQuality').textContent = example.quality;
180
+ }
181
+
182
+ // Format examples
183
+ const formatExamples = {
184
+ list: {
185
+ prompt: "Provide the information as a numbered list with brief explanations for each point.",
186
+ output: "1. First Point\n Brief explanation here\n\n2. Second Point\n Brief explanation here\n\n3. Third Point\n Brief explanation here"
187
+ },
188
+ table: {
189
+ prompt: "Create a comparison table with columns: Feature, Pros, Cons",
190
+ output: "| Feature | Pros | Cons |\n|------------|-------------------|-------------------|\n| Feature A | Advantage 1 | Disadvantage 1 |\n| Feature B | Advantage 2 | Disadvantage 2 |"
191
+ },
192
+ narrative: {
193
+ prompt: "Write the response as a 3-paragraph narrative with introduction, body, and conclusion.",
194
+ output: "Introduction paragraph setting context...\n\nBody paragraph with main information and details...\n\nConclusion paragraph summarizing key points..."
195
+ },
196
+ code: {
197
+ prompt: "Provide Python code with inline comments explaining each step.",
198
+ output: "# Calculate factorial of a number\ndef factorial(n):\n # Base case: factorial of 0 or 1 is 1\n if n <= 1:\n return 1\n # Recursive case\n return n * factorial(n - 1)"
199
+ },
200
+ json: {
201
+ prompt: "Return the data as a JSON object with proper structure.",
202
+ output: "{\n \"name\": \"Example\",\n \"items\": [\n { \"id\": 1, \"value\": \"Item 1\" },\n { \"id\": 2, \"value\": \"Item 2\" }\n ]\n}"
203
+ }
204
+ };
205
+
206
+ function showFormatExample(format) {
207
+ // Update button states
208
+ const buttons = document.querySelectorAll('#topic-5 .scenario-btn');
209
+ buttons.forEach(btn => btn.classList.remove('active'));
210
+ event.target.classList.add('active');
211
+
212
+ const example = formatExamples[format];
213
+ document.getElementById('formatPromptText').textContent = example.prompt;
214
+ document.getElementById('formatOutputExample').textContent = example.output;
215
+ }
216
+
217
+ // Iteration examples
218
+ const iterations = [
219
+ {
220
+ iteration: 1,
221
+ prompt: "Help me with my website.",
222
+ score: "25/100 - Very Poor",
223
+ notes: "❌ Issues: No context, unclear task, no specifics. AI won't know what kind of help you need."
224
+ },
225
+ {
226
+ iteration: 2,
227
+ prompt: "I have an e-commerce website and need help improving the checkout process. Can you suggest improvements?",
228
+ score: "65/100 - Good",
229
+ notes: "βœ“ Better: Added context (e-commerce) and specific area (checkout). ⚠️ Still missing: What problems exist? What's the current user experience?"
230
+ },
231
+ {
232
+ iteration: 3,
233
+ prompt: "I run an e-commerce website selling handmade jewelry. Our checkout abandonment rate is 70%. Users complain it takes too long (5+ steps). Analyze this and suggest 3-5 specific improvements to reduce friction. Format as: Problem β†’ Solution β†’ Expected Impact.",
234
+ score: "95/100 - Excellent",
235
+ notes: "βœ“ Excellent: Clear context, specific problem with data, defined task, output format specified. AI has everything needed for quality response."
236
+ }
237
+ ];
238
+
239
+ function showIteration(num) {
240
+ const iteration = iterations[num - 1];
241
+ document.getElementById('iterationPrompt').textContent = iteration.prompt;
242
+ document.getElementById('iterationScore').textContent = iteration.score;
243
+ document.getElementById('iterationNotes').innerHTML = `<p style="color: #ccc; margin: 0;">${iteration.notes}</p>`;
244
+ }
245
+
246
+ // Challenge scenarios
247
+ const challenges = {
248
+ email: {
249
+ scenario: "Your manager asked you to write a follow-up email to a client who attended yesterday's product demo. The client seemed interested but had concerns about pricing and implementation timeline."
250
+ },
251
+ code: {
252
+ scenario: "You need to create a JavaScript function that validates email addresses and returns detailed error messages for invalid formats. It should handle edge cases like missing @ symbols, invalid domains, and special characters."
253
+ },
254
+ creative: {
255
+ scenario: "Create a compelling Instagram caption for a new eco-friendly water bottle launch. Your brand targets young professionals who care about sustainability. The post should encourage engagement and include a call-to-action."
256
+ },
257
+ analysis: {
258
+ scenario: "You have sales data from Q1-Q4 showing declining revenue in Q3. Analyze what might have caused this dip and provide actionable recommendations. Consider seasonality, marketing spend, and competition."
259
+ }
260
+ };
261
+
262
+ let currentChallenge = 'email';
263
+
264
+ function setChallenge(type) {
265
+ currentChallenge = type;
266
+
267
+ // Update button states
268
+ const buttons = document.querySelectorAll('.challenge-box .scenario-btn');
269
+ buttons.forEach(btn => btn.classList.remove('active'));
270
+ event.target.classList.add('active');
271
+
272
+ document.getElementById('challengeScenario').textContent = challenges[type].scenario;
273
+ document.getElementById('challengeInput').value = '';
274
+ document.getElementById('challengeFeedback').classList.remove('show');
275
+ }
276
+
277
+ function evaluateChallenge() {
278
+ const input = document.getElementById('challengeInput').value;
279
+ const feedback = document.getElementById('challengeFeedback');
280
+
281
+ if (!input.trim()) {
282
+ feedback.innerHTML = '<p style="color: #FF6B35;">⚠️ Please write a prompt first!</p>';
283
+ feedback.classList.add('show');
284
+ return;
285
+ }
286
+
287
+ // Simple evaluation based on key elements
288
+ const hasRole = /you are|act as|as a/i.test(input);
289
+ const hasContext = input.length > 100;
290
+ const hasFormat = /format|structure|provide|return|list|table/i.test(input);
291
+ const hasConstraints = /words|length|tone|style|keep/i.test(input);
292
+
293
+ let score = 0;
294
+ let feedbackItems = [];
295
+
296
+ if (hasRole) {
297
+ score += 25;
298
+ feedbackItems.push('βœ“ Good: Includes role/persona');
299
+ } else {
300
+ feedbackItems.push('⚠️ Consider: Adding a role or persona');
301
+ }
302
+
303
+ if (hasContext) {
304
+ score += 25;
305
+ feedbackItems.push('βœ“ Good: Provides context');
306
+ } else {
307
+ feedbackItems.push('⚠️ Consider: Adding more context and background');
308
+ }
309
+
310
+ if (hasFormat) {
311
+ score += 25;
312
+ feedbackItems.push('βœ“ Good: Specifies output format');
313
+ } else {
314
+ feedbackItems.push('⚠️ Consider: Specifying the desired output format');
315
+ }
316
+
317
+ if (hasConstraints) {
318
+ score += 25;
319
+ feedbackItems.push('βœ“ Good: Includes constraints');
320
+ } else {
321
+ feedbackItems.push('⚠️ Consider: Adding constraints like length, tone, or style');
322
+ }
323
+
324
+ let grade = '';
325
+ let color = '';
326
+ if (score >= 75) {
327
+ grade = 'Excellent';
328
+ color = '#00FF88';
329
+ } else if (score >= 50) {
330
+ grade = 'Good';
331
+ color = '#FFB800';
332
+ } else {
333
+ grade = 'Needs Improvement';
334
+ color = '#FF6B35';
335
+ }
336
+
337
+ feedback.innerHTML = `
338
+ <h4 style="color: ${color}; margin-bottom: 12px;">Score: ${score}/100 - ${grade}</h4>
339
+ ${feedbackItems.map(item => `<p style="margin: 8px 0; font-size: 14px;">${item}</p>`).join('')}
340
+ ${score >= 75 ? '<p style="margin-top: 15px; color: #00D9FF;">πŸŽ‰ Great job! Your prompt includes all key components.</p>' : ''}
341
+ `;
342
+ feedback.classList.add('show');
343
+ }
344
+
345
+ function resetChallenge() {
346
+ document.getElementById('challengeInput').value = '';
347
+ document.getElementById('challengeFeedback').classList.remove('show');
348
+ }
349
+
350
+ // Practice challenge
351
+ function startPractice(topicId) {
352
+ alert('Practice mode: Try building a prompt for a simple task like \"Write a product description for noise-canceling headphones\" and include all four components: Role, Context, Task, and Format!');
353
+ }
354
+
355
+ // Template copy
356
+ function copyTemplate(element) {
357
+ const template = element.querySelector('pre').textContent;
358
+
359
+ // Create temporary textarea
360
+ const textarea = document.createElement('textarea');
361
+ textarea.value = template;
362
+ document.body.appendChild(textarea);
363
+ textarea.select();
364
+
365
+ try {
366
+ document.execCommand('copy');
367
+ // Show feedback
368
+ const originalHTML = element.innerHTML;
369
+ element.style.borderColor = '#00FF88';
370
+ setTimeout(() => {
371
+ element.style.borderColor = '#333';
372
+ }, 1000);
373
+ } catch (err) {
374
+ console.error('Copy failed:', err);
375
+ }
376
+
377
+ document.body.removeChild(textarea);
378
+ }
379
+
380
+ // Canvas visualizations
381
+ function initializeCanvases() {
382
+ // Structure Canvas - Component visualization
383
+ const structureCanvas = document.getElementById('structureCanvas');
384
+ if (structureCanvas) {
385
+ const ctx = structureCanvas.getContext('2d');
386
+ drawStructureVisualization(ctx, structureCanvas);
387
+ }
388
+
389
+ // Context Canvas - Information layers
390
+ const contextCanvas = document.getElementById('contextCanvas');
391
+ if (contextCanvas) {
392
+ const ctx = contextCanvas.getContext('2d');
393
+ drawContextVisualization(ctx, contextCanvas);
394
+ }
395
+
396
+ // Refinement Canvas - Improvement curve
397
+ const refinementCanvas = document.getElementById('refinementCanvas');
398
+ if (refinementCanvas) {
399
+ const ctx = refinementCanvas.getContext('2d');
400
+ drawRefinementVisualization(ctx, refinementCanvas);
401
+ }
402
+
403
+ // Techniques Canvas - Pattern comparison
404
+ const techniquesCanvas = document.getElementById('techniquesCanvas');
405
+ if (techniquesCanvas) {
406
+ const ctx = techniquesCanvas.getContext('2d');
407
+ drawTechniquesVisualization(ctx, techniquesCanvas);
408
+ }
409
+ }
410
+
411
+ function drawStructureVisualization(ctx, canvas) {
412
+ canvas.width = canvas.offsetWidth;
413
+ canvas.height = canvas.offsetHeight;
414
+
415
+ const components = [
416
+ { name: 'Role', color: '#0066FF', y: 80 },
417
+ { name: 'Context', color: '#00D9FF', y: 160 },
418
+ { name: 'Task', color: '#FFB800', y: 240 },
419
+ { name: 'Format', color: '#00FF88', y: 320 }
420
+ ];
421
+
422
+ const centerX = canvas.width / 2;
423
+
424
+ // Draw connecting lines
425
+ ctx.strokeStyle = '#333';
426
+ ctx.lineWidth = 2;
427
+ ctx.beginPath();
428
+ ctx.moveTo(centerX, 60);
429
+ ctx.lineTo(centerX, 340);
430
+ ctx.stroke();
431
+
432
+ // Draw components
433
+ components.forEach(comp => {
434
+ // Circle
435
+ ctx.fillStyle = comp.color;
436
+ ctx.beginPath();
437
+ ctx.arc(centerX, comp.y, 30, 0, Math.PI * 2);
438
+ ctx.fill();
439
+
440
+ // Text
441
+ ctx.fillStyle = '#FFFFFF';
442
+ ctx.font = 'bold 14px sans-serif';
443
+ ctx.textAlign = 'center';
444
+ ctx.fillText(comp.name, centerX, comp.y + 5);
445
+ });
446
+
447
+ // Title
448
+ ctx.fillStyle = '#00D9FF';
449
+ ctx.font = 'bold 18px sans-serif';
450
+ ctx.textAlign = 'center';
451
+ ctx.fillText('Prompt Structure Components', centerX, 30);
452
+ }
453
+
454
+ function drawContextVisualization(ctx, canvas) {
455
+ canvas.width = canvas.offsetWidth;
456
+ canvas.height = canvas.offsetHeight;
457
+
458
+ const layers = [
459
+ { name: 'Task Only', width: 100, color: '#FF6B35' },
460
+ { name: '+ Basic Context', width: 200, color: '#FFB800' },
461
+ { name: '+ Full Context', width: 350, color: '#00FF88' }
462
+ ];
463
+
464
+ const startY = 100;
465
+ const layerHeight = 60;
466
+ const spacing = 30;
467
+
468
+ layers.forEach((layer, index) => {
469
+ const y = startY + (index * (layerHeight + spacing));
470
+
471
+ // Draw rectangle
472
+ ctx.fillStyle = layer.color + '44';
473
+ ctx.fillRect(50, y, layer.width, layerHeight);
474
+
475
+ // Draw border
476
+ ctx.strokeStyle = layer.color;
477
+ ctx.lineWidth = 2;
478
+ ctx.strokeRect(50, y, layer.width, layerHeight);
479
+
480
+ // Draw text
481
+ ctx.fillStyle = '#FFFFFF';
482
+ ctx.font = '14px sans-serif';
483
+ ctx.textAlign = 'left';
484
+ ctx.fillText(layer.name, 60, y + 35);
485
+ });
486
+
487
+ // Title
488
+ ctx.fillStyle = '#00D9FF';
489
+ ctx.font = 'bold 18px sans-serif';
490
+ ctx.textAlign = 'left';
491
+ ctx.fillText('Context Layers: From Minimal to Rich', 50, 50);
492
+ }
493
+
494
+ function drawRefinementVisualization(ctx, canvas) {
495
+ canvas.width = canvas.offsetWidth;
496
+ canvas.height = canvas.offsetHeight;
497
+
498
+ const points = [
499
+ { x: 100, y: 300, label: 'Iteration 1' },
500
+ { x: 300, y: 200, label: 'Iteration 2' },
501
+ { x: 500, y: 120, label: 'Iteration 3' },
502
+ { x: 700, y: 80, label: 'Final' }
503
+ ];
504
+
505
+ // Draw curve
506
+ ctx.strokeStyle = '#0066FF';
507
+ ctx.lineWidth = 3;
508
+ ctx.beginPath();
509
+ ctx.moveTo(points[0].x, points[0].y);
510
+
511
+ for (let i = 1; i < points.length; i++) {
512
+ const xMid = (points[i - 1].x + points[i].x) / 2;
513
+ ctx.quadraticCurveTo(xMid, points[i - 1].y, points[i].x, points[i].y);
514
+ }
515
+ ctx.stroke();
516
+
517
+ // Draw points
518
+ points.forEach((point, index) => {
519
+ ctx.fillStyle = '#00D9FF';
520
+ ctx.beginPath();
521
+ ctx.arc(point.x, point.y, 8, 0, Math.PI * 2);
522
+ ctx.fill();
523
+
524
+ // Labels
525
+ ctx.fillStyle = '#FFFFFF';
526
+ ctx.font = '12px sans-serif';
527
+ ctx.textAlign = 'center';
528
+ ctx.fillText(point.label, point.x, point.y + 25);
529
+ });
530
+
531
+ // Y-axis label
532
+ ctx.save();
533
+ ctx.translate(30, 200);
534
+ ctx.rotate(-Math.PI / 2);
535
+ ctx.fillStyle = '#888';
536
+ ctx.font = '14px sans-serif';
537
+ ctx.textAlign = 'center';
538
+ ctx.fillText('Quality', 0, 0);
539
+ ctx.restore();
540
+
541
+ // X-axis label
542
+ ctx.fillStyle = '#888';
543
+ ctx.font = '14px sans-serif';
544
+ ctx.textAlign = 'center';
545
+ ctx.fillText('Iterations', canvas.width / 2, canvas.height - 20);
546
+
547
+ // Title
548
+ ctx.fillStyle = '#00D9FF';
549
+ ctx.font = 'bold 18px sans-serif';
550
+ ctx.textAlign = 'center';
551
+ ctx.fillText('Prompt Improvement Through Iteration', canvas.width / 2, 30);
552
+ }
553
+
554
+ function drawTechniquesVisualization(ctx, canvas) {
555
+ canvas.width = canvas.offsetWidth;
556
+ canvas.height = canvas.offsetHeight;
557
+
558
+ const techniques = [
559
+ { name: 'Basic', score: 40, color: '#FF6B35', x: 150 },
560
+ { name: 'Chain-of-Thought', score: 75, color: '#FFB800', x: 350 },
561
+ { name: 'Few-Shot', score: 85, color: '#00D9FF', x: 550 },
562
+ { name: 'Combined', score: 95, color: '#00FF88', x: 750 }
563
+ ];
564
+
565
+ const maxHeight = 250;
566
+ const barWidth = 80;
567
+ const baseY = 320;
568
+
569
+ techniques.forEach(tech => {
570
+ const barHeight = (tech.score / 100) * maxHeight;
571
+
572
+ // Draw bar
573
+ ctx.fillStyle = tech.color + '88';
574
+ ctx.fillRect(tech.x - barWidth / 2, baseY - barHeight, barWidth, barHeight);
575
+
576
+ // Draw border
577
+ ctx.strokeStyle = tech.color;
578
+ ctx.lineWidth = 2;
579
+ ctx.strokeRect(tech.x - barWidth / 2, baseY - barHeight, barWidth, barHeight);
580
+
581
+ // Score text
582
+ ctx.fillStyle = '#FFFFFF';
583
+ ctx.font = 'bold 16px sans-serif';
584
+ ctx.textAlign = 'center';
585
+ ctx.fillText(tech.score + '%', tech.x, baseY - barHeight - 10);
586
+
587
+ // Technique name
588
+ ctx.font = '12px sans-serif';
589
+ ctx.fillText(tech.name, tech.x, baseY + 25);
590
+ });
591
+
592
+ // Title
593
+ ctx.fillStyle = '#00D9FF';
594
+ ctx.font = 'bold 18px sans-serif';
595
+ ctx.textAlign = 'center';
596
+ ctx.fillText('Technique Effectiveness Comparison', canvas.width / 2, 30);
597
+
598
+ // Y-axis
599
+ ctx.strokeStyle = '#333';
600
+ ctx.lineWidth = 2;
601
+ ctx.beginPath();
602
+ ctx.moveTo(80, 70);
603
+ ctx.lineTo(80, baseY);
604
+ ctx.stroke();
605
+
606
+ // Y-axis label
607
+ ctx.fillStyle = '#888';
608
+ ctx.font = '12px sans-serif';
609
+ ctx.textAlign = 'right';
610
+ ctx.fillText('0%', 75, baseY + 5);
611
+ ctx.fillText('50%', 75, baseY - 125);
612
+ ctx.fillText('100%', 75, baseY - 250);
613
+ }
614
+
615
+ // Checklist interaction
616
+ document.addEventListener('click', function(e) {
617
+ if (e.target.tagName === 'LI' && e.target.parentElement.classList.contains('checklist')) {
618
+ e.target.classList.toggle('checked');
619
+ }
620
+ });
621
+
622
+ // Initialize on load
623
+ window.addEventListener('load', init);
624
+
625
+ // Handle window resize for canvases
626
+ window.addEventListener('resize', function() {
627
+ initializeCanvases();
628
+ });
prompt-engineering-guide/index.html ADDED
@@ -0,0 +1,1661 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Prompt Engineering Masterclass</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
16
+ background-color: #121212;
17
+ color: #FFFFFF;
18
+ line-height: 1.6;
19
+ overflow-x: hidden;
20
+ }
21
+
22
+ .app-container {
23
+ display: flex;
24
+ min-height: 100vh;
25
+ }
26
+
27
+ /* Sidebar */
28
+ .sidebar {
29
+ width: 280px;
30
+ background: #1a1a1a;
31
+ border-right: 1px solid #333;
32
+ position: fixed;
33
+ height: 100vh;
34
+ overflow-y: auto;
35
+ padding: 20px;
36
+ z-index: 100;
37
+ }
38
+
39
+ .sidebar-header {
40
+ margin-bottom: 30px;
41
+ }
42
+
43
+ .sidebar-header h1 {
44
+ font-size: 20px;
45
+ color: #0066FF;
46
+ margin-bottom: 5px;
47
+ }
48
+
49
+ .sidebar-header p {
50
+ font-size: 12px;
51
+ color: #888;
52
+ }
53
+
54
+ .progress-bar {
55
+ width: 100%;
56
+ height: 4px;
57
+ background: #333;
58
+ border-radius: 2px;
59
+ margin: 15px 0;
60
+ overflow: hidden;
61
+ }
62
+
63
+ .progress-fill {
64
+ height: 100%;
65
+ background: linear-gradient(90deg, #0066FF, #00D9FF);
66
+ width: 0%;
67
+ transition: width 0.5s ease;
68
+ }
69
+
70
+ .topic-list {
71
+ list-style: none;
72
+ }
73
+
74
+ .topic-item {
75
+ padding: 12px 15px;
76
+ margin-bottom: 8px;
77
+ background: #222;
78
+ border-radius: 8px;
79
+ cursor: pointer;
80
+ transition: all 0.3s ease;
81
+ border-left: 3px solid transparent;
82
+ }
83
+
84
+ .topic-item:hover {
85
+ background: #2a2a2a;
86
+ border-left-color: #0066FF;
87
+ }
88
+
89
+ .topic-item.active {
90
+ background: #0066FF22;
91
+ border-left-color: #0066FF;
92
+ }
93
+
94
+ .topic-item h3 {
95
+ font-size: 14px;
96
+ margin-bottom: 3px;
97
+ color: #fff;
98
+ }
99
+
100
+ .topic-item p {
101
+ font-size: 11px;
102
+ color: #888;
103
+ }
104
+
105
+ /* Main Content */
106
+ .main-content {
107
+ flex: 1;
108
+ margin-left: 280px;
109
+ padding: 40px;
110
+ max-width: 1200px;
111
+ }
112
+
113
+ .content-section {
114
+ display: none;
115
+ animation: fadeIn 0.5s ease;
116
+ }
117
+
118
+ .content-section.active {
119
+ display: block;
120
+ }
121
+
122
+ @keyframes fadeIn {
123
+ from { opacity: 0; transform: translateY(20px); }
124
+ to { opacity: 1; transform: translateY(0); }
125
+ }
126
+
127
+ .section-header {
128
+ margin-bottom: 30px;
129
+ }
130
+
131
+ .section-header h2 {
132
+ font-size: 36px;
133
+ color: #00D9FF;
134
+ margin-bottom: 8px;
135
+ }
136
+
137
+ .section-header .subtitle {
138
+ font-size: 18px;
139
+ color: #888;
140
+ margin-bottom: 15px;
141
+ }
142
+
143
+ .section-header .description {
144
+ font-size: 16px;
145
+ color: #ccc;
146
+ line-height: 1.8;
147
+ }
148
+
149
+ /* Cards */
150
+ .card {
151
+ background: #1a1a1a;
152
+ border: 1px solid #333;
153
+ border-radius: 12px;
154
+ padding: 25px;
155
+ margin-bottom: 25px;
156
+ transition: all 0.3s ease;
157
+ }
158
+
159
+ .card:hover {
160
+ border-color: #0066FF;
161
+ box-shadow: 0 4px 20px rgba(0, 102, 255, 0.1);
162
+ }
163
+
164
+ .card h3 {
165
+ font-size: 20px;
166
+ color: #00D9FF;
167
+ margin-bottom: 15px;
168
+ }
169
+
170
+ .card p {
171
+ font-size: 15px;
172
+ color: #ccc;
173
+ line-height: 1.8;
174
+ }
175
+
176
+ /* Callout Boxes */
177
+ .callout {
178
+ padding: 18px 20px;
179
+ border-radius: 8px;
180
+ margin: 15px 0;
181
+ border-left: 4px solid;
182
+ font-size: 14px;
183
+ line-height: 1.6;
184
+ }
185
+
186
+ .callout-insight {
187
+ background: rgba(0, 217, 255, 0.1);
188
+ border-color: #00D9FF;
189
+ color: #00D9FF;
190
+ }
191
+
192
+ .callout-mistake {
193
+ background: rgba(255, 107, 53, 0.1);
194
+ border-color: #FF6B35;
195
+ color: #FF6B35;
196
+ }
197
+
198
+ .callout-tip {
199
+ background: rgba(0, 255, 136, 0.1);
200
+ border-color: #00FF88;
201
+ color: #00FF88;
202
+ }
203
+
204
+ .callout strong {
205
+ margin-right: 8px;
206
+ }
207
+
208
+ /* Interactive Elements */
209
+ .interactive-demo {
210
+ background: #0a0a0a;
211
+ border: 2px solid #333;
212
+ border-radius: 12px;
213
+ padding: 30px;
214
+ margin: 25px 0;
215
+ }
216
+
217
+ .prompt-builder {
218
+ display: grid;
219
+ grid-template-columns: 1fr 1fr;
220
+ gap: 20px;
221
+ margin-top: 20px;
222
+ }
223
+
224
+ .prompt-component {
225
+ background: #1a1a1a;
226
+ padding: 15px;
227
+ border-radius: 8px;
228
+ border: 2px dashed #444;
229
+ }
230
+
231
+ .prompt-component h4 {
232
+ color: #0066FF;
233
+ font-size: 14px;
234
+ margin-bottom: 10px;
235
+ }
236
+
237
+ .prompt-component textarea {
238
+ width: 100%;
239
+ background: #222;
240
+ border: 1px solid #444;
241
+ color: #fff;
242
+ padding: 10px;
243
+ border-radius: 6px;
244
+ font-size: 14px;
245
+ font-family: inherit;
246
+ resize: vertical;
247
+ min-height: 80px;
248
+ }
249
+
250
+ .prompt-component textarea:focus {
251
+ outline: none;
252
+ border-color: #0066FF;
253
+ }
254
+
255
+ .output-preview {
256
+ grid-column: 1 / -1;
257
+ background: #1a1a1a;
258
+ padding: 20px;
259
+ border-radius: 8px;
260
+ border: 2px solid #0066FF;
261
+ }
262
+
263
+ .quality-grade {
264
+ display: inline-block;
265
+ padding: 8px 16px;
266
+ border-radius: 20px;
267
+ font-weight: 600;
268
+ font-size: 14px;
269
+ margin-bottom: 15px;
270
+ }
271
+
272
+ .grade-poor { background: #FF6B35; color: #000; }
273
+ .grade-good { background: #FFB800; color: #000; }
274
+ .grade-excellent { background: #00FF88; color: #000; }
275
+
276
+ /* Canvas */
277
+ .canvas-container {
278
+ position: relative;
279
+ width: 100%;
280
+ height: 400px;
281
+ background: #0a0a0a;
282
+ border: 2px solid #333;
283
+ border-radius: 12px;
284
+ margin: 25px 0;
285
+ overflow: hidden;
286
+ }
287
+
288
+ canvas {
289
+ display: block;
290
+ width: 100%;
291
+ height: 100%;
292
+ }
293
+
294
+ /* Buttons */
295
+ .btn {
296
+ padding: 12px 24px;
297
+ border: none;
298
+ border-radius: 8px;
299
+ font-size: 14px;
300
+ font-weight: 600;
301
+ cursor: pointer;
302
+ transition: all 0.3s ease;
303
+ display: inline-block;
304
+ text-decoration: none;
305
+ }
306
+
307
+ .btn-primary {
308
+ background: #0066FF;
309
+ color: #fff;
310
+ }
311
+
312
+ .btn-primary:hover {
313
+ background: #0052CC;
314
+ transform: translateY(-2px);
315
+ box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
316
+ }
317
+
318
+ .btn-secondary {
319
+ background: #333;
320
+ color: #fff;
321
+ }
322
+
323
+ .btn-secondary:hover {
324
+ background: #444;
325
+ }
326
+
327
+ .btn-group {
328
+ display: flex;
329
+ gap: 10px;
330
+ margin: 20px 0;
331
+ flex-wrap: wrap;
332
+ }
333
+
334
+ /* Slider */
335
+ .slider-control {
336
+ margin: 25px 0;
337
+ }
338
+
339
+ .slider-control label {
340
+ display: block;
341
+ color: #00D9FF;
342
+ font-size: 14px;
343
+ font-weight: 600;
344
+ margin-bottom: 10px;
345
+ }
346
+
347
+ .slider {
348
+ width: 100%;
349
+ height: 6px;
350
+ border-radius: 3px;
351
+ background: #333;
352
+ outline: none;
353
+ -webkit-appearance: none;
354
+ }
355
+
356
+ .slider::-webkit-slider-thumb {
357
+ -webkit-appearance: none;
358
+ appearance: none;
359
+ width: 20px;
360
+ height: 20px;
361
+ border-radius: 50%;
362
+ background: #0066FF;
363
+ cursor: pointer;
364
+ transition: all 0.3s ease;
365
+ }
366
+
367
+ .slider::-webkit-slider-thumb:hover {
368
+ background: #00D9FF;
369
+ transform: scale(1.2);
370
+ }
371
+
372
+ .slider::-moz-range-thumb {
373
+ width: 20px;
374
+ height: 20px;
375
+ border-radius: 50%;
376
+ background: #0066FF;
377
+ cursor: pointer;
378
+ border: none;
379
+ }
380
+
381
+ .slider-value {
382
+ display: inline-block;
383
+ margin-left: 15px;
384
+ color: #fff;
385
+ font-weight: 600;
386
+ }
387
+
388
+ /* Comparison */
389
+ .comparison {
390
+ display: grid;
391
+ grid-template-columns: 1fr 1fr;
392
+ gap: 20px;
393
+ margin: 25px 0;
394
+ }
395
+
396
+ .comparison-item {
397
+ background: #1a1a1a;
398
+ padding: 20px;
399
+ border-radius: 8px;
400
+ border: 2px solid #333;
401
+ }
402
+
403
+ .comparison-item.bad {
404
+ border-color: #FF6B35;
405
+ }
406
+
407
+ .comparison-item.good {
408
+ border-color: #00FF88;
409
+ }
410
+
411
+ .comparison-item h4 {
412
+ margin-bottom: 12px;
413
+ font-size: 16px;
414
+ }
415
+
416
+ .comparison-item.bad h4 {
417
+ color: #FF6B35;
418
+ }
419
+
420
+ .comparison-item.good h4 {
421
+ color: #00FF88;
422
+ }
423
+
424
+ /* Navigation */
425
+ .nav-buttons {
426
+ display: flex;
427
+ justify-content: space-between;
428
+ margin-top: 40px;
429
+ padding-top: 30px;
430
+ border-top: 1px solid #333;
431
+ }
432
+
433
+ /* Component Grid */
434
+ .component-grid {
435
+ display: grid;
436
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
437
+ gap: 20px;
438
+ margin: 25px 0;
439
+ }
440
+
441
+ .component-card {
442
+ background: #1a1a1a;
443
+ padding: 20px;
444
+ border-radius: 8px;
445
+ border: 2px solid #333;
446
+ transition: all 0.3s ease;
447
+ }
448
+
449
+ .component-card:hover {
450
+ border-color: #0066FF;
451
+ transform: translateY(-4px);
452
+ }
453
+
454
+ .component-card h4 {
455
+ color: #0066FF;
456
+ font-size: 16px;
457
+ margin-bottom: 10px;
458
+ }
459
+
460
+ .component-card p {
461
+ font-size: 14px;
462
+ color: #ccc;
463
+ margin-bottom: 12px;
464
+ }
465
+
466
+ .component-card code {
467
+ display: block;
468
+ background: #0a0a0a;
469
+ padding: 10px;
470
+ border-radius: 4px;
471
+ font-size: 13px;
472
+ color: #00D9FF;
473
+ font-family: 'Courier New', monospace;
474
+ }
475
+
476
+ /* Steps */
477
+ .steps {
478
+ margin: 25px 0;
479
+ }
480
+
481
+ .step {
482
+ display: flex;
483
+ gap: 20px;
484
+ margin-bottom: 25px;
485
+ padding: 20px;
486
+ background: #1a1a1a;
487
+ border-radius: 8px;
488
+ border-left: 4px solid #0066FF;
489
+ }
490
+
491
+ .step-number {
492
+ flex-shrink: 0;
493
+ width: 40px;
494
+ height: 40px;
495
+ background: #0066FF;
496
+ color: #fff;
497
+ border-radius: 50%;
498
+ display: flex;
499
+ align-items: center;
500
+ justify-content: center;
501
+ font-weight: 700;
502
+ font-size: 18px;
503
+ }
504
+
505
+ .step-content h4 {
506
+ color: #00D9FF;
507
+ font-size: 16px;
508
+ margin-bottom: 8px;
509
+ }
510
+
511
+ .step-content p {
512
+ font-size: 14px;
513
+ color: #ccc;
514
+ }
515
+
516
+ /* Use Cases */
517
+ .use-case-section {
518
+ margin: 30px 0;
519
+ }
520
+
521
+ .use-case-section h4 {
522
+ color: #0066FF;
523
+ font-size: 18px;
524
+ margin-bottom: 15px;
525
+ }
526
+
527
+ .use-case-list {
528
+ list-style: none;
529
+ padding-left: 0;
530
+ }
531
+
532
+ .use-case-list li {
533
+ padding: 12px 15px;
534
+ background: #1a1a1a;
535
+ border-left: 3px solid #00D9FF;
536
+ margin-bottom: 10px;
537
+ border-radius: 4px;
538
+ font-size: 14px;
539
+ }
540
+
541
+ /* Checklist */
542
+ .checklist {
543
+ list-style: none;
544
+ margin: 20px 0;
545
+ }
546
+
547
+ .checklist li {
548
+ padding: 12px;
549
+ margin-bottom: 8px;
550
+ background: #1a1a1a;
551
+ border-radius: 6px;
552
+ font-size: 14px;
553
+ cursor: pointer;
554
+ transition: all 0.3s ease;
555
+ display: flex;
556
+ align-items: center;
557
+ gap: 12px;
558
+ }
559
+
560
+ .checklist li:hover {
561
+ background: #222;
562
+ }
563
+
564
+ .checklist li::before {
565
+ content: '☐';
566
+ font-size: 20px;
567
+ color: #666;
568
+ }
569
+
570
+ .checklist li.checked::before {
571
+ content: 'βœ“';
572
+ color: #00FF88;
573
+ }
574
+
575
+ .checklist li.checked {
576
+ opacity: 0.6;
577
+ text-decoration: line-through;
578
+ }
579
+
580
+ /* Responsive */
581
+ @media (max-width: 768px) {
582
+ .sidebar {
583
+ width: 100%;
584
+ position: relative;
585
+ height: auto;
586
+ border-right: none;
587
+ border-bottom: 1px solid #333;
588
+ }
589
+
590
+ .main-content {
591
+ margin-left: 0;
592
+ padding: 20px;
593
+ }
594
+
595
+ .prompt-builder,
596
+ .comparison,
597
+ .component-grid {
598
+ grid-template-columns: 1fr;
599
+ }
600
+
601
+ .section-header h2 {
602
+ font-size: 28px;
603
+ }
604
+ }
605
+
606
+ /* Template Library */
607
+ .template-library {
608
+ display: grid;
609
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
610
+ gap: 15px;
611
+ margin: 25px 0;
612
+ }
613
+
614
+ .template-item {
615
+ background: #1a1a1a;
616
+ padding: 18px;
617
+ border-radius: 8px;
618
+ border: 2px solid #333;
619
+ cursor: pointer;
620
+ transition: all 0.3s ease;
621
+ }
622
+
623
+ .template-item:hover {
624
+ border-color: #0066FF;
625
+ background: #222;
626
+ }
627
+
628
+ .template-item h5 {
629
+ color: #00D9FF;
630
+ font-size: 15px;
631
+ margin-bottom: 10px;
632
+ }
633
+
634
+ .template-item pre {
635
+ background: #0a0a0a;
636
+ padding: 12px;
637
+ border-radius: 4px;
638
+ font-size: 12px;
639
+ color: #ccc;
640
+ overflow-x: auto;
641
+ white-space: pre-wrap;
642
+ }
643
+
644
+ /* Practice Challenge */
645
+ .challenge-box {
646
+ background: linear-gradient(135deg, #0066FF22, #00D9FF22);
647
+ border: 2px solid #0066FF;
648
+ border-radius: 12px;
649
+ padding: 30px;
650
+ margin: 30px 0;
651
+ }
652
+
653
+ .challenge-box h3 {
654
+ color: #00D9FF;
655
+ margin-bottom: 15px;
656
+ }
657
+
658
+ .challenge-prompt {
659
+ background: #0a0a0a;
660
+ padding: 20px;
661
+ border-radius: 8px;
662
+ margin: 15px 0;
663
+ font-size: 14px;
664
+ color: #ccc;
665
+ }
666
+
667
+ .feedback {
668
+ background: #1a1a1a;
669
+ padding: 15px;
670
+ border-radius: 8px;
671
+ margin-top: 15px;
672
+ display: none;
673
+ }
674
+
675
+ .feedback.show {
676
+ display: block;
677
+ animation: slideDown 0.3s ease;
678
+ }
679
+
680
+ @keyframes slideDown {
681
+ from { opacity: 0; transform: translateY(-10px); }
682
+ to { opacity: 1; transform: translateY(0); }
683
+ }
684
+
685
+ /* Scenario Selector */
686
+ .scenario-selector {
687
+ display: flex;
688
+ gap: 12px;
689
+ margin: 20px 0;
690
+ flex-wrap: wrap;
691
+ }
692
+
693
+ .scenario-btn {
694
+ padding: 10px 18px;
695
+ background: #1a1a1a;
696
+ border: 2px solid #333;
697
+ border-radius: 8px;
698
+ color: #fff;
699
+ cursor: pointer;
700
+ transition: all 0.3s ease;
701
+ font-size: 14px;
702
+ }
703
+
704
+ .scenario-btn:hover {
705
+ border-color: #0066FF;
706
+ background: #222;
707
+ }
708
+
709
+ .scenario-btn.active {
710
+ border-color: #0066FF;
711
+ background: #0066FF22;
712
+ color: #00D9FF;
713
+ }
714
+
715
+ .hidden {
716
+ display: none;
717
+ }
718
+ </style>
719
+ </head>
720
+ <body>
721
+ <div class="app-container">
722
+ <!-- Sidebar -->
723
+ <aside class="sidebar">
724
+ <div class="sidebar-header">
725
+ <h1>Prompt Engineering</h1>
726
+ <p>Master the Art of AI Communication</p>
727
+ <div class="progress-bar">
728
+ <div class="progress-fill" id="progressBar"></div>
729
+ </div>
730
+ </div>
731
+ <ul class="topic-list" id="topicList"></ul>
732
+ </aside>
733
+
734
+ <!-- Main Content -->
735
+ <main class="main-content">
736
+ <!-- Topic 1: Introduction -->
737
+ <section class="content-section active" id="topic-1">
738
+ <div class="section-header">
739
+ <h2>Introduction to Prompt Engineering</h2>
740
+ <p class="subtitle">What Is It and Why Does It Matter?</p>
741
+ <p class="description">Learn the fundamentals of prompt engineering and why it's crucial in the AI era</p>
742
+ </div>
743
+
744
+ <div class="card">
745
+ <h3>What is Prompt Engineering?</h3>
746
+ <p>Prompt engineering is the art of writing clear, specific instructions for AI models to produce desired outputs. Think of it as learning to communicate effectively with an intelligent assistant.</p>
747
+ <p>Just like how you'd give detailed instructions to a colleague for important work, prompt engineering teaches you to craft precise, contextual requests that help AI understand exactly what you need.</p>
748
+ </div>
749
+
750
+ <div class="callout callout-insight">
751
+ <strong>πŸ’‘ Insight:</strong> The difference between a vague and specific prompt can be 10x in output quality
752
+ </div>
753
+
754
+ <div class="card">
755
+ <h3>Real-World Analogy</h3>
756
+ <p><strong>Ordering Food:</strong></p>
757
+ <div class="comparison">
758
+ <div class="comparison-item bad">
759
+ <h4>❌ Vague Order</h4>
760
+ <p>"Give me something to eat."</p>
761
+ <p style="margin-top: 10px; font-size: 13px; color: #888;">Result: You might get anything - could be great, could be terrible, probably not what you wanted.</p>
762
+ </div>
763
+ <div class="comparison-item good">
764
+ <h4>βœ“ Detailed Order</h4>
765
+ <p>"I'd like a medium pepperoni pizza with thin crust, extra cheese, and light sauce. Please deliver it to 123 Main St by 7 PM."</p>
766
+ <p style="margin-top: 10px; font-size: 13px; color: #888;">Result: You get exactly what you wanted, when you wanted it.</p>
767
+ </div>
768
+ </div>
769
+ </div>
770
+
771
+ <div class="callout callout-tip">
772
+ <strong>βœ… Tip:</strong> AI models don't read mindsβ€”be explicit about what you want
773
+ </div>
774
+
775
+ <div class="card">
776
+ <h3>Why Does It Matter?</h3>
777
+ <p>In today's AI-powered world, the ability to communicate effectively with AI systems is becoming as important as traditional communication skills. Good prompt engineering helps you:</p>
778
+ <ul style="margin-left: 20px; margin-top: 10px; color: #ccc;">
779
+ <li style="margin-bottom: 8px;">Save time by getting better results on the first try</li>
780
+ <li style="margin-bottom: 8px;">Unlock advanced AI capabilities for complex tasks</li>
781
+ <li style="margin-bottom: 8px;">Reduce errors and misunderstandings</li>
782
+ <li style="margin-bottom: 8px;">Boost productivity across all domains</li>
783
+ </ul>
784
+ </div>
785
+
786
+ <div class="card">
787
+ <h3>Key Applications</h3>
788
+ <div class="use-case-section">
789
+ <ul class="use-case-list">
790
+ <li>πŸ“§ Email writing and summarization</li>
791
+ <li>πŸ“Š Report generation and data analysis</li>
792
+ <li>πŸ’» Code generation and debugging</li>
793
+ <li>✍️ Creative writing and content creation</li>
794
+ <li>πŸŽ“ Educational content and explanations</li>
795
+ </ul>
796
+ </div>
797
+ </div>
798
+
799
+ <div class="callout callout-mistake">
800
+ <strong>⚠️ Common Mistake:</strong> Assuming AI knows what you want without explicit instructions
801
+ </div>
802
+
803
+ <div class="card">
804
+ <h3>Summary &amp; Key Takeaways</h3>
805
+ <ul class="checklist">
806
+ <li>Prompt engineering is about clear AI communication</li>
807
+ <li>Specificity dramatically improves output quality</li>
808
+ <li>It's a learnable skill that improves with practice</li>
809
+ <li>Applications span professional, technical, and creative domains</li>
810
+ </ul>
811
+ <div class="btn-group" style="margin-top: 20px;">
812
+ <button class="btn btn-primary" onclick="startPractice(1)">Try Practice Challenge</button>
813
+ </div>
814
+ </div>
815
+
816
+ <div class="nav-buttons">
817
+ <button class="btn btn-secondary" disabled>← Previous</button>
818
+ <button class="btn btn-primary" onclick="navigateTo(2)">Next: Prompt Structure β†’</button>
819
+ </div>
820
+ </section>
821
+
822
+ <!-- Topic 2: Prompt Structure -->
823
+ <section class="content-section" id="topic-2">
824
+ <div class="section-header">
825
+ <h2>Prompt Structure: The Building Blocks</h2>
826
+ <p class="subtitle">Role, Context, Task, and Format</p>
827
+ <p class="description">Master the four key components of effective prompts</p>
828
+ </div>
829
+
830
+ <div class="card">
831
+ <h3>The Four Components</h3>
832
+ <p>Every effective prompt has four essential building blocks. Understanding and using these components will transform your AI interactions.</p>
833
+ </div>
834
+
835
+ <div class="component-grid">
836
+ <div class="component-card">
837
+ <h4>1. Role</h4>
838
+ <p>What persona should the AI adopt?</p>
839
+ <code>"You are an expert marketing consultant"</code>
840
+ </div>
841
+ <div class="component-card">
842
+ <h4>2. Context</h4>
843
+ <p>What background information is important?</p>
844
+ <code>"We just launched a new coffee shop in Manhattan"</code>
845
+ </div>
846
+ <div class="component-card">
847
+ <h4>3. Task</h4>
848
+ <p>What exactly should the AI do?</p>
849
+ <code>"Generate 5 creative marketing strategies"</code>
850
+ </div>
851
+ <div class="component-card">
852
+ <h4>4. Format</h4>
853
+ <p>How should the output be structured?</p>
854
+ <code>"Provide as bullet points with pros and cons"</code>
855
+ </div>
856
+ </div>
857
+
858
+ <div class="callout callout-insight">
859
+ <strong>πŸ’‘ Insight:</strong> Context is kingβ€”more information usually means better output
860
+ </div>
861
+
862
+ <div class="interactive-demo">
863
+ <h3 style="color: #00D9FF; margin-bottom: 20px;">Interactive Prompt Builder</h3>
864
+ <p style="color: #888; margin-bottom: 15px;">Fill in each component and watch the quality grade update in real-time:</p>
865
+
866
+ <div class="prompt-builder">
867
+ <div class="prompt-component">
868
+ <h4>Role</h4>
869
+ <textarea id="roleInput" placeholder="e.g., You are a senior software engineer..." oninput="updatePromptQuality()"></textarea>
870
+ </div>
871
+ <div class="prompt-component">
872
+ <h4>Context</h4>
873
+ <textarea id="contextInput" placeholder="e.g., Working on a mobile app for..." oninput="updatePromptQuality()"></textarea>
874
+ </div>
875
+ <div class="prompt-component">
876
+ <h4>Task</h4>
877
+ <textarea id="taskInput" placeholder="e.g., Write a function that..." oninput="updatePromptQuality()"></textarea>
878
+ </div>
879
+ <div class="prompt-component">
880
+ <h4>Format</h4>
881
+ <textarea id="formatInput" placeholder="e.g., Provide code with comments..." oninput="updatePromptQuality()"></textarea>
882
+ </div>
883
+ <div class="output-preview">
884
+ <span class="quality-grade grade-poor" id="qualityGrade">Quality: Poor</span>
885
+ <h4 style="color: #00D9FF; margin-bottom: 10px;">Combined Prompt:</h4>
886
+ <p id="combinedPrompt" style="color: #ccc; font-size: 14px;">Start filling in the components above...</p>
887
+ </div>
888
+ </div>
889
+ </div>
890
+
891
+ <div class="callout callout-tip">
892
+ <strong>βœ… Tip:</strong> Start with clear action verbs: Write, Analyze, Explain, Generate, Debug
893
+ </div>
894
+
895
+ <div class="canvas-container">
896
+ <canvas id="structureCanvas"></canvas>
897
+ </div>
898
+
899
+ <div class="card">
900
+ <h3>Summary &amp; Key Takeaways</h3>
901
+ <ul class="checklist">
902
+ <li>All four components work together for best results</li>
903
+ <li>Role sets the AI's perspective and expertise level</li>
904
+ <li>Context provides necessary background information</li>
905
+ <li>Task defines the specific action you want</li>
906
+ <li>Format ensures output matches your needs</li>
907
+ </ul>
908
+ </div>
909
+
910
+ <div class="nav-buttons">
911
+ <button class="btn btn-secondary" onclick="navigateTo(1)">← Previous</button>
912
+ <button class="btn btn-primary" onclick="navigateTo(3)">Next: Clarity &amp; Specificity β†’</button>
913
+ </div>
914
+ </section>
915
+
916
+ <!-- Topic 3: Clarity and Specificity -->
917
+ <section class="content-section" id="topic-3">
918
+ <div class="section-header">
919
+ <h2>Clarity and Specificity</h2>
920
+ <p class="subtitle">Writing Precise Prompts</p>
921
+ <p class="description">Learn how to eliminate ambiguity and get better results</p>
922
+ </div>
923
+
924
+ <div class="card">
925
+ <h3>Why Specificity Matters</h3>
926
+ <p>Vague prompts leave too much room for interpretation. The AI has to guess what you want, and guesses are rarely perfect. Specific prompts eliminate ambiguity and guide the AI to produce exactly what you need.</p>
927
+ </div>
928
+
929
+ <div class="callout callout-insight">
930
+ <strong>πŸ’‘ Insight:</strong> Testing and iteration is key to prompt mastery
931
+ </div>
932
+
933
+ <div class="card">
934
+ <h3>Before &amp; After Examples</h3>
935
+ <div class="comparison" style="margin-top: 20px;">
936
+ <div class="comparison-item bad">
937
+ <h4>❌ Vague Prompt</h4>
938
+ <p style="font-family: monospace; font-size: 13px;">"Write something about AI"</p>
939
+ </div>
940
+ <div class="comparison-item good">
941
+ <h4>βœ“ Specific Prompt</h4>
942
+ <p style="font-family: monospace; font-size: 13px;">"Write a 200-word beginner's guide explaining how machine learning works, using a coffee shop analogy"</p>
943
+ </div>
944
+ </div>
945
+
946
+ <div class="comparison" style="margin-top: 20px;">
947
+ <div class="comparison-item bad">
948
+ <h4>❌ Vague Prompt</h4>
949
+ <p style="font-family: monospace; font-size: 13px;">"Fix my code"</p>
950
+ </div>
951
+ <div class="comparison-item good">
952
+ <h4>βœ“ Specific Prompt</h4>
953
+ <p style="font-family: monospace; font-size: 13px;">"I have a Python function that calculates factorial but it returns wrong results for numbers &gt; 10. Here's the code: [code]. What's the bug and how do I fix it?"</p>
954
+ </div>
955
+ </div>
956
+ </div>
957
+
958
+ <div class="callout callout-mistake">
959
+ <strong>⚠️ Common Mistake:</strong> Not specifying output format, then being surprised by format
960
+ </div>
961
+
962
+ <div class="interactive-demo">
963
+ <h3 style="color: #00D9FF; margin-bottom: 20px;">Specificity Slider</h3>
964
+ <p style="color: #888; margin-bottom: 15px;">Adjust the specificity level and see how the prompt improves:</p>
965
+
966
+ <div class="slider-control">
967
+ <label>Specificity Level: <span class="slider-value" id="specificityValue">1</span>/5</label>
968
+ <input type="range" min="1" max="5" value="1" class="slider" id="specificitySlider" oninput="updateSpecificity()">
969
+ </div>
970
+
971
+ <div style="margin-top: 25px; background: #1a1a1a; padding: 20px; border-radius: 8px;">
972
+ <h4 style="color: #00D9FF; margin-bottom: 12px;">Current Prompt:</h4>
973
+ <p id="specificityPrompt" style="color: #ccc; font-size: 14px; line-height: 1.8;"></p>
974
+ <div style="margin-top: 15px; padding: 12px; background: #0a0a0a; border-radius: 6px;">
975
+ <strong style="color: #00D9FF;">Expected Quality:</strong>
976
+ <span id="specificityQuality" style="margin-left: 10px;"></span>
977
+ </div>
978
+ </div>
979
+ </div>
980
+
981
+ <div class="callout callout-tip">
982
+ <strong>βœ… Tip:</strong> Use phrases like 'For a 10th-grade student' to guide tone and complexity
983
+ </div>
984
+
985
+ <div class="card">
986
+ <h3>Key Elements of Specific Prompts</h3>
987
+ <div class="steps">
988
+ <div class="step">
989
+ <div class="step-number">1</div>
990
+ <div class="step-content">
991
+ <h4>Define Clear Objectives</h4>
992
+ <p>State exactly what you want to achieve</p>
993
+ </div>
994
+ </div>
995
+ <div class="step">
996
+ <div class="step-number">2</div>
997
+ <div class="step-content">
998
+ <h4>Set Constraints</h4>
999
+ <p>Specify length, style, tone, or other limitations</p>
1000
+ </div>
1001
+ </div>
1002
+ <div class="step">
1003
+ <div class="step-number">3</div>
1004
+ <div class="step-content">
1005
+ <h4>Provide Examples</h4>
1006
+ <p>Show the AI what good output looks like</p>
1007
+ </div>
1008
+ </div>
1009
+ <div class="step">
1010
+ <div class="step-number">4</div>
1011
+ <div class="step-content">
1012
+ <h4>Specify Audience</h4>
1013
+ <p>Indicate who will consume the output</p>
1014
+ </div>
1015
+ </div>
1016
+ </div>
1017
+ </div>
1018
+
1019
+ <div class="card">
1020
+ <h3>Summary &amp; Key Takeaways</h3>
1021
+ <ul class="checklist">
1022
+ <li>Vague prompts lead to unpredictable results</li>
1023
+ <li>Add specific details: length, format, style, audience</li>
1024
+ <li>Include examples when possible</li>
1025
+ <li>Set clear constraints and boundaries</li>
1026
+ <li>Think about edge cases and clarify them</li>
1027
+ </ul>
1028
+ </div>
1029
+
1030
+ <div class="nav-buttons">
1031
+ <button class="btn btn-secondary" onclick="navigateTo(2)">← Previous</button>
1032
+ <button class="btn btn-primary" onclick="navigateTo(4)">Next: Context &amp; Background β†’</button>
1033
+ </div>
1034
+ </section>
1035
+
1036
+ <!-- Topic 4: Context and Background -->
1037
+ <section class="content-section" id="topic-4">
1038
+ <div class="section-header">
1039
+ <h2>Context and Background</h2>
1040
+ <p class="subtitle">Providing Enough Information</p>
1041
+ <p class="description">Give AI the full picture for better outputs</p>
1042
+ </div>
1043
+
1044
+ <div class="card">
1045
+ <h3>Why Context Matters</h3>
1046
+ <p>Context is the background information that helps AI understand the bigger picture. Without proper context, even the most specific task instructions can lead to irrelevant results.</p>
1047
+ <p style="margin-top: 15px;">Think of context as the frame around a paintingβ€”it helps define boundaries and provides essential information for interpretation.</p>
1048
+ </div>
1049
+
1050
+ <div class="callout callout-insight">
1051
+ <strong>πŸ’‘ Insight:</strong> Format specification prevents surprises in AI responses
1052
+ </div>
1053
+
1054
+ <div class="card">
1055
+ <h3>Essential Context Elements</h3>
1056
+ <div class="component-grid">
1057
+ <div class="component-card">
1058
+ <h4>πŸ“„ Relevant Documents</h4>
1059
+ <p>Include or reference important files, data, or prior conversations</p>
1060
+ </div>
1061
+ <div class="component-card">
1062
+ <h4>🎯 Target Audience</h4>
1063
+ <p>Specify who will use or read the output</p>
1064
+ </div>
1065
+ <div class="component-card">
1066
+ <h4>βš™οΈ Constraints</h4>
1067
+ <p>Mention technical, budget, or time limitations</p>
1068
+ </div>
1069
+ <div class="component-card">
1070
+ <h4>🎨 Brand Voice</h4>
1071
+ <p>Describe tone, style, or brand guidelines</p>
1072
+ </div>
1073
+ </div>
1074
+ </div>
1075
+
1076
+ <div class="callout callout-tip">
1077
+ <strong>βœ… Tip:</strong> Include examples of good output in your prompt
1078
+ </div>
1079
+
1080
+ <div class="card">
1081
+ <h3>Context Levels Comparison</h3>
1082
+ <div class="interactive-demo">
1083
+ <div class="scenario-selector">
1084
+ <button class="scenario-btn active" onclick="showContextExample('minimal')">Minimal Context</button>
1085
+ <button class="scenario-btn" onclick="showContextExample('moderate')">Moderate Context</button>
1086
+ <button class="scenario-btn" onclick="showContextExample('rich')">Rich Context</button>
1087
+ </div>
1088
+
1089
+ <div id="contextExample" style="margin-top: 20px; background: #1a1a1a; padding: 20px; border-radius: 8px;">
1090
+ <h4 style="color: #00D9FF; margin-bottom: 12px;">Prompt Example:</h4>
1091
+ <p id="contextPromptText" style="color: #ccc; line-height: 1.8;"></p>
1092
+ <div style="margin-top: 15px; padding: 12px; background: #0a0a0a; border-radius: 6px;">
1093
+ <strong style="color: #00D9FF;">Output Quality:</strong>
1094
+ <span id="contextQuality" style="margin-left: 10px;"></span>
1095
+ </div>
1096
+ </div>
1097
+ </div>
1098
+ </div>
1099
+
1100
+ <div class="callout callout-mistake">
1101
+ <strong>⚠️ Common Mistake:</strong> Providing too little context about your problem
1102
+ </div>
1103
+
1104
+ <div class="card">
1105
+ <h3>Best Practices for Context</h3>
1106
+ <ul style="margin-left: 20px; margin-top: 15px; color: #ccc;">
1107
+ <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Be comprehensive but focused:</strong> Include all relevant information without overwhelming details</li>
1108
+ <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Front-load important context:</strong> Put crucial information at the beginning</li>
1109
+ <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Use examples:</strong> Show the AI what success looks like</li>
1110
+ <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Mention constraints:</strong> Be upfront about limitations</li>
1111
+ <li style="margin-bottom: 12px;"><strong style="color: #00D9FF;">Define your audience:</strong> Specify who will consume the output</li>
1112
+ </ul>
1113
+ </div>
1114
+
1115
+ <div class="canvas-container">
1116
+ <canvas id="contextCanvas"></canvas>
1117
+ </div>
1118
+
1119
+ <div class="card">
1120
+ <h3>Summary &amp; Key Takeaways</h3>
1121
+ <ul class="checklist">
1122
+ <li>Context provides the frame for AI to understand your request</li>
1123
+ <li>Include relevant documents and background information</li>
1124
+ <li>Specify target audience and use cases</li>
1125
+ <li>Mention constraints and limitations upfront</li>
1126
+ <li>Provide examples of desired output when possible</li>
1127
+ </ul>
1128
+ </div>
1129
+
1130
+ <div class="nav-buttons">
1131
+ <button class="btn btn-secondary" onclick="navigateTo(3)">← Previous</button>
1132
+ <button class="btn btn-primary" onclick="navigateTo(5)">Next: Output Format β†’</button>
1133
+ </div>
1134
+ </section>
1135
+
1136
+ <!-- Topic 5: Output Format -->
1137
+ <section class="content-section" id="topic-5">
1138
+ <div class="section-header">
1139
+ <h2>Output Format and Constraints</h2>
1140
+ <p class="subtitle">Specifying Desired Output</p>
1141
+ <p class="description">Control exactly how the AI structures its response</p>
1142
+ </div>
1143
+
1144
+ <div class="card">
1145
+ <h3>Why Format Matters</h3>
1146
+ <p>Specifying the output format ensures you get results in a structure that's immediately useful. Without format guidance, AI might provide information in a way that requires significant reformatting.</p>
1147
+ </div>
1148
+
1149
+ <div class="callout callout-tip">
1150
+ <strong>βœ… Tip:</strong> Keep prompts focused on one main task
1151
+ </div>
1152
+
1153
+ <div class="card">
1154
+ <h3>Common Output Formats</h3>
1155
+ <div class="component-grid">
1156
+ <div class="component-card">
1157
+ <h4>πŸ“ Structured List</h4>
1158
+ <p>Organized points with clear hierarchy</p>
1159
+ <code>"Return as numbered list with brief explanations"</code>
1160
+ </div>
1161
+ <div class="component-card">
1162
+ <h4>πŸ“Š Table Format</h4>
1163
+ <p>Data organized in rows and columns</p>
1164
+ <code>"Create a comparison table with 3 columns: Feature, Pros, Cons"</code>
1165
+ </div>
1166
+ <div class="component-card">
1167
+ <h4>πŸ“– Narrative</h4>
1168
+ <p>Flowing prose or storytelling format</p>
1169
+ <code>"Write as a 3-paragraph narrative explanation"</code>
1170
+ </div>
1171
+ <div class="component-card">
1172
+ <h4>πŸ’» Code Block</h4>
1173
+ <p>Formatted code with explanations</p>
1174
+ <code>"Provide Python code with comments explaining each step"</code>
1175
+ </div>
1176
+ </div>
1177
+ </div>
1178
+
1179
+ <div class="callout callout-insight">
1180
+ <strong>πŸ’‘ Insight:</strong> Save and reuse effective prompts as templates
1181
+ </div>
1182
+
1183
+ <div class="interactive-demo">
1184
+ <h3 style="color: #00D9FF; margin-bottom: 20px;">Format Selector</h3>
1185
+ <p style="color: #888; margin-bottom: 15px;">Choose a format and see how to specify it in your prompt:</p>
1186
+
1187
+ <div class="scenario-selector">
1188
+ <button class="scenario-btn active" onclick="showFormatExample('list')">List</button>
1189
+ <button class="scenario-btn" onclick="showFormatExample('table')">Table</button>
1190
+ <button class="scenario-btn" onclick="showFormatExample('narrative')">Narrative</button>
1191
+ <button class="scenario-btn" onclick="showFormatExample('code')">Code</button>
1192
+ <button class="scenario-btn" onclick="showFormatExample('json')">JSON</button>
1193
+ </div>
1194
+
1195
+ <div id="formatExample" style="margin-top: 20px; background: #1a1a1a; padding: 20px; border-radius: 8px;">
1196
+ <h4 style="color: #00D9FF; margin-bottom: 12px;">Format Specification:</h4>
1197
+ <p id="formatPromptText" style="color: #ccc; line-height: 1.8; margin-bottom: 15px;"></p>
1198
+ <h4 style="color: #00D9FF; margin-bottom: 12px;">Example Output:</h4>
1199
+ <pre id="formatOutputExample" style="background: #0a0a0a; padding: 15px; border-radius: 6px; color: #ccc; overflow-x: auto;"></pre>
1200
+ </div>
1201
+ </div>
1202
+
1203
+ <div class="callout callout-mistake">
1204
+ <strong>⚠️ Common Mistake:</strong> Asking too many things in one prompt
1205
+ </div>
1206
+
1207
+ <div class="card">
1208
+ <h3>Setting Effective Constraints</h3>
1209
+ <div class="steps">
1210
+ <div class="step">
1211
+ <div class="step-number">1</div>
1212
+ <div class="step-content">
1213
+ <h4>Length Constraints</h4>
1214
+ <p>Specify word count, character limit, or number of items</p>
1215
+ </div>
1216
+ </div>
1217
+ <div class="step">
1218
+ <div class="step-number">2</div>
1219
+ <div class="step-content">
1220
+ <h4>Style Guidelines</h4>
1221
+ <p>Define tone, formality, and writing style</p>
1222
+ </div>
1223
+ </div>
1224
+ <div class="step">
1225
+ <div class="step-number">3</div>
1226
+ <div class="step-content">
1227
+ <h4>Structure Rules</h4>
1228
+ <p>Specify sections, headings, or organization</p>
1229
+ </div>
1230
+ </div>
1231
+ <div class="step">
1232
+ <div class="step-number">4</div>
1233
+ <div class="step-content">
1234
+ <h4>Content Boundaries</h4>
1235
+ <p>Define what to include or exclude</p>
1236
+ </div>
1237
+ </div>
1238
+ </div>
1239
+ </div>
1240
+
1241
+ <div class="card">
1242
+ <h3>Summary &amp; Key Takeaways</h3>
1243
+ <ul class="checklist">
1244
+ <li>Always specify the desired output format</li>
1245
+ <li>Use clear format instructions (list, table, code, etc.)</li>
1246
+ <li>Set length and style constraints</li>
1247
+ <li>Define structure and organization upfront</li>
1248
+ <li>Provide format examples when needed</li>
1249
+ </ul>
1250
+ </div>
1251
+
1252
+ <div class="nav-buttons">
1253
+ <button class="btn btn-secondary" onclick="navigateTo(4)">← Previous</button>
1254
+ <button class="btn btn-primary" onclick="navigateTo(6)">Next: Iterative Refinement β†’</button>
1255
+ </div>
1256
+ </section>
1257
+
1258
+ <!-- Topic 6: Iterative Refinement -->
1259
+ <section class="content-section" id="topic-6">
1260
+ <div class="section-header">
1261
+ <h2>Iterative Refinement</h2>
1262
+ <p class="subtitle">Testing and Improving Prompts</p>
1263
+ <p class="description">How to iterate and optimize your prompts through testing</p>
1264
+ </div>
1265
+
1266
+ <div class="card">
1267
+ <h3>The Refinement Process</h3>
1268
+ <p>Perfect prompts are rarely written on the first try. Iterative refinement is the process of testing, evaluating, and improving your prompts based on actual results.</p>
1269
+ <p style="margin-top: 15px;">Think of it like cookingβ€”you taste and adjust seasonings until it's just right.</p>
1270
+ </div>
1271
+
1272
+ <div class="callout callout-insight">
1273
+ <strong>πŸ’‘ Insight:</strong> Testing and iteration is key to prompt mastery
1274
+ </div>
1275
+
1276
+ <div class="card">
1277
+ <h3>5-Step Refinement Process</h3>
1278
+ <div class="steps">
1279
+ <div class="step">
1280
+ <div class="step-number">1</div>
1281
+ <div class="step-content">
1282
+ <h4>Test Your Prompt</h4>
1283
+ <p>Run your prompt and get initial output</p>
1284
+ </div>
1285
+ </div>
1286
+ <div class="step">
1287
+ <div class="step-number">2</div>
1288
+ <div class="step-content">
1289
+ <h4>Evaluate Results</h4>
1290
+ <p>Does it meet your requirements? What's missing?</p>
1291
+ </div>
1292
+ </div>
1293
+ <div class="step">
1294
+ <div class="step-number">3</div>
1295
+ <div class="step-content">
1296
+ <h4>Refine</h4>
1297
+ <p>Add specificity, context, or better format instructions</p>
1298
+ </div>
1299
+ </div>
1300
+ <div class="step">
1301
+ <div class="step-number">4</div>
1302
+ <div class="step-content">
1303
+ <h4>Test Again</h4>
1304
+ <p>Compare new output with previous version</p>
1305
+ </div>
1306
+ </div>
1307
+ <div class="step">
1308
+ <div class="step-number">5</div>
1309
+ <div class="step-content">
1310
+ <h4>Repeat</h4>
1311
+ <p>Keep iterating until satisfied</p>
1312
+ </div>
1313
+ </div>
1314
+ </div>
1315
+ </div>
1316
+
1317
+ <div class="callout callout-tip">
1318
+ <strong>βœ… Tip:</strong> Keep a library of successful prompts for future use
1319
+ </div>
1320
+
1321
+ <div class="canvas-container">
1322
+ <canvas id="refinementCanvas"></canvas>
1323
+ </div>
1324
+
1325
+ <div class="callout callout-mistake">
1326
+ <strong>⚠️ Common Mistake:</strong> Not iterating or refining based on initial results
1327
+ </div>
1328
+
1329
+ <div class="card">
1330
+ <h3>What to Look For When Evaluating</h3>
1331
+ <div class="component-grid">
1332
+ <div class="component-card">
1333
+ <h4>βœ“ Accuracy</h4>
1334
+ <p>Is the information correct and relevant?</p>
1335
+ </div>
1336
+ <div class="component-card">
1337
+ <h4>βœ“ Completeness</h4>
1338
+ <p>Did it cover everything you needed?</p>
1339
+ </div>
1340
+ <div class="component-card">
1341
+ <h4>βœ“ Format</h4>
1342
+ <p>Is it structured as you requested?</p>
1343
+ </div>
1344
+ <div class="component-card">
1345
+ <h4>βœ“ Tone & Style</h4>
1346
+ <p>Does it match your requirements?</p>
1347
+ </div>
1348
+ </div>
1349
+ </div>
1350
+
1351
+ <div class="interactive-demo">
1352
+ <h3 style="color: #00D9FF; margin-bottom: 20px;">Refinement Simulator</h3>
1353
+ <p style="color: #888; margin-bottom: 15px;">See how a prompt improves through iterations:</p>
1354
+
1355
+ <div class="btn-group">
1356
+ <button class="btn btn-primary" onclick="showIteration(1)">Iteration 1</button>
1357
+ <button class="btn btn-primary" onclick="showIteration(2)">Iteration 2</button>
1358
+ <button class="btn btn-primary" onclick="showIteration(3)">Iteration 3 (Final)</button>
1359
+ </div>
1360
+
1361
+ <div id="iterationDisplay" style="margin-top: 20px; background: #1a1a1a; padding: 20px; border-radius: 8px;">
1362
+ <h4 style="color: #00D9FF; margin-bottom: 12px;">Current Iteration:</h4>
1363
+ <p id="iterationPrompt" style="color: #ccc; line-height: 1.8; margin-bottom: 15px;"></p>
1364
+ <div style="padding: 12px; background: #0a0a0a; border-radius: 6px;">
1365
+ <strong style="color: #00D9FF;">Quality Score:</strong>
1366
+ <span id="iterationScore" style="margin-left: 10px;"></span>
1367
+ </div>
1368
+ <div id="iterationNotes" style="margin-top: 15px; padding: 12px; border-left: 3px solid #00D9FF; background: #0a0a0a;"></div>
1369
+ </div>
1370
+ </div>
1371
+
1372
+ <div class="card">
1373
+ <h3>Summary &amp; Key Takeaways</h3>
1374
+ <ul class="checklist">
1375
+ <li>First attempts rarely produce perfect results</li>
1376
+ <li>Test, evaluate, refine, and repeat</li>
1377
+ <li>Look for accuracy, completeness, format, and style</li>
1378
+ <li>Keep successful prompts as templates</li>
1379
+ <li>Small tweaks can lead to big improvements</li>
1380
+ </ul>
1381
+ </div>
1382
+
1383
+ <div class="nav-buttons">
1384
+ <button class="btn btn-secondary" onclick="navigateTo(5)">← Previous</button>
1385
+ <button class="btn btn-primary" onclick="navigateTo(7)">Next: Advanced Techniques β†’</button>
1386
+ </div>
1387
+ </section>
1388
+
1389
+ <!-- Topic 7: Advanced Techniques -->
1390
+ <section class="content-section" id="topic-7">
1391
+ <div class="section-header">
1392
+ <h2>Prompt Patterns and Techniques</h2>
1393
+ <p class="subtitle">Advanced Methods for Better Results</p>
1394
+ <p class="description">Learn professional techniques used by prompt engineering experts</p>
1395
+ </div>
1396
+
1397
+ <div class="card">
1398
+ <h3>Advanced Prompt Techniques</h3>
1399
+ <p>Once you master the basics, these advanced techniques will help you unlock even more powerful AI capabilities.</p>
1400
+ </div>
1401
+
1402
+ <div class="component-grid">
1403
+ <div class="component-card">
1404
+ <h4>🧠 Chain-of-Thought</h4>
1405
+ <p>Ask AI to show its reasoning step-by-step</p>
1406
+ <code>"Think through this step-by-step before answering"</code>
1407
+ </div>
1408
+ <div class="component-card">
1409
+ <h4>πŸ“š Few-Shot Examples</h4>
1410
+ <p>Provide examples of desired output format</p>
1411
+ <code>"Here are 3 examples: [examples]. Now do this:"</code>
1412
+ </div>
1413
+ <div class="component-card">
1414
+ <h4>βš™οΈ System Prompts</h4>
1415
+ <p>Set AI behavior and personality upfront</p>
1416
+ <code>"You are a helpful tutor for 10th-grade students"</code>
1417
+ </div>
1418
+ <div class="component-card">
1419
+ <h4>🎯 Constraints</h4>
1420
+ <p>Limit scope and manage complexity</p>
1421
+ <code>"Keep under 100 words, use simple language"</code>
1422
+ </div>
1423
+ </div>
1424
+
1425
+ <div class="callout callout-insight">
1426
+ <strong>πŸ’‘ Insight:</strong> Chain-of-thought prompting can improve reasoning by 50% or more
1427
+ </div>
1428
+
1429
+ <div class="card">
1430
+ <h3>Technique Deep Dive: Chain-of-Thought</h3>
1431
+ <p>Chain-of-thought prompting asks the AI to show its work, which leads to better reasoning and more accurate results.</p>
1432
+
1433
+ <div class="comparison" style="margin-top: 20px;">
1434
+ <div class="comparison-item bad">
1435
+ <h4>❌ Without Chain-of-Thought</h4>
1436
+ <p style="font-family: monospace; font-size: 13px; margin-bottom: 10px;">"What's 15% of 240?"</p>
1437
+ <p style="font-size: 13px; color: #888;">AI might give answer without showing work, making errors harder to spot.</p>
1438
+ </div>
1439
+ <div class="comparison-item good">
1440
+ <h4>βœ“ With Chain-of-Thought</h4>
1441
+ <p style="font-family: monospace; font-size: 13px; margin-bottom: 10px;">"What's 15% of 240? Think through this step-by-step."</p>
1442
+ <p style="font-size: 13px; color: #888;">AI shows: 1) 10% of 240 = 24, 2) 5% = half of 10% = 12, 3) 15% = 24 + 12 = 36</p>
1443
+ </div>
1444
+ </div>
1445
+ </div>
1446
+
1447
+ <div class="callout callout-tip">
1448
+ <strong>βœ… Tip:</strong> Use few-shot examples when the output format is complex or unusual
1449
+ </div>
1450
+
1451
+ <div class="card">
1452
+ <h3>Template Library</h3>
1453
+ <p style="margin-bottom: 20px;">Ready-to-use prompt templates for common scenarios:</p>
1454
+
1455
+ <div class="template-library">
1456
+ <div class="template-item" onclick="copyTemplate(this)">
1457
+ <h5>πŸ“§ Email Writing</h5>
1458
+ <pre>You are a professional email writer.
1459
+
1460
+ Write a [formal/casual] email to [recipient] about [topic].
1461
+
1462
+ Tone: [professional/friendly]
1463
+ Length: [brief/detailed]
1464
+ Action needed: [yes/no]</pre>
1465
+ </div>
1466
+ <div class="template-item" onclick="copyTemplate(this)">
1467
+ <h5>πŸ’» Code Generation</h5>
1468
+ <pre>You are an expert [language] developer.
1469
+
1470
+ Write a function that [task description].
1471
+
1472
+ Requirements:
1473
+ - [requirement 1]
1474
+ - [requirement 2]
1475
+
1476
+ Provide code with comments.</pre>
1477
+ </div>
1478
+ <div class="template-item" onclick="copyTemplate(this)">
1479
+ <h5>πŸ“Š Data Analysis</h5>
1480
+ <pre>Analyze this data: [data]
1481
+
1482
+ Provide:
1483
+ 1. Key insights
1484
+ 2. Trends or patterns
1485
+ 3. Recommendations
1486
+
1487
+ Format as bullet points.</pre>
1488
+ </div>
1489
+ <div class="template-item" onclick="copyTemplate(this)">
1490
+ <h5>✍️ Content Creation</h5>
1491
+ <pre>Write a [blog post/article] about [topic].
1492
+
1493
+ Audience: [description]
1494
+ Tone: [conversational/professional]
1495
+ Length: [word count]
1496
+
1497
+ Include:
1498
+ - Introduction
1499
+ - 3-5 main points
1500
+ - Conclusion</pre>
1501
+ </div>
1502
+ </div>
1503
+ </div>
1504
+
1505
+ <div class="callout callout-mistake">
1506
+ <strong>⚠️ Common Mistake:</strong> Using advanced techniques when simple prompts would work better
1507
+ </div>
1508
+
1509
+ <div class="canvas-container">
1510
+ <canvas id="techniquesCanvas"></canvas>
1511
+ </div>
1512
+
1513
+ <div class="card">
1514
+ <h3>Summary &amp; Key Takeaways</h3>
1515
+ <ul class="checklist">
1516
+ <li>Chain-of-thought improves reasoning quality</li>
1517
+ <li>Few-shot examples guide output format</li>
1518
+ <li>System prompts set overall behavior</li>
1519
+ <li>Constraints keep responses focused</li>
1520
+ <li>Use templates to save time and ensure consistency</li>
1521
+ </ul>
1522
+ </div>
1523
+
1524
+ <div class="nav-buttons">
1525
+ <button class="btn btn-secondary" onclick="navigateTo(6)">← Previous</button>
1526
+ <button class="btn btn-primary" onclick="navigateTo(8)">Next: Real-World Applications β†’</button>
1527
+ </div>
1528
+ </section>
1529
+
1530
+ <!-- Topic 8: Real-World Applications -->
1531
+ <section class="content-section" id="topic-8">
1532
+ <div class="section-header">
1533
+ <h2>Real-World Applications</h2>
1534
+ <p class="subtitle">Putting It All Together</p>
1535
+ <p class="description">See prompt engineering in action across different domains</p>
1536
+ </div>
1537
+
1538
+ <div class="card">
1539
+ <h3>Prompt Engineering in Practice</h3>
1540
+ <p>Now that you've learned the fundamentals and advanced techniques, let's explore how prompt engineering is applied across different real-world domains.</p>
1541
+ </div>
1542
+
1543
+ <div class="card">
1544
+ <h3>Professional Writing</h3>
1545
+ <div class="use-case-section">
1546
+ <ul class="use-case-list">
1547
+ <li>Email summarization and drafting</li>
1548
+ <li>Report generation</li>
1549
+ <li>Meeting notes synthesis</li>
1550
+ </ul>
1551
+ </div>
1552
+ <div class="callout callout-tip" style="margin-top: 15px;">
1553
+ <strong>βœ… Example:</strong> "Summarize this 3-page meeting transcript into 5 key action items with owners and deadlines. Format as a table."
1554
+ </div>
1555
+ </div>
1556
+
1557
+ <div class="card">
1558
+ <h3>Technical Applications</h3>
1559
+ <div class="use-case-section">
1560
+ <ul class="use-case-list">
1561
+ <li>Code generation and debugging</li>
1562
+ <li>API documentation creation</li>
1563
+ <li>Technical explanation simplification</li>
1564
+ </ul>
1565
+ </div>
1566
+ <div class="callout callout-tip" style="margin-top: 15px;">
1567
+ <strong>βœ… Example:</strong> "I have a React component that's re-rendering unnecessarily. Here's the code: [code]. Identify the issue and provide an optimized version with explanations."
1568
+ </div>
1569
+ </div>
1570
+
1571
+ <div class="card">
1572
+ <h3>Creative Work</h3>
1573
+ <div class="use-case-section">
1574
+ <ul class="use-case-list">
1575
+ <li>Marketing copy creation</li>
1576
+ <li>Brainstorming ideas</li>
1577
+ <li>Content outline generation</li>
1578
+ </ul>
1579
+ </div>
1580
+ <div class="callout callout-tip" style="margin-top: 15px;">
1581
+ <strong>βœ… Example:</strong> "Generate 10 creative Instagram post ideas for a sustainable fashion brand targeting Gen Z. Include post caption and hashtag suggestions."
1582
+ </div>
1583
+ </div>
1584
+
1585
+ <div class="card">
1586
+ <h3>Educational Content</h3>
1587
+ <div class="use-case-section">
1588
+ <ul class="use-case-list">
1589
+ <li>Concept explanation</li>
1590
+ <li>Quiz generation</li>
1591
+ <li>Study guide creation</li>
1592
+ </ul>
1593
+ </div>
1594
+ <div class="callout callout-tip" style="margin-top: 15px;">
1595
+ <strong>βœ… Example:</strong> "Explain photosynthesis to a 7th grader using an analogy they can relate to. Keep it under 150 words."
1596
+ </div>
1597
+ </div>
1598
+
1599
+ <div class="callout callout-insight">
1600
+ <strong>πŸ’‘ Insight:</strong> The best prompts combine multiple techniques based on the specific use case
1601
+ </div>
1602
+
1603
+ <div class="challenge-box">
1604
+ <h3>🎯 Final Challenge: Build Your Own Prompt</h3>
1605
+ <p style="color: #ccc; margin-bottom: 15px;">Choose a scenario and build a complete prompt using everything you've learned:</p>
1606
+
1607
+ <div class="scenario-selector">
1608
+ <button class="scenario-btn active" onclick="setChallenge('email')">Email Writing</button>
1609
+ <button class="scenario-btn" onclick="setChallenge('code')">Coding Help</button>
1610
+ <button class="scenario-btn" onclick="setChallenge('creative')">Creative Writing</button>
1611
+ <button class="scenario-btn" onclick="setChallenge('analysis')">Data Analysis</button>
1612
+ </div>
1613
+
1614
+ <div class="challenge-prompt" id="challengeScenario" style="margin-top: 15px;">
1615
+ Scenario will appear here...
1616
+ </div>
1617
+
1618
+ <textarea id="challengeInput" placeholder="Build your prompt here..." style="width: 100%; min-height: 150px; background: #0a0a0a; border: 2px solid #333; color: #fff; padding: 15px; border-radius: 8px; font-size: 14px; margin-top: 15px; font-family: inherit;"></textarea>
1619
+
1620
+ <div class="btn-group" style="margin-top: 15px;">
1621
+ <button class="btn btn-primary" onclick="evaluateChallenge()">Evaluate My Prompt</button>
1622
+ <button class="btn btn-secondary" onclick="resetChallenge()">Reset</button>
1623
+ </div>
1624
+
1625
+ <div class="feedback" id="challengeFeedback"></div>
1626
+ </div>
1627
+
1628
+ <div class="card">
1629
+ <h3>Congratulations! πŸŽ‰</h3>
1630
+ <p>You've completed the Prompt Engineering Masterclass! You now have the knowledge and tools to communicate effectively with AI systems.</p>
1631
+
1632
+ <div style="margin-top: 20px; padding: 20px; background: linear-gradient(135deg, #0066FF22, #00D9FF22); border-radius: 8px;">
1633
+ <h4 style="color: #00D9FF; margin-bottom: 15px;">What You've Learned:</h4>
1634
+ <ul class="checklist">
1635
+ <li>The four components of effective prompts</li>
1636
+ <li>How to write clear and specific instructions</li>
1637
+ <li>The importance of context and background</li>
1638
+ <li>How to specify output formats</li>
1639
+ <li>Iterative refinement techniques</li>
1640
+ <li>Advanced prompt patterns</li>
1641
+ <li>Real-world applications across domains</li>
1642
+ </ul>
1643
+ </div>
1644
+
1645
+ <div class="btn-group" style="margin-top: 20px;">
1646
+ <button class="btn btn-primary" onclick="navigateTo(1)">↻ Review from Beginning</button>
1647
+ <button class="btn btn-secondary" onclick="alert('Export feature coming soon!')">πŸ“„ Export Summary</button>
1648
+ </div>
1649
+ </div>
1650
+
1651
+ <div class="nav-buttons">
1652
+ <button class="btn btn-secondary" onclick="navigateTo(7)">← Previous</button>
1653
+ <button class="btn btn-primary" onclick="navigateTo(1)">↻ Start Over</button>
1654
+ </div>
1655
+ </section>
1656
+ </main>
1657
+ </div>
1658
+
1659
+ <script src="app.js"></script>
1660
+ </body>
1661
+ </html>