At times, the instructor will assign small, focused projects to practice specific skills. Read them carefully, as they may have different types of submissions and relative due dates, depending on the project.
- Tiny Project #1: Codepen Recipe (from Unit 1, Lesson 7)
- Tiny Project #2: Responsive Recipe (from Unit 1, Lesson 10)
- Tiny Project #3: Interactive Recipe (from Unit 2, Lessons 0-4)
- Tiny Project #4: Object-AJAX Recipe (from Unit 2, Lessons 5-6)
- Tiny Project #5: Multiple Recipes via AJAX (from Unit 2, Lesson 12)
- Tiny Project #6: Recipes with AJAX + PHP + JSON (from Unit 3, Lesson 7)
- Tiny Project #7: Recipes + MySQL (from Unit 3, Lesson 14)
Extra credit Tiny Projects are also listed here:
- Tiny Project Extras #1: Color Swatch (from Unit 2, Lesson 9)
Tiny Project #1: Codepen Recipe
- Watch the recorded lecture “Unit 1, Lesson 7” on Blackboard.
- Go to Tor’s recipe example at bit.ly/477-recipe-example.
- Fork the codepen to your own account and save it to a new name.
- Find your own recipe (an actual recipe someone could cook) and replace the example’s ingredients, equipment, and directions with yours. (Look on AllRecipes.com or other recipe sites if you need inspiration.)
- Watch your formatting: open and close the tags correctly!
- Using HTML classes and IDs, and CSS selectors, target and style the subtitles and the list items:
- Change at least two visible aspects of the list items. For example: color, font-style, font-family, font-weight, etc. Feel free to explore the CSS references for things to try.
- Add a Google Font and use it on at least one element.
- Add IDs and classes to the HTML as necessary to select specific items.
- Determine 2 particularly important items in the lists and use CSS to highlight them.
- To submit: Save your codepen and share the URL on the Tiny Project #1 discussion board on Blackboard.
Tiny Project #2: Responsive Recipe
In Codepen, fork your recipe from Tiny Project #1 to a new Codepen, then edit/add HTML and CSS as necessary to:
- Add a relevant image that appears above the 3 list sections. Use Unsplash or other free image resources.
- Make the 3 lists (ingredients, equipment, directions) appear in a row of 3 boxes when in landscape (desktop-style) mode.
- Make the 3 lists appear in a column of 3 boxes when in portrait (mobile-style) mode.
- Make at least one aspect of the layout different at a very small width (575px or less).
- Add at least one more HTML block of content of your choice and use CSS to style it nicely for both landscape and portrait style.
onlyprimarily relative units in your CSS.
- To submit: Save your codepen and share the URL on the Tiny Project #2 discussion board on Blackboard.
- Due date: this is due by midnight on Wednesday, September 23, 2020.
If you’re not sure what the visual output should be, the illustration below may help.
Tiny Project #3: Interactive Recipe
Your CodeAnywhere should be set up with your Reclaim Hosting as described in Unit 2, Lesson 0. Make sure you have watched Lessons 1-4. Then, starting with your recipe from Tiny Project #2 in Codepen…
- Create a new folder on your web hosting called “tp3”.
- As demonstrated in Unit 2, Lesson 2, use the provided HTML skeleton to convert your TP2 recipe into a complete working web page with three files in /tp3: index.html, styles.css, and scripts.js. (The instructor’s example is online.)
- Your web page must still maintain its responsiveness as described in TP2.
- To submit: Save your HTML page (not your codepen, sorry) and share the URL on the Tiny Project #3 discussion board on Blackboard.
- Due date: this is due by midnight on
Sunday, October 4, 2020Monday, October 5, 2020.
Tiny Project #4: Object-AJAX Recipe
Your CodeAnywhere should be set up with your Reclaim Hosting as described in Unit 2, Lesson 0, and your TP2 should have been copied over as you followed along in Unit 2, Lesson 2 — if not as part of TP3. Make sure you have watched all the lessons through Lesson 6, which includes the instructor’s demo of this Tiny Project. Then, starting with your basic recipe…
- Using CodeAnywhere, copy the recipe HTML and CSS files to a new folder, “tp4”.
- Note: in the recorded lecture for Unit 2, Lesson 6, I was unclear about where I got my TP2 source code on CodeAnywhere. It’s the result of Unit 2, Lesson 2, which demonstrates the differences between Codepen and CodeAnywhere, and migrates the recipe layout from Codepen to CodeAnywhere.
- Simplify the TP4 design to just the title, image, and 3 columns of instructions.
- Add “Contributed by” text somewhere in the layout with your name and adjust CSS as necessary.
- Strip down the HTML layout to a recipe skeleton page:
- Copy the HTML for the 3 columns of instructions to a separate HTML file that only has that snippet of HTML in it, without any tags such as <html> or <body> or other elements on the page.
- Then, delete the 3 columns from the recipe skeleton.
- Delete the title and “contributed by” name of the recipe so these are just empty HTML tags.
- If you are using an <img> tag for the recipe image, make the src attribute empty, just “”.
- Or, if you are using CSS background-image for the recipe image, set that value to none.
- Name/title of the recipe
- URL to the image
- Filename of the recipe HTML you copied out earlier
- Name of the contributor (you)
- Add a method to the constructor that displays the recipe by updating the HTML elements on the page with the object’s own data. (Suggestion: just get one thing working first, such as the recipe title/name.)
- Create a new recipe object using the constructor and all the relevant info.
- Using window.onload, have the browser initiate that method on that object so the page displays your recipe.
- To submit: Save your HTML page and share the URL on the Tiny Project #4 discussion board on Blackboard.
- Due date: this is due by midnight on Sunday, October 11, 2020.
Tiny Project #5: Multiple Recipes via AJAX
As described and demonstrated in Unit 2, Lesson 12…
- Make sure TP4 is working, then copy it to a “/tp5” directory on your server.
- Modify the HTML, AJAX, and HTML snippets/files so that the 3 columns of information — ingredients, equipment, and directions — are now separately loaded files of HTML, instead of all in one file.
- This means the recipe object will have all these characteristics:
- Recipe Title
- Image URL
- Contributor name
- Filename for ingredients
- Filename for equipment
- Filename for directions
- Modify the HTML and CSS to add navigation to the page for 5 recipe choices: a menu, a row of buttons/links, etc.
- Go to the Tiny Project #2 discussion forum on Blackboard and randomly select 4 recipes from your classmates.
- Copy the HTML for their ingredients, equipment, and directions into HTML snippets on your web server. Also note the recipe title, the URL of the image source, and the name of the student.
- Add these as clickable links in your navigation to update the display.
- To submit: Save your files and share the URL on the Tiny Project #5 discussion board on Blackboard.
- Due date: this is due by midnight on Sunday, October 25, 2020.
Tiny Project #6: Recipes with AJAX + PHP + JSON
As described and demonstrated in Unit 3, Lesson 7…
- Make sure TP5 is working, then copy it to a “/tp6” directory on your server. (This can be inside your /unit3 directory if you made that during a previous lesson.)
- Don’t forget to check the permissions for the new directory.
- Recipe Title
- Image URL
- Contributor name
- Recipe ID
- Create a new PHP file to respond to AJAX requests.
- Previously, in TP5, you had put the 3 columns of information — ingredients, equipment, and directions — into separately loaded files of HTML. Now, in your new PHP file, convert those ingredients into a PHP multidimensional array:
- The first dimension of the array will be the recipe’s ID (from above).
- The second dimension of the array will be “ingredients”, “equipment”, and “directions”.
- For each of those, the third dimension of the array will contain the line items from those lists, one line per array element
- Write PHP to accept two parameters through a GET request: a recipe ID and list selection: “ingredients”, “equipment”, or “directions”. PHP should sanitize the requests as described in class.
- Using if statements in PHP, determine the output from the array, encode it as JSON, and output it.
- If the parameters don’t match an existing recipe or list, return a value that indicates this error.
- Update the HTML to include the headers for the 3 sections inside their <div> tags, plus empty lists (<ul> or <ol>).
- You may need to empty the lists first.
- If the AJAX response is an error (see above) then don’t update the display.
- As described in an earlier class, you should have Debuggr installed so the instructor can study your PHP code. If your /tp6 directory is not in your /unit3 directory, then install Debuggr in your /tp6 directory as well.
- To submit: Save your files and share the URL on the Tiny Project #6 discussion board on Blackboard.
- Due date: this is due by midnight on Sunday, November 15, 2020.
Tiny Project #7: Recipes + MySQL
As described and demonstrated in Unit 3, Lesson 14…
- Make sure TP6 is working, then copy it to a “/tp7” directory on your server. (This can be inside your /unit3 directory if you made that during a previous lesson.)
- Don’t forget to check the permissions for the new directory.
- Create a new file called “database.php” and copy into it the code contents from the demo “database.php” file (linked from the presentation slides). The file has several variables to set:
- $databaseServer = “”; // IP number of database, may be on the same server
- $databaseName = “”; // database name
- $databaseUser = “”; // database username
- $databasePassword = “”; // database user password
- Log into cPanel and set up a new database, recording the server information in your database.php file as noted above.
- Log into phpMyAdmin and set up 3 tables in the database named “ingredients”, “equipment”, and “directions”.
- You are welcome to label the tables more abstractly, such as “output1”, “output2”, and “output3”, depending on how you have previously structured your arrays.
- Each table should have these columns, named exactly as shown and demonstrated:
- id: integer, auto-incremented unique identifier
- name: varchar(100), name of the recipe
- sequence: integer(2), step in the process
- content: varchar(1000), contents of this text
- timestamp: timestamp, auto-updated to CURRENT time
- Create a new file called “records.php” and copy into the code contents from the demo “records.php” file (linked from the presentation slides).
- If you named your tables abstractly, look in the PHP to change the names of the tables where indicated by the comments.
- Using the records.php form, populate your database, item by item, with the contents of your recipes.
- You should be able to refresh the “Browse” tab in phpMyAdmin and see the data updating.
- Edit recipes.php as noted in the demonstration (and in the presentation slides).
- Edit scripts.js as noted in the demonstration (and in the presentation slides).
- To submit: Save your files and share the URL on the Tiny Project #7 discussion board on Blackboard.
- Due date: this is due by midnight on Monday, December 14, 2020.
Tiny Project Extras #1: Color Swatch
THIS TINY PROJECT IS STRICTLY EXTRA CREDIT.
- Fill in the .lightenColor() method so the “up” arrow increases color lightness.
- Fill in the .darkenColor() method so the “down” arrow decreases color lightness.
- Add a second swatch which still obeys all the keypresses, updates the URL, and can be read from the URL
This EXTRA CREDIT is due by midnight on Sunday, October 18, 2020 as a complete URL submitted via Blackboard.