- Rutgers Design 2B: W5
- Responsive Design Introduction
- Media Queries
- Mobile First Media Queries
- Resources
- Responsive Typography with Viewport Units
- Intro to Javascript
- Console
- Parameters
- Data Types
- Strings
- Examples:
- Numbers
- Booleans
- Operators
- Additional Resources
- Activity – Inspiration Diary
- Step 1
- Step 2
- Interesting reference for abstracted websites
Visible to members of this folder
Responsive Design Introduction
<!DOCTYPE html>
<html>
<head>
<title>Media Queries and JS</title>
<link rel="stylesheet" type="text/css" href="assets/main.css">
</head>
<body>
<div class="container">
<div class="item">
Hello!
</div>
</div>
</body>
</html>
/* If the browser window is smaller than 500px, the background color will change to lightblue: */
@media (max-width: 500px) {
body {
background-color: lightblue;
}
}
/* If the browser window is shorter than 650px, the background will turn orange */
@media (max-height: 650px) {
body {
background-color: orange;
}
Mobile First Media Queries
/* The body's background is set to blue by default, but when the browser's width is at least 500 pixels wide, the background is set to red. */
.
body {
background-color: blue;
}
@media (min-width: 500px) {
body {
background-color: red;
}
}
/* The body's font-size is smaller by default */
body {
font-size: 16px;
}
/* Tablet breakpoint */
@media (min-width: 768px) {
body {
font-size: 50px;
}
}
/* Desktop breakpoint */
@media (min-width: 992px) {
body {
font-size: 60px;
}
}
/* Wide screen breakpoint */
@media (min-width: 1200px) {
body {
font-size: 70px;
}
}
Resources
Responsive Typography with Viewport Units
.item {
font-size: 10vw;
}
Intro to Javascript
Console
alert("Hello Friend!")
Parameters
Data Types
Strings
Numbers
console.log(5)
Booleans
Operators
console.log(9+5 * 3)
<script type="text/javascript" src="INSERT PATH TO YOUR JS FILE HERE"></script>
console.log("hello!");
Activity – Inspiration Diary
Step 1
Step 2