Overview
This lab is intended to help start your Assignment 6. Refer to the assignment requirements while you are working on this lab.
Sample
Requirements
- Code set-up
- Create the following new files:
-
todolist.html
file, style.css
file, andmain.js
file.
-
- Include the jQuery library in your
.html
file. - Write all your CSS in the
.css
file.- Link your
.css
file into the.html
file.
- Link your
- Write all your JavaScript in the
.js
file.- You can add your
.js
file in your.html
file by using<script src="name_of_file.js"></script>
- Use jQuery for all your DOM manipulation and event listening. You will write very little pure JS.
- Note you can still use JavaScript along with jQuery. For example:
$("button").on("click", function() { let isOn = true; // JS way of creating variables if( isOn == true) { // JS way of if/else statements $("input").val("The app is on"); } });
- You can add your
- Create the following new files:
- Simple HTML structure
- Before working on adding/deleting items or styling the app, create a basic HTML structure that will help you start the assignment.
- Create an area at the top of the page with some text about today’s weather. A placeholder is fine for now.
- Below the weather information, create a container that will hold all your to do list items. Make this container somewhere between 400 and 600px wide.
- At the top of the to do list, create a heading that displays “To Do List.”
- Below the heading, add an input area that allows users to type in a to do item here.
- Below the input, use the
<ul>
tag to create a list of at least three to do items. - Within the list item, add a placeholder for the “square” icon. This can simply be a character for now (In the sample, it is the
X
). Later, you can replace this character with the icon from Font Awesome library.
- Simple CSS
- In your newly created
.css
file, add some basic CSS to help you get started. - Add a border around the weather and to do list.
- Set a width to the weather and to do list.
- Center the weather and to do list to the browser.
- That’s sufficient for the lab. Feel free to add more CSS if you’d like.
- In your newly created
- Weather API information is displayed at the top of the page.
- Get Los Angeles’s weather information from the Weatherbit.io’s API. Sign up for a free account to obtain an API key.
- Read their documentation to find out how to get Los Angeles’ current temperature (in Fahrenheit), a short weather description and the apparent temperature (what it “feels like”).
- Start by looking for the endpoint of the API. What’s the URL you need to hit to communicate with this service?
- Use jQuery’s ajax method get the information from Weatherbit.
Submission/Upload to the server
Please follow the submission requirements below carefully. You will be deducted points for not following submission requirements to the teeth.
- Open FileZilla and connect to the itpwebdev server as you have done in Lab 1 (click File -> Site Manager). If you forgot how to connect, follow this guide on how to connect and upload files to the itpwebdev web server.
- After you have successfully connected to the itpwebdev server, created a folder (aka directory) named
lab6
inside thepublic_html
folder. Then upload this assignment HTML file and images to thelab6
folder. Refer to the guide if you’re not sure how to upload the assignment file. - In your browser, go to
http://303.itpwebdev.com/~yourusername/lab6/todolist.html
to check that the assignment file has been uploaded correctly. - One last thing. In your computer, open up
student_page.html
that you created in Lab 1. Add a link to this assignment tostudent_page.html
under the heading “Assignments” so that the TAs can easily access your completed assignment. - Upload the updated
student_page.html
to the itpwebdev server via FileZilla inside thepublic_html
folder. If it asks you want to overwrite the previous file, click Yes. - (Optional) If you are having trouble uploading to the server and cannot upload on time, add all files for this assignment in a folder, compress it as a .zip file and upload it to Blackboard. On Blackboard, go to Assignments -> Lab 6: To Do List Starter. You will get some points deducted for not uploading correctly but at least you will not get a zero.