├── .gitignore ├── README.md ├── Spring-2014 ├── McCarthy-Tues-2014.md ├── Shiffman-Fri-2014.md ├── ideas.md ├── week1 │ ├── array_of_images │ │ ├── burger.png │ │ ├── chickens.jpg │ │ ├── fish.png │ │ ├── flower.png │ │ ├── index.html │ │ └── sketch.js │ ├── array_of_numbers │ │ ├── index.html │ │ └── sketch.js │ ├── basics │ │ ├── index.html │ │ └── sketch.js │ ├── empty_example │ │ ├── index.html │ │ └── sketch.js │ ├── p5_simple_example │ │ ├── index.html │ │ └── sketch.js │ ├── processing_p5_conversion_0 │ │ ├── examples-basics-form-bezier.pde │ │ ├── index.html │ │ └── sketch.js │ ├── processing_p5_conversion_1 │ │ ├── examples-topics-interaction-follow3.pde │ │ ├── index.html │ │ └── sketch.js │ └── shiffman_demo_inclass │ │ └── hello_world │ │ ├── index.html │ │ └── sketch.js ├── week2 │ ├── 00_JS_objects_walkthrough │ │ ├── index.html │ │ ├── sketch_bubbleobject1.js │ │ ├── sketch_bubbleobject2_method.js │ │ ├── sketch_bubbleobject3_multiple.js │ │ ├── sketch_bubbleobject4_constructor.js │ │ ├── sketch_bubbleobject5_constructor_arguments.js │ │ └── sketch_bubbleobject6_prototypeadd.js │ ├── 01_object_example │ │ ├── index.html │ │ └── sketch.js │ ├── 02_parameterized_objects │ │ ├── index.html │ │ └── sketch.js │ ├── 03_array_of_objects │ │ ├── index.html │ │ └── sketch.js │ ├── 04_array_interactive_objects │ │ ├── index.html │ │ ├── sketch.js │ │ └── stripe.js │ ├── 05_array_of_objects_push │ │ ├── ball.js │ │ ├── index.html │ │ └── sketch.js │ └── 06_inheritance │ │ ├── ball.js │ │ ├── index.html │ │ ├── sketch.js │ │ └── superball.js ├── week3 │ ├── 00_preload │ │ ├── index.html │ │ ├── large.jpg │ │ ├── sketch.js │ │ └── small.jpg │ ├── 01_position_canvas │ │ ├── index.html │ │ └── sketch.js │ ├── 02_html_css │ │ ├── one.html │ │ ├── style.css │ │ └── two.html │ ├── 03_add_p_element │ │ ├── index.html │ │ └── sketch.js │ ├── 04_parent_child │ │ ├── index.html │ │ └── sketch.js │ ├── 05_style_functions │ │ ├── index.html │ │ └── sketch.js │ ├── 06_style_css │ │ ├── index.html │ │ ├── sketch.js │ │ └── style.css │ ├── 07_mousepressed │ │ ├── index.html │ │ └── sketch.js │ ├── 07_setting_class │ │ ├── index.html │ │ └── sketch.js │ ├── 08_mouseover_mouseout │ │ ├── index.html │ │ └── sketch.js │ ├── 09_getElements │ │ ├── index.html │ │ └── sketch.js │ ├── 09_mousepressed │ │ ├── index.html │ │ └── sketch.js │ ├── 10_getElement │ │ ├── index.html │ │ └── sketch.js │ ├── 10_mouseover_mouseout │ │ ├── index.html │ │ └── sketch.js │ ├── 11_animateDOM │ │ ├── index.html │ │ └── sketch.js │ ├── 12_button_slider │ │ ├── ball.js │ │ ├── index.html │ │ └── sketch.js │ ├── 13_wordscrambler │ │ ├── index.html │ │ └── sketch.js │ ├── document_tests │ │ └── one.html │ └── shiffman_inclass │ │ ├── canvas_dom │ │ ├── index.html │ │ └── sketch.js │ │ ├── htmlElement │ │ ├── index.html │ │ └── sketch.js │ │ └── html_blah │ │ └── index.html ├── week4 │ ├── 00_preload_loadImage │ │ ├── index.html │ │ ├── large.jpg │ │ ├── sketch.js │ │ └── small.jpg │ ├── 01_preload_loadStrings │ │ ├── index.html │ │ ├── lines.txt │ │ └── sketch.js │ ├── 01_preload_loadStrings_DOM │ │ ├── index.html │ │ ├── lines.txt │ │ └── sketch.js │ ├── 02_json │ │ ├── index.html │ │ └── sketch.js │ ├── 03_preload_loadJSON │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ ├── 03_preload_loadJSON_OOP │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ ├── 04_callback │ │ ├── index.html │ │ └── sketch.js │ ├── 05_callback_anonymous │ │ ├── index.html │ │ └── sketch.js │ ├── 06_callback_loadImage │ │ ├── index.html │ │ ├── large.jpg │ │ ├── sketch.js │ │ └── small.jpg │ ├── 06_callback_loadImage_OOP │ │ ├── index.html │ │ ├── large.jpg │ │ ├── sketch.js │ │ └── small.jpg │ ├── 07_callback_loadStrings │ │ ├── index.html │ │ ├── lines.txt │ │ └── sketch.js │ ├── 07_callback_loadStrings_DOM │ │ ├── index.html │ │ ├── lines.txt │ │ └── sketch.js │ ├── 08_callback_loadJSON │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ ├── 08_callback_loadJSON_OOP │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ ├── 09_external_API_weather0 │ │ ├── index.html │ │ └── sketch.js │ ├── 10_external_API_weather1 │ │ ├── index.html │ │ └── sketch.js │ ├── 11_external_API_weather2_14day_forecast │ │ ├── index.html │ │ ├── sketch.js │ │ └── sketch_bind.js │ ├── 12_external_API_nytimes │ │ ├── index.html │ │ └── sketch.js │ ├── callback_clock │ │ ├── index.html │ │ └── sketch.js │ ├── class │ │ ├── data.json │ │ ├── index.html │ │ ├── large.jpg │ │ ├── sketch.js │ │ ├── small.jpg │ │ └── test.csv │ ├── inclass │ │ ├── callbacks │ │ │ ├── index.html │ │ │ └── sketch.js │ │ └── json │ │ │ ├── index.html │ │ │ └── sketch.js │ ├── nytimes_experiments │ │ ├── index.html │ │ └── sketch.js │ └── resize_window │ │ ├── index.html │ │ └── sketch.js ├── week5 │ ├── 00_instance_default_append │ │ ├── index.html │ │ └── sketch.js │ ├── 01_instance_canvas_id │ │ ├── index.html │ │ └── sketch.js │ ├── 02_instance_element_id │ │ ├── index.html │ │ └── sketch.js │ ├── 03_instance_canvas_node │ │ ├── index.html │ │ └── sketch.js │ ├── 04_instance_element_node │ │ ├── index.html │ │ └── sketch.js │ ├── 05_instance_anonymous │ │ ├── index.html │ │ └── sketch.js │ ├── 06_two_instances_diff_sketch │ │ ├── index.html │ │ └── sketch.js │ ├── 07_two_instances_same_sketch │ │ ├── index.html │ │ └── sketch.js │ ├── 08_two_instances_listeners │ │ ├── index.html │ │ └── sketch.js │ ├── 09_buzz_global │ │ ├── buzz.js │ │ ├── dingdong.wav │ │ ├── index.html │ │ ├── rhodes_loop.wav │ │ └── sketch.js │ ├── 10_buzz_instance │ │ ├── buzz.js │ │ ├── index.html │ │ ├── rhodes_loop.wav │ │ └── sketch.js │ ├── 11_popcorn_play_pause │ │ ├── fingers.mov │ │ ├── index.html │ │ ├── popcorn.js │ │ └── sketch.js │ ├── 12_popcorn_end_event │ │ ├── fingers.mov │ │ ├── index.html │ │ ├── popcorn.js │ │ └── sketch.js │ ├── 13_popcorn_events │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ ├── 14_facetracker │ │ ├── fingers.mov │ │ ├── headtrackr.js │ │ ├── index.html │ │ └── sketch.js │ ├── simple_audio │ │ ├── dingdong.wav │ │ ├── index.html │ │ └── sketch.js │ ├── simple_video │ │ ├── fingers.mov │ │ ├── index.html │ │ └── sketch.js │ ├── simple_webcam │ │ ├── index.html │ │ └── sketch.js │ └── toxiclibs │ │ ├── NOC_5_10_SimpleSpring │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ │ ├── NOC_5_11_SoftString │ │ ├── chain.js │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ │ ├── NOC_5_12_SimpleCluster │ │ ├── cluster.js │ │ ├── index.html │ │ ├── node.js │ │ └── sketch.js │ │ ├── NOC_5_13_AttractRepel │ │ ├── index.html │ │ ├── particle.js │ │ └── sketch.js │ │ └── lib │ │ ├── toxichelper.js │ │ └── toxiclibs.js └── week6 │ ├── 01_node_helloworld │ ├── 0_hello.js │ ├── 1_hello.js │ ├── 2_counter.js │ └── 3_paths.js │ ├── 02_node_servefile │ ├── index.html │ └── server.js │ ├── 03_node_servep5 │ ├── index.html │ ├── server.js │ └── sketch.js │ ├── 04_socket_server │ ├── index.html │ ├── package.json │ ├── server.js │ ├── sketch.js │ └── socket.io-1.4.5.js │ ├── 10_touchX_touchY │ ├── index.html │ └── sketch.js │ ├── 11_touch_events │ ├── index.html │ └── sketch.js │ ├── 12_mouse_touch │ ├── index.html │ └── sketch.js │ ├── 13_multi_finger_touch │ ├── index.html │ └── sketch.js │ ├── 20_hammerjs_doubletap │ ├── hammer.js │ ├── index.html │ ├── sketch.js │ └── style.css │ ├── 21_hammerjs_tap_hold │ ├── hammer.js │ ├── index.html │ ├── sketch.js │ └── style.css │ ├── 22_hammerjs_pinch_rotate │ ├── hammer.js │ ├── index.html │ └── sketch.js │ ├── 23_hammerjs_swipe_directions │ ├── hammer.js │ ├── index.html │ ├── sketch.js │ └── style.css │ ├── 24_hammerjs_swipe │ ├── hammer.js │ ├── index.html │ └── sketch.js │ ├── hammerjs_instance │ ├── hammer.js │ ├── index.html │ ├── sketch.js │ └── style.css │ └── p5.js ├── week1 ├── 00_empty_html_js_example │ └── index.html ├── 01_p5_empty_example │ ├── index.html │ ├── p5.js │ └── sketch.js ├── 02_p5_simple_example │ ├── index.html │ └── sketch.js ├── 03_processing_p5_conversion_0 │ ├── examples-basics-form-bezier.pde │ ├── index.html │ └── sketch.js ├── 04_processing_p5_conversion_1 │ ├── examples-basics-form-bezier.pde │ ├── index.html │ └── sketch.js ├── 05_processing_p5_conversion_2 │ ├── examples-topics-interaction-follow3.pde │ ├── index.html │ └── sketch.js ├── 06_array_of_numbers │ ├── index.html │ └── sketch.js ├── 07_array_of_images │ ├── burger.png │ ├── chickens.jpg │ ├── fish.png │ ├── flower.png │ ├── index.html │ └── sketch.js └── p5 │ ├── addons │ ├── p5.dom.js │ └── p5.sound.js │ ├── empty-example │ ├── index.html │ └── sketch.js │ └── p5.min.js ├── week2 ├── 00_objects │ ├── index.html │ ├── p5.js │ └── sketch.js ├── 01_multiple_objects │ ├── index.html │ ├── p5.js │ └── sketch.js ├── 02_objects_2 │ ├── index.html │ ├── p5.js │ └── sketch.js ├── 03_array_of_objects │ ├── index.html │ ├── p5.js │ └── sketch.js ├── 04_objects_without_p5.html ├── 05_basic_html.html ├── 06_servi_hello_world │ ├── .tmpscript │ ├── package.json │ └── server.js ├── 07_servi_serve_static │ ├── .tmpscript │ ├── package.json │ ├── public │ │ ├── index.html │ │ └── other.html │ ├── server-exported.js │ └── server.js └── bubbles.jpg ├── week3 ├── 01_css │ ├── 00_simple_css.html │ └── 01_external_css_file │ │ ├── index.html │ │ └── style.css ├── 02_dom_pure_js │ ├── 01_DOM_basics.html │ ├── 02_setTimeout.html │ ├── 03_setInterval.html │ ├── 04_rotating_text.html │ ├── 05_rotating_src.html │ ├── 06_addEventListener.html │ ├── 07_addEventListener_with_this.html │ ├── 08_mouseover_mouseout copy.html │ ├── 09_window_resize.html │ ├── 10_window_load.html │ └── images │ │ ├── colors.jpg │ │ ├── cookies.jpg │ │ ├── people.jpg │ │ ├── princess.jpg │ │ └── sander.jpg ├── 03_dom_jquery │ ├── index.html │ └── sketch.js ├── 04_dom_p5 │ ├── 00_canvas_parent │ │ ├── index.html │ │ └── sketch.js │ ├── 01_position_canvas │ │ ├── index.html │ │ └── sketch.js │ ├── 03_add_p_element │ │ ├── index.html │ │ └── sketch.js │ ├── 04_parent_child │ │ ├── index.html │ │ └── sketch.js │ ├── 05_style_functions │ │ ├── index.html │ │ └── sketch.js │ ├── 06_style_css │ │ ├── index.html │ │ ├── sketch.js │ │ └── style.css │ ├── 07_setting_class │ │ ├── index.html │ │ ├── sketch.js │ │ └── style.css │ ├── 08_mousepressed │ │ ├── index.html │ │ └── sketch.js │ ├── 09_mouseover_mouseout │ │ ├── index.html │ │ ├── rainbow.png │ │ └── sketch.js │ ├── 10_getElement │ │ ├── index.html │ │ └── sketch.js │ ├── 11_getElements │ │ ├── index.html │ │ └── sketch.js │ ├── 13_animateDOM │ │ ├── index.html │ │ └── sketch.js │ ├── 14_button_slider │ │ ├── ball.js │ │ ├── index.html │ │ └── sketch.js │ └── 15_wordscrambler │ │ ├── index.html │ │ └── sketch.js └── 05_objects │ ├── 01_objects_p5 │ ├── index.html │ ├── p5.js │ └── sketch.js │ ├── 02_multiple_objects_p5 │ ├── index.html │ ├── p5.js │ └── sketch.js │ ├── 03_objects_2_p5 │ ├── index.html │ ├── p5.js │ └── sketch.js │ ├── 04_array_of_objects_p5 │ ├── index.html │ ├── p5.js │ └── sketch.js │ └── 05_objects_without_p5.html ├── week4 └── servi_serve_static │ ├── .tmpscript │ ├── package.json │ ├── public │ ├── index.html │ └── other.html │ ├── server-exported.js │ └── server.js ├── week5 ├── 00_callback_setTimeout.html ├── 01_p5_examples │ ├── 00_loadStrings │ │ ├── index.html │ │ ├── lines.txt │ │ └── sketch.js │ ├── 01_loadStrings_p5.dom │ │ ├── index.html │ │ ├── lines.txt │ │ ├── p5.dom.js │ │ └── sketch.js │ ├── 02_loadJSON │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ ├── 03_loadJSON_OOP │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ ├── 04_loadXML │ │ ├── data.xml │ │ ├── index.html │ │ └── sketch.js │ ├── 05_external_API_weather0 │ │ ├── index.html │ │ └── sketch.js │ ├── 06_external_API_weather1 │ │ ├── index.html │ │ └── sketch.js │ ├── 07_external_API_nytimes │ │ ├── index.html │ │ └── sketch.js │ ├── 08_preload_loadStrings │ │ ├── index.html │ │ ├── lines.txt │ │ └── sketch.js │ ├── 09_preload_loadJSON │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ ├── 10_callback_clock │ │ ├── index.html │ │ ├── p5.dom.js │ │ └── sketch.js │ ├── 11_resize_window │ │ ├── index.html │ │ ├── p5.dom.js │ │ └── sketch.js │ ├── 12_weekly_weather_viz │ │ ├── index.html │ │ ├── p5.js │ │ └── sketch.js │ └── 13_weather_motion_input │ │ ├── index.html │ │ ├── p5.dom.js │ │ ├── p5.js │ │ └── sketch.js ├── 02_jquery_examples │ ├── 00_ajax_text │ │ ├── index.html │ │ ├── lines.txt │ │ └── sketch.js │ ├── 01_ajax_json │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ ├── 02_ajax_json_external_API │ │ ├── index.html │ │ └── sketch.js │ ├── 03_getJSON_json │ │ ├── data.json │ │ ├── index.html │ │ └── sketch.js │ └── 04_getJSON_json_external_API │ │ ├── index.html │ │ └── sketch.js ├── 03_servi_examples │ ├── .tmpscript │ └── 01_serve_json │ │ ├── .tmpscript │ │ ├── package.json │ │ ├── public │ │ ├── index.html │ │ └── other.html │ │ └── server.js └── 04_instagram_example │ ├── index.html │ ├── p5.dom.js │ ├── p5.js │ └── sketch.js └── week6 ├── 00_serve_static ├── public │ ├── index.html │ └── other.html └── server.js ├── 01_programmatic_response └── server.js ├── 02_server_variables └── server.js ├── 03_routing └── server.js ├── 04_routing_multiple_paths └── server.js ├── 05_routing_multiple_paths2 └── server.js ├── 06_routing_with_params └── server.js ├── 07_routing_with_params_data └── server.js ├── 08_routing_with_params_data2 └── server.js ├── 09_create_db ├── people.db └── server.js ├── 10_create_db2 ├── people.db └── server.js ├── 11_db_add ├── people.db └── server.js ├── 12_db_search ├── people.db └── server.js ├── 13_serve_json ├── people.db └── server.js ├── 16_template_loop ├── mytemplate.html └── server.js └── extra ├── 03-servi-form-get ├── form.html └── server.js └── 04-servi-form-post ├── form.html └── server.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules -------------------------------------------------------------------------------- /Spring-2014/ideas.md: -------------------------------------------------------------------------------- 1 | ###prior workshops and classes (p5) 2 | * http://is.gd/dm7021 - RISD F13 3 | * http://p5js.org/workshop/ - UCLA workshop W13 4 | 5 | ###ideas for "weekly" topics for syllabus 6 | 1. INTRO 7 | * basic intro to JS and JS syntax (from Processing -> JS) - variables, conditionals, loops, simple objects, functions arrays 8 | * intro to workflow with p5.js: sublime, python SimpleHTTPServer, JS console 9 | * what is p5.js behind the scenes? 10 | * assignment: recreate an ICM homework in p5.js 11 | 2. OOP / "functional" stuff 12 | 3. p5.js with DOM elements 13 | 4. p5.js with data / APIs (callbacks) 14 | 5. p5.js reveal -- namespacing, p5.js with other JS frameworks and things? 15 | * JQuery 16 | * box2d, toxiclibs? 17 | * html5 video / popcorn.js 18 | * webrtc / video? 19 | 6. something about connecting to hardware and stuff with node?, mobile? debugging techniques for js 20 | 7. final project presentions 21 | -------------------------------------------------------------------------------- /Spring-2014/week1/array_of_images/burger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/Spring-2014/week1/array_of_images/burger.png -------------------------------------------------------------------------------- /Spring-2014/week1/array_of_images/chickens.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/Spring-2014/week1/array_of_images/chickens.jpg -------------------------------------------------------------------------------- /Spring-2014/week1/array_of_images/fish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/Spring-2014/week1/array_of_images/fish.png -------------------------------------------------------------------------------- /Spring-2014/week1/array_of_images/flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/Spring-2014/week1/array_of_images/flower.png -------------------------------------------------------------------------------- /Spring-2014/week1/array_of_images/index.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Spring-2014/week1/array_of_images/sketch.js: -------------------------------------------------------------------------------- 1 | // Using a for loop to initialize values. 2 | // Using a for loop to draw. 3 | // Adapted from Getting Started with Processing. 4 | 5 | var images = []; 6 | var curImage = 0; 7 | 8 | function setup() { 9 | 10 | createCanvas(500, 500); 11 | imageMode(CENTER); 12 | 13 | // Add some more images to the array 14 | 15 | var fish = loadImage("fish.png"); 16 | 17 | images.push(fish); 18 | 19 | var burger = loadImage("burger.png"); 20 | images.push(burger); 21 | 22 | images.push(loadImage("chickens.jpg")); 23 | 24 | } 25 | 26 | function draw() { 27 | 28 | background(120, 204, 50); 29 | 30 | // Draw image 31 | image(images[curImage], width/2, height/2, images[curImage].width, images[curImage].height); 32 | 33 | }; 34 | 35 | 36 | function mousePressed() { 37 | 38 | // Increment curImage 39 | curImage = curImage + 1; 40 | 41 | // Make sure curImage is still in range, loop around if necessary 42 | if (curImage == images.length) { 43 | curImage = 0; 44 | print("curimage "+curImage); 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /Spring-2014/week1/array_of_numbers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Spring-2014/week1/array_of_numbers/sketch.js: -------------------------------------------------------------------------------- 1 | // Adapted from Getting Started with Processing 2 | 3 | 4 | var x = []; 5 | 6 | function setup() { 7 | 8 | createCanvas(600, 400); 9 | noStroke(); 10 | fill(255, 152, 0); 11 | 12 | for (var i=0; i<100; i++) { 13 | x.push(random(0, width)); 14 | //x[i] = random(0, width); // works the same 15 | } 16 | } 17 | 18 | function draw() { 19 | 20 | background(126, 138, 162); 21 | 22 | for (var i=0; iThis is a paragraph
19 |This is a paragraph
20 |This is a paragraph
21 | 22 |This is a paragraph
19 |This is a paragraph
20 |This is a paragraph
21 | 22 |Hold the mouse down over the circle to play the video. Wait for the end!
15 | -------------------------------------------------------------------------------- /Spring-2014/week5/13_popcorn_events/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Spring-2014/week5/13_popcorn_events/particle.js: -------------------------------------------------------------------------------- 1 | // Learning Processing 2 | // Daniel Shiffman 3 | // http://www.learningprocessing.com 4 | 5 | // Example 9-11 ported to p5.js 6 | 7 | function Particle() { 8 | this.x = random(width); 9 | this.y = random(height); 10 | this.w = 16; 11 | this.speed = 0; 12 | } 13 | 14 | Particle.prototype.gravity = function() { 15 | // Add gravity to speed 16 | this.speed = this.speed + gravity; 17 | }; 18 | 19 | Particle.prototype.move = function() { 20 | // Add speed to y location 21 | this.y = this.y + this.speed; 22 | // If square reaches the bottom 23 | // Reverse speed 24 | if (this.y > height) { 25 | this.speed = this.speed * -0.95; 26 | this.y = height; 27 | } 28 | }; 29 | 30 | Particle.prototype.display = function() { 31 | // Display the circle 32 | fill(101); 33 | stroke(255); 34 | ellipse(this.x,this.y,this.w,this.w); 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /Spring-2014/week5/14_facetracker/fingers.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/Spring-2014/week5/14_facetracker/fingers.mov -------------------------------------------------------------------------------- /Spring-2014/week5/14_facetracker/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Spring-2014/week5/14_facetracker/sketch.js: -------------------------------------------------------------------------------- 1 | // https://github.com/auduno/headtrackr 2 | // http://auduno.github.io/headtrackr/documentation/reference.html 3 | 4 | var x,y,w,h; 5 | 6 | function setup() { 7 | createCanvas(320, 240); 8 | 9 | var videoInput = document.getElementById('inputVideo'); 10 | var canvasInput = document.getElementById('debugCanvas'); 11 | 12 | var htracker = new headtrackr.Tracker({ui: false, debug: canvasInput}); 13 | htracker.init(videoInput, canvasInput); 14 | htracker.start(); 15 | 16 | // drawFace() is a callback for when facetracker finds the face 17 | document.addEventListener('facetrackingEvent', drawFace); 18 | } 19 | 20 | function draw() { 21 | background(255, 0, 200); 22 | noStroke(); 23 | fill(0); 24 | ellipse(x,y,w,h); 25 | } 26 | 27 | // Taking the face data and copying over to global variables 28 | // This will only work for one face 29 | function drawFace(event) { 30 | x = event.x; 31 | y = event.y; 32 | w = event.width; 33 | h = event.height; 34 | } -------------------------------------------------------------------------------- /Spring-2014/week5/simple_audio/dingdong.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/Spring-2014/week5/simple_audio/dingdong.wav -------------------------------------------------------------------------------- /Spring-2014/week5/simple_audio/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Spring-2014/week5/simple_audio/sketch.js: -------------------------------------------------------------------------------- 1 | // Sound 2 | var sound; 3 | 4 | 5 | function setup() { 6 | createCanvas(320,240); 7 | 8 | sound = createHTML(''); 9 | sound = document.getElementById('doorbell'); 10 | 11 | createHTML('Click mouse to play sound.
'); 12 | } 13 | 14 | function draw() { 15 | background(51); 16 | } 17 | 18 | function mousePressed() { 19 | sound.play(); 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /Spring-2014/week5/simple_video/fingers.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/Spring-2014/week5/simple_video/fingers.mov -------------------------------------------------------------------------------- /Spring-2014/week5/simple_video/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Spring-2014/week5/simple_webcam/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Spring-2014/week5/toxiclibs/NOC_5_10_SimpleSpring/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |hellooo
9 | 10 | -------------------------------------------------------------------------------- /week2/07_servi_serve_static/public/other.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |I am the other page.
9 | 10 | -------------------------------------------------------------------------------- /week2/07_servi_serve_static/server-exported.js: -------------------------------------------------------------------------------- 1 | var servi = require('servi'); 2 | 3 | var app = new servi(true); 4 | 5 | 6 | serveFiles("public"); 7 | 8 | 9 | if (typeof run === 'function') { 10 | app.defaultRoute(run); 11 | } 12 | start(); -------------------------------------------------------------------------------- /week2/07_servi_serve_static/server.js: -------------------------------------------------------------------------------- 1 | serveFiles("public"); -------------------------------------------------------------------------------- /week2/bubbles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/week2/bubbles.jpg -------------------------------------------------------------------------------- /week3/01_css/00_simple_css.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 20 |I'm a paragraph in the first section.
23 |I'm a paragraph in the first section with class donkeys.
24 |I'm a paragraph in the second section.
29 |I'm a paragraph in the second section with class donkeys.
30 |I'm a paragraph in the first section.
9 |I'm a paragraph in the first section with class donkeys.
10 |I'm a paragraph in the second section.
15 |I'm a paragraph in the second section with class donkeys.
16 |I love gargoyles.
5 | 6 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /week3/02_dom_pure_js/03_setInterval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |I see 0 gargoyles.
5 | 6 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /week3/02_dom_pure_js/06_addEventListener.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |I love pandas.
5 | 6 | 22 | 23 | -------------------------------------------------------------------------------- /week3/02_dom_pure_js/08_mouseover_mouseout copy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 |I love pandas.
5 | 6 | 21 | 22 | -------------------------------------------------------------------------------- /week3/02_dom_pure_js/10_window_load.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 18 |I love pandas.
19 | 20 | -------------------------------------------------------------------------------- /week3/02_dom_pure_js/images/colors.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/week3/02_dom_pure_js/images/colors.jpg -------------------------------------------------------------------------------- /week3/02_dom_pure_js/images/cookies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/week3/02_dom_pure_js/images/cookies.jpg -------------------------------------------------------------------------------- /week3/02_dom_pure_js/images/people.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/week3/02_dom_pure_js/images/people.jpg -------------------------------------------------------------------------------- /week3/02_dom_pure_js/images/princess.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/week3/02_dom_pure_js/images/princess.jpg -------------------------------------------------------------------------------- /week3/02_dom_pure_js/images/sander.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lmccart/itp-creative-js/1f9a0dfd2262e2003698e93edb7825efa95f8c65/week3/02_dom_pure_js/images/sander.jpg -------------------------------------------------------------------------------- /week3/03_dom_jquery/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |This is a paragraph. and a link.
11 | 12 | -------------------------------------------------------------------------------- /week3/03_dom_jquery/sketch.js: -------------------------------------------------------------------------------- 1 | // ITP Networked Media, Fall 2014 2 | // DOM Manipulation 3 | // https://github.com/shiffman/itp-networked-media 4 | // Daniel Shiffman 5 | 6 | // Let's look quickly at some JQuery for comparison 7 | 8 | // This is like the 'load' window event 9 | $(document).ready(function() { 10 | console.log("the dom is loaded!"); 11 | 12 | // Elements are selected via '$' 13 | // css() sets a stytle 14 | $('#stuff').css('background-color','pink'); 15 | $('#stuff').css('width','50%'); 16 | $('#stuff').css('padding','10px'); 17 | // This is assigning a mouse downevent 18 | $('#clicky').mousedown(function() { 19 | console.log("clickedme!"); 20 | // innerHTML changed with html() 21 | $('h1').html('You clicked it!'); 22 | }); 23 | }); -------------------------------------------------------------------------------- /week3/04_dom_p5/00_canvas_parent/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |Press 'a', 'b', or 'p' to hide an element.
Press space to show all elements.
apple
32 |banana
33 |pear
34 | 35 | 36 | -------------------------------------------------------------------------------- /week3/04_dom_p5/10_getElement/sketch.js: -------------------------------------------------------------------------------- 1 | // ITP Networked Media, Fall 2014 2 | // DOM Manipulation 3 | // https://github.com/shiffman/itp-networked-media 4 | // Daniel Shiffman 5 | 6 | // These are adapted from https://github.com/lmccart/itp-creative-js 7 | 8 | // Three variables to hold our DOM elements 9 | var apple; 10 | var banana; 11 | var pear; 12 | 13 | function setup() { 14 | noCanvas(); 15 | // Instead of making the elements here we can just grab them 16 | // via their id (see index.html) 17 | apple = getElement('apple'); 18 | banana = getElement('banana'); 19 | pear = getElement('pear'); 20 | } 21 | 22 | // Hide and show them depending on what key was pressed 23 | function keyPressed() { 24 | if (key == 'A') { 25 | apple.hide(); 26 | } else if (key == 'B') { 27 | banana.hide(); 28 | } else if (key == 'P') { 29 | pear.hide(); 30 | } else if (key == ' ') { 31 | apple.show(); 32 | banana.show(); 33 | pear.show(); 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /week3/04_dom_p5/11_getElements/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 18 | 19 | 20 | 21 | 22 | 23 |1 apple
24 |2 apples
25 |3 apples
26 | 27 | 28 | -------------------------------------------------------------------------------- /week3/04_dom_p5/11_getElements/sketch.js: -------------------------------------------------------------------------------- 1 | // ITP Networked Media, Fall 2014 2 | // DOM Manipulation 3 | // https://github.com/shiffman/itp-networked-media 4 | // Daniel Shiffman 5 | 6 | // These are adapted from https://github.com/lmccart/itp-creative-js 7 | // Creating other HTML elements, adding style. 8 | 9 | function setup() { 10 | noCanvas(); 11 | 12 | var link = getElement("clicky"); 13 | link.mousePressed(shuffle); 14 | } 15 | 16 | 17 | function shuffle() { 18 | // Get an array of elements of the same class 19 | var apples = getElements("apple"); 20 | // Do something to all of them 21 | for (var i=0; i