diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e62c2fb --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "brave", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 60ccbf9..1c8464c 100644 --- a/README.md +++ b/README.md @@ -1,100 +1,52 @@ -Assignment 1 - Hello World: Basic Deployment w/ Git, GitHub, Glitch -=== +Nikesh Walling +https://a1-nikeshwalling.glitch.me/ -*DUE: Monday, August 29th by 11:59 AM (before the start of class!)* +This project shows some very basic information about myself. It lists my +activites, previous classes, and some basic programming proficiencies. -This assignment is a "warm-up" exercise. -You will simply deploy the starting Web site that you will use this term to [Glitch](http://www.glitch.com/). - -Treat this assignment as a chance to get up to speed on Git, GitHub, and Glitch. -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. - -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). +## Technical Achievements -Naming and URL Scheme ---- +### **Additional Elements** -You must use a consistent naming scheme for all projects in this course. -If we can't find it, we can't grade it. +I used attional HTML elemtents on the page including <`table`>, <`button`>, +<`a`> for links, an unordered list,and an SVG image. -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. +### **Styled page with CSS**: -The name scheme should be `a1-yourGitHubUsername`. -The `a1` will need to be updated to `a2`, `a3`, and so on in future projects. +Added rules for the body, h1 headers, lists, tables, +a button, +and applied a mask using an SVG. -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. +- For the body styling was used to set the background color for the site. -*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 HTML tags (links, images, tables etc.) Each extra tag you use will get you 1 extra point for a maximum of 5 points. Be sure to describe the links you use in your README. +- The <`h1`> header was styled so that the text had a coloted underline. -*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 [Goolge Fonts](https://fonts.google.com) in your website. +- The lists were styled so that the dot preceding the text was one of the + theming colors. -Resources ---- +- The table was styled so that the words had some additional padding and that + each cell had a border around them. -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). +- The mask was applied to a <`div`> element to restrict the background color to + the shape of the SVG. -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). +- Finally, the button was styled so that its shape was changed, it had a border, + and was indented on the screen. -Sample Readme (delete the above when you're ready to submit, and modify the text below with your links and descriptions) ---- +### **Animation and Image** -Charlie Roberts -http://a1-charlieroberts.glitch.me +I also created and animation using an additional JavaScript file and an SVG I +downloaded from https://commons.wikimedia.org/wiki/File:DVD_logo.svg. The +animation involed two <`div`> elements with boxes drawn on them through CSS +styling. A mask using the SVG was then applied to one of the boxes in order to +use the outline of the image. -This project shows ... +## Design Achievements -## Technical Achievements -- **Styled page with CSS**: Added rules for the p, li, and a selectors... +- **Used the Roboto Font from Google Fonts**: I used Roboto as the font for the + primary copy text in my site, and I used serif as a backup font. +- **Color Palette from Adobe** + I created a color palette using the Adobe Color website and had the following + colors in the palette: - #435f94; - #d4e0fc; - #7b9fe0; - #947534; - #e0a526; -### Design Achievements -- **Used the Roboto Font from Google Fonts**: I used Roboto as the font for the primary copy text in my site. +![Color palatte](Resources/ColorWheel.png) diff --git a/Resources/ColorWheel.png b/Resources/ColorWheel.png new file mode 100644 index 0000000..740edf5 Binary files /dev/null and b/Resources/ColorWheel.png differ diff --git a/Resources/DVD_logo.svg b/Resources/DVD_logo.svg new file mode 100644 index 0000000..59f069b --- /dev/null +++ b/Resources/DVD_logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bouncingBox.js b/bouncingBox.js new file mode 100644 index 0000000..c04d340 --- /dev/null +++ b/bouncingBox.js @@ -0,0 +1,66 @@ + +var id = null; + +const colors = [ + "#435F94", + "#D4E0FC", + "#7B9FE0", + "#947534", + "#E0A526"]; + + +function animator() { + let elem = document.getElementById("animation"); + let box = document.getElementById("boundingBox"); + let upOrDown = true; + let leftOrRight = true; + let upDownPos = 0; + let leftRightPos = 0; + let temp + console.log("Bouncing time\n"); + + clearInterval(id); + id = setInterval(frame, 20); + + let boxHeight = parseInt(box.clientHeight); + let boxWidth = parseInt(box.clientWidth); + let elemHeight = parseInt(elem.clientHeight); + let elemWidth = parseInt(elem.clientWidth); + let rand = (Math.random() + 1) / 2; + function frame() { + + if (upOrDown) { + upDownPos++; + elem.style.top = upDownPos + 'px'; + } else { + upDownPos--; + elem.style.top = upDownPos + 'px'; + } + + if (leftOrRight) { + leftRightPos++; + elem.style.left = leftRightPos / rand + 'px'; + } else { + leftRightPos--; + elem.style.left = leftRightPos / rand + 'px'; + + } + + let elemTop = parseInt(elem.style.top); + let elemLeft = parseInt(elem.style.left); + + if (elemTop <= 0 || elemTop >= (boxHeight - elemHeight)) { + upOrDown = !upOrDown; + temp = (Math.random() * 1000) % 5; + temp = Math.round(temp); + elem.style.backgroundColor = colors[temp]; + } + + if (elemLeft <= 0 || elemLeft >= (boxWidth - elemWidth)) { + leftOrRight = !leftOrRight; + temp = (Math.random() * 1000) % 5; + temp = Math.round(temp); + elem.style.backgroundColor = colors[temp]; + } + } +} diff --git a/index.html b/index.html index 37ac8c3..8dfb82e 100644 --- a/index.html +++ b/index.html @@ -1,28 +1,92 @@ - + + CS4241 Assignment 1 - + + + + -

