Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 22 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,28 @@
Assignment 1 - Hello World: Basic Deployment w/ Git, GitHub, Glitch
===
Jade Logan

*DUE: Thursday, August 31st by 11:59 AM (before the start of class!)*
Glitch: https://a1-jdlogan0.glitch.me/

First assignment! You will deploy the starting Web site that you will use this term to [Glitch](http://www.glitch.com/).
This project shows a webpage with some information about me including CS classes I've taken and experience with different coding languages. The page was made using HTML and stylized with CSS, using JavaScript to make the it more interactive.

Treat this assignment as a chance to get up to speed on Git, GitHub, and Glitch, as well as experiment some with HTML/CSS/JS. If you already know these, great!
However, if you're new to them, spend several hours practicing, experimenting, and reading documentation. Don't just get your website up and done, as
you'll need skills with these tools throughout the rest of the course.
Due to the styling I used, the page can look messier depending on the screen dimensions. I tested with different dimensions and with a smaller width the info boxes are cramped, but still readable by dragging or closing them.

Assignment details
---

This assignment requires that your website is both contained in a GitHub repository and hosted in Glitch. There are two ways to do this:

1. Fork this repo and clone it to your computer, make changes locally on your computer, push the repo onto GitHub, and then import your GitHub repo into Glitch.
2. Fork this repo and then import it directly to Glitch, use the Glitch editor to make changes, and then export your repo from Glitch back to GitHub.
3. Same as #1, but instead of importing from Github to Glitch you just upload the files (or copy/paste) them directly to Glitch.

## Option 1 - Clone to computer, push to Github, import to Glitch (recommended)

1. Fork the starting project code in GitHub. This repo contains:
* the server code, `server.js`
* A starting `index.html` file that you will edit as described below
* A package.json file that helps configure Glitch
* This README
2. Edit `index.html` to show the following information about you:
* your name and class at WPI (e.g. class of 2020) Note: Do not put any contact or personal information that you do not potentially want other people outside of this class to see.
* your major(s) and minor(s)
* previous computer science courses that you have taken at WPI
* your experience with the following technologies and methods (none, some, a lot)
* HTML
* CSS
* Java
* JavaScript
* Ruby
* Python
* unit testing
4. Complete some technical and/or design achievements (see below).
5. Test your project to make sure that when someone goes to your main page, it displays correctly. You can do this locally by simply running `node server.js` from within the assignment directory.

6. Modify the README file according to the specification below.
7. Commit and push all your changes to GitHub.
8. Deploy your project to Glitch. You can do this by [importing the repo from GitHub](https://medium.com/glitch/import-code-from-anywhere-83fb60ea4875)
9. Ensure that your project has the proper naming scheme (guide follows) so we can find it.
9. Create and submit a Pull Request to the original repo.

## Option 2 - Fork repo and import to Glitch, edit on Glitch, and then export back to GitHub
Most of these steps are the same as option 1, except that you being by creating a new project Glitch using this repo as a staring point (just choose New Project > Import from GitHub for this and then paste in the link to your repo). At the end, you can export your Glitch project to GitHub by [following these instructions](https://www.youtube.com/watch?time_continue=77&v=aWJFbtrgW4E&feature=emb_logo). *Note that the location of the projecct export feature in Glitch has moved from what they show in this video.* It's now located in Tools > Import and Export (tools is located in the bottom left of the Glitch editor).

## Option 3 - Clone to computer, edit locally, push to GitHub, upload to Glitch
This is the same as option 1, except that for step 6 (Deploy to Glitch) you simply upload each file to your Glitch repository (using New File > Upload a File).

Naming and URL Scheme
---

You must use a consistent naming scheme for all projects in this course.
If we can't find it, we can't grade it.

By default Glitch often assigns your application a random name. To change it, click on the project dropdown menu in the upper left corner of Glitch. You will then see an additional text field displaying the project name in the resulting menu; click here to edit the name.

The name scheme should be `a1-yourGitHubUsername`.
The `a1` will need to be updated to `a2`, `a3`, and so on in future projects.

Achievements
---
Below are some suggested technical and design achievements. You can use these to help boost your grade up to an A and customize the assignment to your personal interests. These are recommended acheivements, but feel free to create/implement your own... just make sure you thoroughly describe what you did in your README and why it was challenging. ALL ACHIEVEMENTS MUST BE DESCRIBED IN YOUR README IN ORDER TO GET CREDIT FOR THEM.

Note that if you want to load resources besides your index.html file (images, an CSS file, a JS file) you'll need to modify server.js to point to these. For now it's easiest to just hardcode paths to the resources, but we'll look at ways to optimize this shortly.

*Technical*
1. (max 5 points) Style your page using CSS. Each style rule you apply will get you 1 extra point for a maximum of 5 points. Be sure to describe your style rules in your README.
2. (5 points) Add a simple JavaScript animation to the page.
3. (max 5 points) Experiment with other *semantic* HTML tags (links, images, tables, header, footer, etc.) Each extra tag you use will get you 1 extra point for a maximum of 5 points. Be sure to describe the tags you use in your README.

*Design*
1. (10 points) Create a color palette using [color.adobe.com](https://color.adobe.com). Use all the colors in the palette in your webpage by implementing the appropriate CSS. Add a small screenshot of the color wheel for your color palette to your repo.
2. (5 points) Use a font from [Google Fonts](https://fonts.google.com) in your website.

Resources
---

If you need a JavaScript/HTML/CSS refresher, see [HTML & CSS](https://wpi.primo.exlibrisgroup.com/discovery/fulldisplay?docid=alma9936730811904746&context=L&vid=01WPI_INST:Default&lang=en&search_scope=MyInst_and_CI&adaptor=Local%20Search%20Engine&tab=Everything&query=any,contains,Jon%20Duckett&offset=0) and/or [JavaScript Codeacademy](https://www.codecademy.com/en/tracks/javascript).

If you need a Git/GitHub refreseher, see [GitHub Bootcamp](https://help.github.com/categories/bootcamp/), the [GitHub Guides](https://guides.github.com/) (especially the ones on Hello World, and Understanding the GitHub Flow, and Forking Projects), and [CodeSchool's Try Git Course](https://www.codeschool.com/courses/try-git).

Sample Readme (delete the above when you're ready to submit, and modify the text below with your links and descriptions)
---

Charlie Roberts
http://a1-charlieroberts.glitch.me

This project shows ...

## Technical Achievements
- **Styled page with CSS**: Added rules for the p, li, and a selectors...
### Technical Achievements
- **Styled page with CSS**
- Added rules for body, a, button, and added classes
- Set color, background color, starting positions for information boxes, margin, and padding as needed for different elements
- For example, the box class has rules for color, border, background-color, margin, overflow, position, and width
- The page is styled to look like multiple smaller windows opened on a desktop
- **Added animation and interaction to the page**
- The boxes across the page can be dragged by the bar at the top and exited with "x" button - I used https://www.w3schools.com/howto/howto_js_draggable.asp as a reference when I was having trouble with the drag function
- The "HELLO" text is a button that resets the layout of the page
- The "WORLD!" text is a button that starts a rain animation
- @keyframes used to make drops fall and water rise, changing the backdrop color of the page
- **Experiment with other semantic HTML tags**
- Added links to different pages on wpi.edu, an image, and buttons (the "HELLO WORLD!" buttons and the buttons to close windows)
- The div containing "HELLO WORLD!" is in the header

### Design Achievements
- **Used the Roboto Font from Google Fonts**: I used Roboto as the font for the primary copy text in my site.
- **Created/used a color palette**
- Created a color palette using color.adobe.com: #6F97AD, #EDF8FE, #BAE3FA, #AD8B5E, #FADEB9
- **Used the font from Google Fonts**
- The Gaegu font from Google fonts was used for all text on the page
109 changes: 90 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,99 @@
<!doctype html>
<html lang="en">

<head>
<title>CS4241 Assignment 1</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Gaegu&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>

<header>
<div id = "rain"></div>
<div class = "box" id = "box5">
<div class = "bar" id = "box5bar">
reset_and_rain.txt
<button id = "box5x" class = "xbtn">♥</button>
</div>
<button onclick = "resetPage()" class = "helloworld">
HELLO
</button>

<button onclick = "toggleRain(true)" class = "helloworld">
WORLD!
</button>
</div>
</header>

<body>
<h1>Information about [Your name here]</h1>
<p>
[Self introduction]
</p>
<p>
[Major and other information]
</p>
<p>
[Other things]
</p>

<h2>Experience</h2>
<p>
Working experience
</p>
<ul>
<li>IBM/Rational</li>
<li>WPI</li>
</ul>

<div class = "box" id = "box1">
<div class = "bar" id = "box1bar">
intro.txt
<button onclick = "hideBox(1)" id = "box1x" class = "xbtn">x</button>
</div>
<div class = "boxtext">
<h1>Jade Logan</h1>
<p>
Class of 2025
</p>
<p>
<a href = "https://www.wpi.edu/academics/departments/computer-science">CS</a> and <a href = "https://www.wpi.edu/academics/departments/interactive-media-game-development">IMGD</a> double major
</p>
</div>
</div>

<div class = "box" id = "box2">
<div class = "bar" id = "box2bar">
classes.pdf
<button onclick = "hideBox(2)" id = "box2x" class = "xbtn">x</button>
</div>
<div class = "boxtext">
<h2>Previous <a href = "https://www.wpi.edu/academics/calendar-courses/course-descriptions/3776/computer-science">CS Classes</a></h2>
<ul>
<li>Introduction To Program Design (CS 1101)</li>
<li>Accelerated Object-Oriented Design Concepts (CS 2103)</li>
<li>Algorithms (CS 2223)</li>
<li>Systems Programming Concepts (CS 2303)</li>
<li>Introduction To Machine Organization And Assembly Language (CS 2011)</li>
<li>Operating Systems (CS 3013)</li>
<li>Computer Networks (CS 3516)</li>
<li>Computer Graphics (CS 4731)</li>
</ul>
</div>
</div>

<div class = "box" id = "box3">
<div class = "bar" id = "box3bar">
experience.txt
<button onclick = "hideBox(3)" id = "box3x" class = "xbtn">x</button>
</div>

<div class = "boxtext">
<h2>Experience</h2>
<ul>
<li>HTML: Some</li>
<li>CSS : Some</li>
<li>Java: A lot</li>
<li>Javascript: Some</li>
<li>Ruby: None</li>
<li>Python: A lot</li>
<li>Unit Testing: Very Little</li>
</ul>
</div>
</div>

<div class = "box" id = "box4">
<div class = "bar" id = "box4bar">
maxolotl.png
<button onclick = "hideBox(4)" id = "box4x" class = "xbtn">x</button>
</div>
<img src = "maxolotl.png" alt = "axolotl doodle">
</div>

<div class = "water" id = "w"></div>

<script defer src="script.js"></script>
</body>
</html>
Binary file added maxolotl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added palette.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
//hide boxes with x button
function hideBox(hide) {
let x = document.getElementById("box" + hide);
if (x.style.display === "none") {
x.style.display = "block";
}
else {
x.style.display = "none";
}
}

//drag functions

let topZ = 1;
let onX = false;

const boxes = document.getElementsByClassName("box");
for (let i = 0; i < boxes.length; i++) {
dragBox(boxes[i]);
}

function dragBox(box) {
let mouseX = 0, mouseY = 0, offX = 0, offY = 0;
document.getElementById(box.id + "bar").onmousedown = startDrag;
document.getElementById(box.id + "x").onmousedown = function() { onX = true;}

//bring clicked/dragged box to front
box.onmousedown = function() {
box.style.zIndex = topZ;
topZ += 1;
}

function startDrag(e) {
//stop drag on mouse up
document.onmouseup = function() {
document.onmouseup = null;
document.onmousemove = null;
onX = false;
}

offX = e.offsetX;
offY = e.offsetY;
if (onX === false) {
document.onmousemove = dragMove;
}
}

function dragMove(e) {
mouseX = e.x;
mouseY = e.y;

box.style.top = (((mouseY - offY - 22) / window.innerHeight) * 100) + "%";
box.style.left = (((mouseX - offX - 22) / window.innerWidth) * 100) + "%";
}

}

let rain = false;

let w = document.getElementById("w");
w.style.animationName = null;

//reset page
function resetPage() {
for (let i = 0; i < boxes.length; i++) {
boxes[i].style.left = null;
boxes[i].style.top = null;
boxes[i].style.display = null;
boxes[i].style.zIndex = null;
}
topZ = 1;
rain = false;
toggleRain(false);
w.style.animationName = null;
w.style.height = "0%";

}

//rain
function toggleRain(set) {

if ((rain === false) && (set === true)) {
w.style.animationName = "fill";
document.getElementById("rain").innerHTML = "";

let space = 0;
let drops = "";

//create raindrops
while (space < 99) {
let rand = (Math.floor(Math.random() * 99));
let randDelay = (Math.floor(Math.random() * 6));
space += (Math.floor(Math.random() * 3));
drops += '<div class="drop" style="left: ' + space + '%; animation-duration: 0.5' + rand + 's; animation-delay: ' + randDelay +'.' + rand + 's;"></div>';
}
document.getElementById("rain").insertAdjacentHTML('beforeend', drops);

w.onanimationend = function() {
document.getElementById("rain").innerHTML = "";
}
}
else if (set === false) {
document.getElementById("rain").innerHTML = "";
}
rain = set;
}
9 changes: 9 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ const server = http.createServer( function( request,response ) {
case '/index.html':
sendFile( response, 'index.html' )
break
case '/style.css':
sendFile(response, 'style.css')
break;
case '/script.js':
sendFile(response, 'script.js')
break;
case '/maxolotl.png':
sendFile(response, 'maxolotl.png')
break;
default:
response.end( '404 Error: File Not Found' )
}
Expand Down
Loading