Jump to... //Make //HTML-CSS //Init //Input //Process //Output //Style //Solve //Gallery
//MAKE: Build your skills
- 1.01H - Hello world!
- 1.02S - Survey lists
- 1.03S - Datatypes and tables
- 1.04H - Otto the Robot
- 1.05S - Hello color!
- 1.06S - Construct a picture
- 1.07X - Animate Mario
- 1.08H - Make a game board
- 2.01S - Hello Javascript!
- 2.02S - Color changer
- 2.03X - Modals
- 2.04S - Formula solver
-
2.05H -
Font style console
-OR-
2.05H - Cakey clicker - 2.06S - Move things with buttons
- 2.07S - Defuse the bomb!
- 2.08S - Keyboard reader
- 2.09H - Keyboard motion control
- 2.10S - Move things around smoothly
- 2.11S - Roll some dice
- 2.12S - My biggest star
- 2.13S - High or low
- 2.14H - Shy Link is shy
- 3.01S - Mad libs
- 3.02S - Make a bar graph
- 3.03X - Get your personal data
- 3.04S - Fireworks
-
3.05H -
The sky at night
-OR-
3.05H - Character generator - 3.06S - Bucket list
- 3.07S - Make a rainbow
- 3.08X - Get your updated marks- Perhaps in the future...
- 3.09H - Make a table
- 3.10S - Create a maze
- 3.11X - Create a map
- 4.01S - Object oriented keyboard control
- 4.02H - Make a maze and something to move on it
- 4.03S - Mice and images
- 4.04X - Travel through a maze and find things
- 4.05S - Random Monster Swarm
- 4.06X - Monster Chasers
- Exam project:
- Exam description
- The Markerator!
- Printable checklist: [pdf] or [docx]
-
Our Javascript reference sheet:
[pdf]
[pub]
- Online timer
- Reference sites: W3Schools, Mozilla developers network
//HTML-CSS: Learn the basics of web page coding
-
HTML:
class=""
id=""
J
<!doctype html> <a href=""> <audio> <body> <br> <button> <caption> <div> <h1> <h2> <head> <html> <img src=""> <input> <li> <ol> <p> <script src=""> <source> <span> <strong> <style> <table> <td> <textarea> <th> <thead> <tr> <ul>
CSS: .class #Id
#FF0000 rgb(255, 0, 0)
@keyframes exampleAnimation animation-duration: animation-iteration-count: animation-name: animation-timing-function:
background: background-color: border: bottom: color: font-family: font-size: font-style: font-weight: height: left: opacity: position: right: top: width: z-index:
- //HTML: Basics
- //HTML: Lists
- //HTML: Tables
- //HTML: Two kinds of HTML tables
- //HTML: Converting to Unicode characters
- //HTML and OUTPUT: Unicode dice
- //HTML: Image resources for projects
- //CSS: Text formatting
- //CSS: Background images
- //CSS: Applying styles using IDs
- //CSS: Positioning
- //CSS: Animation
- //CSS: Color
- //CSS: Selectors: tags, IDs, and classes
-
//CSS:
Style containers:
<div>
and<span>
//INIT: Find out about variables and data structures
-
<script src="">
var
=0
=""
true
false
=new ConstructorObj()
exampleObj={} exampleObj{} exampleObj.propertyName exampleObj[ 'propertyName' ] exampleObj{ propertyName: propertyInfo }
exampleArr=[] exampleArr[] .split() exampleArr[][] exampleArr[]{}
- //INIT: Datatypes
- //INIT: Using variables
- //INIT: Using libraries
- //INIT: Objects
- //INIT: Creating arrays
- //INIT: Creating two-dimensional arrays
- //INIT: Creating arrays of objects
- //INIT: Variable scope
- //INIT: Creating objects with methods
- //INIT: Creating objects using object constructors
- Complex data structures - Arrays of objects, anyone?
- Tae Kwon Do - store characteristic data in arrays and display it
- Telling time - using arrays to interpret time information
- Build a clock - make a simple clock using arrays, date objects, and timers
-
Variable scope
- when to declare variables in your program
//INPUT: How you get information from the environment?
-
.clientY
.clientX
.offsetLeft
.offsetTop
Events: .onchange .onclick .onkeydown .onload .onmousemove .onmouseout .onmouseover
.value keyEvent.which || keyEvent.keyCode window.innerHeight window.innerWidth
.get()
- //INPUT: Buttons
- //INPUT: Text
- //INPUT: Read element positions
- //INPUT: Reading keypresses
- //INPUT: Detecting mouseovers
- //INPUT: Getting information from websites
- //INPUT: Reading the height and width of the screen
- //INPUT: Reading mouse movements and position
- //INPUT: Reading the time
- Telling time - using arrays to interpret time information
//PROCESS: Learn about how to manipulate and process information
-
"" + ""
==
.concat() .join() .length .push() .split()
else else if () for () function () if () return
setInterval() setTimeout()
parseFloat() parseInt() + - * / Math.ceil() Math.cos() Math.floor() Math.PI Math.pow() Math.random() Math.round() Math.sin() Math.sqrt() Math.tan()
JSON.parse() JSON.stringify()
- //PROCESS: Basic math
-
//PROCESS:
if...else
conditionals - //PROCESS: Randomness and rounding
- //PROCESS: Using function parameters and returns
- //PROCESS: Functions: Definition, trigger, or reference?
- //PROCESS: String addition
- //PROCESS: JSON — Bundling data into a transferable form
- //PROCESS: Timeout and intervals
- //PROCESS: Using arrays
-
//PROCESS:
for
loops - //PROCESS: Using two dimensional arrays and nested loops
- //PROCESS: Using arrays of objects to create a table
- //PROCESS: Using arrays of objects to create a map
- Recursive functions - Functions that loop back on themselves
- Color grid - using javascript with CSS, and nesting loops
- Sieve of Eratosthenes - use arrays and loops to calculate prime numbers
- Character generator - use objects and function pipelines to generate a character
- Draw the Ms Pacman maze - use complex data and function pipelines to draw a maze
//OUTPUT: How do you display things?
-
.animate({top:, left:, width:, opacity: }, {duration:, easing:, start:, complete: })
.clearQueue() .stop()
alert() .appendChild() console.log() .createElement() .innerHTML .play() .src
.style.backgroundColor .style.color .style.fontSize .style.fontStyle .style.fontWeight .style.left .style.position .style.textAlign .style.top .style.verticalAlign .style.visibility .style.width
-
//OUTPUT:
alert()
,.innerHTML
, andconsole.log()
- //OUTPUT: Changing text styles
- //OUTPUT: Changing an element's position
- //OUTPUT: Changing an image
- //HTML and OUTPUT: Unicode dice
- //OUTPUT: Adding new images to an output element
- //HTML and OUTPUT: Adding and playing audio
- //OUTPUT: Animation
//STYLE: Develop professional programming habits
- //STYLE: Capitalizing HTML tags
- //STYLE: Choosing an editor
- //STYLE: Formatting code with tab indents
- //STYLE: Use comments to communicate
- //STYLE: Avoid long lines of code
- //STYLE: Use cut and paste where possible
- //STYLE: Space out mathematical expressions
-
//STYLE:
Debug using
alert()
-
//STYLE:
Keep your CSS inside your
<head>
- //STYLE: Use descriptive variable names
- //STYLE: Use function pipelines
- //STYLE: Separate and comment your functions
- //STYLE: Use descriptive function names
- //STYLE: Work from general to specific
- //STYLE: Debug using the console log
- //STYLE: Run your code more quickly
- //STYLE: Avoid global variables
- //STYLE: Avoid long blocks of code
//SOLVE: Demonstrations about how to solve certain kinds of problems
- //SOLVE: Character generator
- //SOLVE: Project cost calculator
- //SOLVE: Choose your own adventure
- //SOLVE: Visual clock
- //SOLVE: Saving and opening data files
- //SOLVE: Frame-based animation that continues while you press the key
- //SOLVE: Animating a side-scroller
- //SOLVE: Loop a sprite through an array of images
- //SOLVE: Basic physics in games: Flappy Tree!
- //SOLVE: Calculating a change in time
The Pacman Project
- Part One: The user interface
- Part Two: Motion control
- Part Three: Game play
- Understanding grids I: Positioning an image on a grid
- Understanding grids II: Positioning images precisely based on data structures
- Understanding grids III: Positioning images in a grid using widths and offset values
- Fine-tuning Ms Pacman's position: Using offsets to fine-tune placement
- How to keep Ms. Pacman from going through walls: Blocking and allowing movement with arrays
- How Pac-Man’s Ghosts Think & Hunt [youtube]
Problem solving challenges
Customizing table cells with data
Interesting videos
Evaluation
This class is project-based. You will be evaluated on the work you create: don't expect tests and quizzes.
80% of your final mark will be from your semester work, and 20% of it will be from a project-based exam.
Your assignments are divided into two categories: skill builders, which are formative, not graded, and meant to help students figure things out, and hand-in assignments, which are summative, graded assignments in which you show off your skills.
Hand-in assignments have names like "1.01H" and skill-builders have names like "1.03S".