diff --git a/src/src/components/mdx/video.tsx b/src/src/components/mdx/video.tsx new file mode 100644 index 0000000..450bc0a --- /dev/null +++ b/src/src/components/mdx/video.tsx @@ -0,0 +1,68 @@ +// src/components/mdx/Video.tsx +import React, { useRef } from "react"; +import { Play } from "lucide-react"; + +type VideoProps = { + url: string; + title: string; + attribution?: string; + className?: string; +}; + +export function Video({ url, title, attribution, className }: VideoProps) { + const videoRef = useRef(null); + const overlayRef = useRef(null); + + const handlePlay = () => { + if (!videoRef.current || !overlayRef.current) return; + + // Show browser native controls on play + videoRef.current.controls = true; + videoRef.current.play(); + + // Hide the overlay + overlayRef.current.style.display = "none"; + }; + + return ( +
+
+ + + {/* Big overlay play button */} + +
+ + {/* Title + attribution */} +
+ {title} + {attribution && ( + + {attribution} + + )} +
+
+ ); +} diff --git a/src/src/components/resources/presentation.astro b/src/src/components/resources/presentation.astro index 2dd3800..4434a04 100644 --- a/src/src/components/resources/presentation.astro +++ b/src/src/components/resources/presentation.astro @@ -1,4 +1,3 @@ -// src/components/resources/presentation.astro --- import Background from "@/components/background"; --- diff --git a/src/src/content/resources/curriculum/python/01-intro-to-python.mdx b/src/src/content/resources/curriculum/python/01-intro-to-python.mdx new file mode 100644 index 0000000..9343f00 --- /dev/null +++ b/src/src/content/resources/curriculum/python/01-intro-to-python.mdx @@ -0,0 +1,135 @@ +--- +title: "Command Line Basics - Lesson 1" +description: "Getting started with the Linux command line" +date: 2025-09-01 +duration: "45 minutes" +tags: ["command line", "linux", "beginners", "lesson1"] +--- + +import Slide from "@/components/resources/slide.astro"; +import Presentation from "@/components/resources/presentation.astro"; + +import { Video } from "@/components/mdx/video"; + + + + +# ๐Ÿ’ป Welcome to the Command Line! + +
The command line is a way to **talk to your computer** using words instead of clicking.
+
- Itโ€™s like giving your computer instructions directly.
+
- Powerful, fast, and used by programmers every day!
+
+ + +## What is the Command Line? + + + + + +
Think of your computer as a **library**.
+
- Normally you click through the shelves (folders).
+
- With the command line, you can just **ask the librarian** (the computer) to take you exactly where you want to go.
+
+ + +## Opening the Terminal + +
On your laptop, open the **Terminal** program.
+
You should see something like:
+ +
This is called the prompt โ€“ itโ€™s where you type commands!
+
+ + + +Try It Out! ๐Ÿ“ +
Type this command:
+
+ +Bash + +echo Hello World +
+
The computer will answer back:
Hello World
+
+ + + +Class Question ๐Ÿค” +
What do you think the command echo does?
+
+ + + +Answer ๐ŸŽ‰ +
It simply repeats back (or "echoes") what you tell it!
+
+ + + +Clear the Screen +
If your screen gets messy, type:
+
+ +Bash + +clear +
+
This gives you a clean slate.
+
+ + + +Where Am I? ๐Ÿ—บ๏ธ +
Use the pwd command:
+
+ +Bash + +pwd +
+
It tells you your current location in the computer.
+
Example:
/home/student
+
+ + + +Class Question ๐Ÿค” +
If your computer is a giant library, what does pwd tell you?
+
+ + + +Answer ๐Ÿ“ +
It tells you which room (folder) you are standing in right now!
+
+ + + +Recap ๐ŸŽฏ +
Today we learned:
+
- How to open the terminal
+
- echo (say something)
+
- clear (clean your screen)
+
- pwd (where am I?)
+
+ + + +Exit Challenge ๐Ÿš€ +
Before you leave, type this into your terminal:
+
+ +Bash + +echo Goodbye! +
+
๐ŸŽ‰ Youโ€™ve just completed your first command line lesson!
+
diff --git a/src/src/content/resources/curriculum/python/intro-to-python.mdx b/src/src/content/resources/curriculum/python/intro-to-python.mdx deleted file mode 100644 index 641ef52..0000000 --- a/src/src/content/resources/curriculum/python/intro-to-python.mdx +++ /dev/null @@ -1,369 +0,0 @@ ---- -title: "Introduction to Python Programming" -description: "A comprehensive introduction to Python programming fundamentals for beginners" -date: 2025-01-20 -duration: "2 hours" -tags: ["python", "programming", "beginner", "fundamentals"] ---- - -import Slide from "@/components/resources/slide.astro"; -import Presentation from "@/components/resources/presentation.astro"; - - - - -# Welcome to Python! ๐Ÿ - -
**A beginner-friendly programming language**
- -
- Easy to learn and read
-
- Powerful and versatile
-
- Great for beginners
-
- Used by major companies
-
- - -## What is Python? - -
Python is a **high-level programming language** that emphasizes:
- -
- **Readability** - Code that looks like English
-
- **Simplicity** - Easy to learn and use
-
- **Versatility** - Can be used for many things
- -
### Created by Guido van Rossum in 1991
- -
Named after "Monty Python's Flying Circus" ๐ŸŽญ
-
- - -## Why Learn Python? - -
-### ๐ŸŒ Web Development -Build websites and web applications -
- -
-### ๐Ÿค– Data Science & AI -Analyze data and build machine learning models -
- -
-### ๐ŸŽฎ Game Development -Create games and interactive applications -
- -
-### ๐Ÿ”ง Automation -Automate repetitive tasks -
-
- - -## Your First Python Program - -
Let's write the classic "Hello, World!" program:
- -
-```python -print("Hello, World!") -``` -
- -
### How to run it:
-
1. Open a text editor
-
2. Type the code above
-
3. Save as `hello.py`
-
4. Run with: `python hello.py`
-
- - -## Variables and Data Types - -
### Creating Variables
-
-```python -name = "Alice" # String -age = 25 # Integer -height = 5.6 # Float -is_student = True # Boolean -``` -
- -
### Python is **dynamically typed**
-
You don't need to declare the type!
- -
-```python -x = 42 # x is an integer -x = "Hello" # Now x is a string -``` -
-
- - -## Working with Strings - -
### String Operations
-
-```python -# Creating strings -greeting = "Hello" -name = "World" - -# Concatenation -message = greeting + ", " + name + "!" -print(message) # Output: Hello, World! -``` -
- -
-```python -# String methods -text = "python programming" -print(text.upper()) # PYTHON PROGRAMMING -print(text.capitalize()) # Python programming -print(text.replace("python", "Python")) # Python programming -``` -
-
- - -## Numbers and Math - -
### Basic Math Operations
-
-```python -# Arithmetic operators -a = 10 -b = 3 -``` -
- -
-```python -print(a + b) # Addition: 13 -print(a - b) # Subtraction: 7 -print(a * b) # Multiplication: 30 -print(a / b) # Division: 3.333... -``` -
- -
-```python -print(a // b) # Floor division: 3 -print(a % b) # Modulo (remainder): 1 -print(a ** b) # Exponentiation: 1000 -``` -
-
- - -## Lists - Storing Multiple Values - -
### Creating and Using Lists
-
-```python -# Creating a list -fruits = ["apple", "banana", "orange"] -numbers = [1, 2, 3, 4, 5] -``` -
- -
-```python -# Accessing items (indexing starts at 0) -print(fruits[0]) # apple -print(fruits[-1]) # orange (last item) -``` -
- -
-```python -# Adding items -fruits.append("grape") -fruits.insert(1, "strawberry") - -# List methods -print(len(fruits)) # Length of list -print("apple" in fruits) # Check if item exists -``` -
-
- - -## Control Flow - Making Decisions - -
### If Statements
-
-```python -age = 18 - -if age >= 18: - print("You can vote!") -elif age >= 16: - print("You can drive!") -else: - print("You're still young!") -``` -
- -
-```python -# Comparison operators -# == (equal), != (not equal) -# > (greater), < (less) -# >= (greater or equal), <= (less or equal) -``` -
-
- - -## Loops - Repeating Actions - -
### For Loops
-
-```python -# Loop through a list -fruits = ["apple", "banana", "orange"] -for fruit in fruits: - print(f"I like {fruit}") -``` -
- -
-```python -# Loop through numbers -for i in range(5): - print(f"Count: {i}") # 0, 1, 2, 3, 4 -``` -
- -
### While Loops
-
-```python -count = 0 -while count < 3: - print(f"Count is {count}") - count += 1 # Same as count = count + 1 -``` -
-
- - -## Functions - Organizing Your Code - -
### Creating Functions
-
-```python -def greet(name): - """This function greets someone""" - return f"Hello, {name}!" -``` -
- -
-```python -def add_numbers(a, b): - """Add two numbers and return the result""" - result = a + b - return result -``` -
- -
### Using functions
-
-```python -message = greet("Alice") -print(message) # Hello, Alice! - -sum_result = add_numbers(5, 3) -print(sum_result) # 8 -``` -
-
- - -## Practice Exercise - -
### Build a Simple Calculator
-
-```python -def calculator(): - print("Simple Calculator") - print("Operations: +, -, *, /") - - num1 = float(input("Enter first number: ")) - operation = input("Enter operation (+, -, *, /): ") - num2 = float(input("Enter second number: ")) -``` -
- -
-```python - if operation == "+": - result = num1 + num2 - elif operation == "-": - result = num1 - num2 - elif operation == "*": - result = num1 * num2 - elif operation == "/": - if num2 != 0: - result = num1 / num2 - else: - return "Error: Division by zero!" - else: - return "Error: Invalid operation!" - - return f"Result: {result}" -``` -
- -
-```python -# Run the calculator -print(calculator()) -``` -
-
- - -## ๐ŸŽ‰ Congratulations! - -
You've learned the basics of Python programming!
- -
### What's Next?
-
- Practice with small projects
-
- Learn about modules and packages
-
- Explore Python libraries
-
- Build something cool!
- -
**Ready to code? Let's build something amazing! ๐Ÿš€**
-
- -## Course Materials - -This curriculum covers the fundamentals of Python programming in an interactive, hands-on format. Students will work through practical examples and complete coding exercises to reinforce their learning. - -### Getting Started - -The presentation above covers all the core concepts you need to start programming in Python. Each slide builds upon the previous one, taking you from basic concepts to writing your first functional program. - -#### What You'll Need - -- A computer with Python installed -- A text editor or IDE (like VS Code) -- Terminal/command prompt access -- About 2 hours of focused time - -#### Course Objectives - -By the end of this presentation, you'll be able to: -- Understand Python syntax and basic programming concepts -- Work with variables, strings, numbers, and lists -- Use conditional statements and loops -- Create and use functions -- Build a simple calculator program - -The presentation automatically starts when you visit this page. Use arrow keys to navigate between slides and steps, or escape to exit presentation mode.