Information about [Your name here]

-

- [Self introduction] -

+

Information about Nikesh Walling

- [Major and other information] -

-

- [Other things] + I am a class of 2025 student at WPI. I am part of the marching band, the + orchestra, and the High Power Rocketry Club. In my free time, I like + watching tv, cooking, and working on software/hardware projects.

+ Majors: Robotics Engineering and Computer Science
+ Minor: Mechanical Engineering
+

Previous relevant classes:

+ +

Language/Tool Familiarities:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Language/ToolExperience
HTMLSome
CSSSome
JavaA lot
JavaScriptNone
RubyNone
PythonSome
unit testingSome

Experience

-

- Working experience -

+

Working experience

+ +

Fun Stuff

+ +

Link to my Github and LinkedIn Pages:

+ Github:https://github.com/valleyquail
+ LinkedIn: + https://www.linkedin.com/in/nikesh-walling +
+ +

Bouncing DVD:

+ +
+
+
- + + \ No newline at end of file diff --git a/server.js b/server.js index b18d6a1..b2298ef 100644 --- a/server.js +++ b/server.js @@ -1,24 +1,23 @@ const http = require('http'), - fs = require('fs'), - port = 3000 + fs = require('fs') -const server = http.createServer( function( request,response ) { - switch( request.url ) { - case '/': - sendFile( response, 'index.html' ) - break - case '/index.html': - sendFile( response, 'index.html' ) - break +const server = http.createServer( (request,response) => { + const url = request.url.slice(1) + switch( url ) { + case '': + sendFile('index.html', response); break; default: - response.end( '404 Error: File Not Found' ) + sendFile(url, response); break; } }) +.listen(3000) -server.listen( process.env.PORT || port ) - -const sendFile = function( response, filename ) { - fs.readFile( filename, function( err, content ) { - response.end( content, 'utf-8' ) - }) +const sendFile = function( filename, response ) { + fs.readFile( filename, (error, content) => { + if( error !== null ) { + response.end( 'file not found.') + }else{ + response.end( content, 'utf-8' ) + } + }) } diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..631e4c3 --- /dev/null +++ b/styles.css @@ -0,0 +1,81 @@ +@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap"); +@import url("https: //github.com/valleyquail/a1-NikeshWalling/blob/main/Resources/DVD_logo.svg"); +:root { + --color-one: #435f94; + --color-two: #d4e0fc; + --color-three: #7b9fe0; + --color-four: #947534; + --color-five: #e0a526; + --image: url(Resources/DVD_logo.svg); +} + +body { + background-color: var(--color-two); + font-family: "Roboto", serif; + font-size: 22px; +} + +button { + display: block; + margin-left: 140px; + margin-bottom: 25px; + font-family: "Roboto", serif; + width: 120px; + height: 40px; + position: relative; + background-color: var(--color-three); + border-color: black; + border-radius: 10px; +} + +/* Using text-decoration */ +h1 { + text-decoration: underline; + text-decoration-color: var(--color-five); +} + +img { + /* filter: invert(.5); */ + width: 100px; +} + +li { + color: var(--color-one); + -webkit-text-fill-color: black; + font-size: medium; +} + +table, +th { + border: 1px solid black; + padding: 0px 20px 0px 0px +} + +td{ + border: 1px solid black; + font-size: smaller; +} + +/* Elements by id*/ + +#boundingBox { + width: 400px; + height: 400px; + position: relative; + background: black; + border-color: black; + border-width: 3px; + border-style: solid; +} + +#animation { + width: 100px; + height: 50px; + position: absolute; + background-color: var(--color-five); +} + +.mask { + -webkit-mask-image: var(--image); + mask-image: var(--image); +} \ No newline at end of file