You only get credit for code or work you do yourself and demonstrates your learning.
You will not get credit for code you did not write yourself.
While the task maybe to implement a program, the work you need to do for this class is to learn the material. AI is not good at that.
The policy for this course:
For full details, see the syllabus on Canvas and the Gen AI in Projects Guidelines
(see also: https://websitesfromhell.net/)
"use this color and font for the first paragraph in the article; this picture for the page's background..."
/* A rule with many properties */
h1 {
font-family: 'Helvetica';
color: white;
background-color: #333; /*dark gray*/
}
"font"
selector: apply to all <h1> elements
style.css
h1 {
font-family: 'Helvetica';
color: white;
background-color: #333; /*dark gray*/
}
<head>
<link rel="stylesheet" href="my-style.css">
</head>
<head>
relation between this page and reference
no content,
no closing tag
font-family
: the "font" (list alternates separated by commas)
font-size
: the size of the text
font-weight
: boldness
color
: text color
background-color
: element's background
padding
: the space around an element
<!-- HTML -->
<p>This text has <i>emphasis!</i></p>
/* CSS */
em {
font-style: normal;
text-decoration: underline;
}
why is this italicized?
change what emphatic text looks like
HTML describes the meaning, not what it looks like!
<!-- HTML -->
<p>This text has <em>emphasis!</em></p>
says nothing about appearance!
Have a rule apply to only a particular elements by specifying those elements' class attribute and then using that class as the selector in the CSS
/* CSS */
.highlighted {
background-color: yellow;
}
<!-- HTML -->
<p class="highlighted">This text is highlighted!</p>
dot specifies class name, not tag name
<!-- HTML -->
<p class="rebel">Leia Organa</p>
<p class="imperial">Darth Vader</p>
/* CSS */
.rebel {
color: red;
}
.imperial {
color: gray;
}
Multiple rules can apply to the same element (in a "cascade").
p { /* applies to all paragraphs */
font-family: 'Helvetica'
}
.alert { /* applies to all elements with class="alert" */
font-size: larger;
}
.success { /* applies to all elements with class="success" */
color: #28a745; /* a pleasant green */
}
<p class="alert success">
This paragraph will be in Helvetica font, a larger
font-size, and green color, because all 3 of the above
rules apply to it.
</p>
two classes (space separated)
pwd
ls
cd folder
/absolute/path/to/file
relative/path/to/file
leading slash
.
..
# if I start here:
$ pwd
/Users/iguest/Desktop
# and then do this:
$ cd ../Desktop/lectures/.././../
#where do I end up?
# if I start here:
$ pwd
/Users/iguest/Desktop
# and then do this:
$ cd /../Desktop
#where do I end up?
mkdir
rm
cp
open
start
echo "message"
In this class we'll run multiple applications (programs) through the command line.
Instead of opening a program by clicking on it, you'll execute a program through a CLI command.
CLI apps we'll use:
npm is a command line package manager ("app store") that comes with Node.js. Used to manage external libraries and applications.
npm install -g PACKAGE_NAME
to
globally
(whole computer) install command line programs.
npx
PACKAGE_NAME
to download and run without installing
npm install PACKAGE_NAME
to
locally (per project) install a new code package and record it in the
package.json file.
npm install
to
locally install all of the package.json listed dependencies for a project.
cd path/to/project
npx live-server .
where index.html is!
dot to serve entire folder
You can run a local development server by using the live-server application on the command line.
Access the webpage at http://localhost:8080/index.html
Stop the server by using ctrl+c in the command shell.
Exercises contain test suites that you can use to check your work. Run these tests using the Jest test framework:
Optional: install jest globally (or just use npx)
npm install -g jest
Run a particular test suite (e.g., for problem-name.spec.js):
npx jest problem-name
# or if installed:
jest problem-name
Install the dependencies listed in package.json
# must be in project dir
npm install
Finish the "Start Here" steps on Canvas (if you haven't yet)
Complete task list for Week 1 (all items)
Do all readings (skim at least)
Videos "optional" unless you need them
Reading for next week: Ch 3 in PS4DS
Next: Git and GitHub