Skip to content

a1-SmeeBoi submission for Sameer Desai first assignment #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1fb6666
new bob txt file
SmeeBoi Aug 24, 2023
88646c2
weird commit i didnt change anything
SmeeBoi Aug 24, 2023
8528878
dont know whats going on
SmeeBoi Aug 24, 2023
12b9a11
still what is this bruh
SmeeBoi Aug 24, 2023
7cd65a0
add .DS_Store to gitignore and delete bob.txt
SmeeBoi Aug 24, 2023
4a93b3c
still same as last change description
SmeeBoi Aug 24, 2023
b8117d5
added name
SmeeBoi Aug 24, 2023
105aeab
create sample readme
SmeeBoi Aug 24, 2023
1456073
testing github clone to glitch success. added url in readme. will upd…
SmeeBoi Aug 24, 2023
79c8437
added some lame answers
SmeeBoi Aug 24, 2023
e0bb566
added more lame answers
SmeeBoi Aug 24, 2023
1431308
got google font i dont want working lol
SmeeBoi Aug 24, 2023
a6c14e6
finding random css stuff online
SmeeBoi Aug 24, 2023
be639b7
changed some description
SmeeBoi Aug 29, 2023
50c0c7c
Added photo
SmeeBoi Aug 29, 2023
7d0867c
add basic img css
SmeeBoi Aug 29, 2023
e45589b
cleaned up text in html a little
SmeeBoi Aug 29, 2023
1c8ce59
got rid of extra spaces
SmeeBoi Aug 29, 2023
b0290ef
using new server code
SmeeBoi Aug 29, 2023
2f1047d
added gif
SmeeBoi Aug 29, 2023
a4cc5c3
adding comments to understand server.js code
SmeeBoi Aug 30, 2023
2325e40
get rid of lame image and gif
SmeeBoi Aug 30, 2023
a6a8cf9
added cool cursor. hover over text still broken
SmeeBoi Aug 30, 2023
d4f83d4
changed size of cursor outline
SmeeBoi Aug 30, 2023
f1bf652
still tryna figure out cursor scale on hover :(
SmeeBoi Aug 30, 2023
ca16478
looking at readme formatting
SmeeBoi Aug 31, 2023
53d6c5a
working on readme
SmeeBoi Aug 31, 2023
783d789
not exactly what i want. but decent looking. cant center align bullet…
SmeeBoi Aug 31, 2023
3047689
ok this version of css makes it all centered. still not what i want :(
SmeeBoi Aug 31, 2023
3e6aab5
get rid of bullets and list items are left aligned
SmeeBoi Aug 31, 2023
6fa05aa
finally got list to align how i want.... but i don't like how it look…
SmeeBoi Aug 31, 2023
8c9a862
this version where the list items are centered is not as readable. bu…
SmeeBoi Aug 31, 2023
d54bd83
alr imma go with this one. change order of some tools in list
SmeeBoi Aug 31, 2023
d8e8c32
reordered courses in list
SmeeBoi Aug 31, 2023
a3b1187
this works to scale cursor when hovering over h1 name text
SmeeBoi Aug 31, 2023
a1872e8
alr i just gotta clean everything up for basic submit
SmeeBoi Aug 31, 2023
0755f96
cleaning stuff up
SmeeBoi Aug 31, 2023
0efc126
formatted urls in readme
SmeeBoi Aug 31, 2023
bf8e82d
changed numbers
SmeeBoi Aug 31, 2023
a01245b
changed html tags part
SmeeBoi Aug 31, 2023
5fbcf3e
moved script for cursor animation into html
SmeeBoi Aug 31, 2023
b42f7ae
added gif
SmeeBoi Aug 31, 2023
3685675
add gif to readme
SmeeBoi Aug 31, 2023
12a8c63
put divs in html section
SmeeBoi Aug 31, 2023
27dc708
adding more detail to readme
SmeeBoi Aug 31, 2023
50a9ec3
little edit
SmeeBoi Aug 31, 2023
1eb52f4
just gif at start
SmeeBoi Aug 31, 2023
7701e26
added more to css section of readme
SmeeBoi Aug 31, 2023
996cd56
lol didnt realize readme uses ul and li
SmeeBoi Aug 31, 2023
741e54d
looks better with tag
SmeeBoi Aug 31, 2023
fa1f727
little word edit
SmeeBoi Aug 31, 2023
122b818
updated new glitch url
SmeeBoi Aug 31, 2023
2b19eca
added meta viewport tag
SmeeBoi Sep 2, 2023
260a92b
Update package.json
SmeeBoi Sep 13, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
119 changes: 29 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,39 @@
Assignment 1 - Hello World: Basic Deployment w/ Git, GitHub, Glitch
===
# a1-SmeeBoi
Sameer Desai https://a1-smeeboi.glitch.me/

*DUE: Thursday, August 31st by 11:59 AM (before the start of class!)*
![](https://github.com/SmeeBoi/a1-SmeeBoi/blob/main/cursor.gif)

First assignment! You will 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, 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.

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.
## Technical Achievements

Resources
---
### CSS
1. Body
- Black background, white text, center aligned content
2. List `<ul>`
- Removed default bullets, changed margin top spacing
3. List item `<li>`
- Changed margin bottom spacing
4. Cursor dot and outline styling
- Size and color
5. Header hover `<h1>`
- When h1 is hovered over, make cursor outline larger

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).
### JavaScript Animation
1. Custom cursor using tutorials: [Cursor](https://www.youtube.com/watch?v=UMdvufdewD8) and [Hover Animation](https://www.youtube.com/watch?v=nMGVwP3ww2M)
- To create the dot and circle custom cursor I added two div elements to the html:`<div class="cursor-dot" data-cursor-dot></div>`and `<div class="cursor-outline" data-cursor-outline></div>`. Then in the CSS file I set size and color of the cursor and and set size, border style, and border color for the cursor outline. Also had to hide the original cursor. Then for both dot and outline I enabled difference blend mode which gives a cool visual effect. Then the javascript queries the div elements for the cursor and updates the position based on the mouse x and y. Then I set the animation duration to a number I liked.

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).
### HTML tags
1. Aligned content with: `<div class="container">`
- I put all the content in a div to vertically and horizontally align it.
2. Added horizontal lines: `<hr>`
- I added horizontal lines to make the page feel more compact.
3. Divs to create cursor: `<div class="cursor-dot">` and `<div class="cursor-outline">`
- From description above, I had to add two divs in the HTML for the dot and outline of the cursor.

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

Charlie Roberts
http://a1-charlieroberts.glitch.me
### Google Font
1. Used Josefin Sans Font from Google Fonts: [Font Used](https://fonts.google.com/specimen/Josefin+Sans?query=josefin+sans)
- I used Josefin Sans for all the text on my page to give it a clean, minimalist vibe.

This project shows ...

## Technical Achievements
- **Styled page with CSS**: Added rules for the p, li, and a selectors...

### Design Achievements
- **Used the Roboto Font from Google Fonts**: I used Roboto as the font for the primary copy text in my site.
Binary file added cursor.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 59 additions & 24 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,63 @@
<!doctype html>
<html lang="en">
<head>
<title>CS4241 Assignment 1</title>

<head>
<title>Sameer Desai CS4241 Assignment 1</title>
<meta charset="utf-8">
</head>
<body>
<h1>Information about [Your name here]</h1>
<p>
[Self introduction]
</p>
<p>
[Major and other information]
</p>
<p>
[Other things]
</p>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> // This line is for mobile responsiveness
<link rel="stylesheet" href="./style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300&display=swap" rel="stylesheet">
</head>

<body>
<div class="container">
<h1>Sameer Desai</h1>
<div class="cursor-dot" data-cursor-dot></div>
<div class="cursor-outline" data-cursor-outline></div>
<hr> <!-- Horizontal line -->
<h2>Class of 2024 | Computer Science</h2>
<p>
My name is Sameer. I play volleyball and make music in my free time, and I'm excited to learn more about web
development. I am most interested in creating interactive webpages with audiovisual elements.
</p>
<h2>Relevant Coursework:</h2>
<ul>
<li>CS543: Computer Graphics</li>
<li>CS4233: Object Oriented Analysis</li>
<li>CS3431: Database Systems</li>
</ul>
<h2>Experience:</h2>
<ul>
<li>JavaScript - some</li>
<li>HTML - some</li>
<li>CSS - some</li>
<li>Java - some</li>
<li>Python - none</li>
<li>Ruby - none</li>
<li>Unit Testing - none</li>
</ul>
<hr> <!-- Horizontal line -->
</div>

<script>const cursorDot = document.querySelector("[data-cursor-dot]");
const cursorOutline = document.querySelector("[data-cursor-outline]");

window.addEventListener("mousemove", (e) => {
const posX = e.clientX;
const posY = e.clientY;

cursorDot.style.left = `${posX}px`;
cursorDot.style.top = `${posY}px`;

cursorOutline.animate({
left: `${posX}px`,
top: `${posY}px`,
}, { duration: 600, fill: "forwards" })
});
</script>

</body>

<h2>Experience</h2>
<p>
Working experience
</p>
<ul>
<li>IBM/Rational</li>
<li>WPI</li>
</ul>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cr-4241-simple-glitch",
"version": "0.1.0",
"description": "WPI CS 4241 first assignment",
"author": "Charlie Roberts",
"author": "Sameer Desai",
"scripts": {
"start": "node server.js"
}
Expand Down
49 changes: 28 additions & 21 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
const http = require('http'),
fs = require('fs'),
port = 3000
const http = require('http'), // get node http module
fs = require('fs') // get node file system module

const server = http.createServer( function( request,response ) {
switch( request.url ) {
case '/':
sendFile( response, 'index.html' )
break
case '/index.html':
sendFile( response, 'index.html' )
break
default:
response.end( '404 Error: File Not Found' )
}
})
// create a local HTTP server on your computer
// takes optional parameter of a function that will be called every time server gets a request
const server = http.createServer((request, response) => { // creating arrow fxn w/no name
const cleanURL = request.url.slice(1) // get the url of the request
// request is made by client trying to access a resource on server
// in this case, the resource is a file

server.listen( process.env.PORT || port )
// do url.slice(1) to remove the first character of the url which is a forward slash
switch (cleanURL) {
case '':
sendFile('index.html', response);
break;
default:
sendFile(cleanURL, response);
break;
}
})
.listen(3000)

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) { // error
response.end('file not found.')
} else { // success
response.end(content, 'utf-8')
}
})
}
71 changes: 71 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
html {
cursor: none;
/* hide normal cursor */
}

body {
margin: 0;
padding: 0;
background-color: black;
font-family: 'Josefin Sans', sans-serif;
color: white;
min-height: 100vh;
/* set min height to 100% of viewport height */
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}

.container {
width: 30%;
/* Set width of the centered container with */
}

h1 {
position: relative;
font-size: 5rem;
margin-bottom: 0px;
}

h2 {
margin-bottom: 0px
}

ul {
margin-top: 5px;
list-style-type: none;
/* Remove bullet points */
padding: 0;
}

li {
margin-bottom: 5px;
}

.cursor-dot {
width: 3px;
height: 3px;
background-color: white;
}

.cursor-outline {
width: 20px;
height: 20px;
border: 2px solid white;
}

.cursor-dot,
.cursor-outline {
position: fixed;
transform: translate(-50%, -50%);
border-radius: 50%;
z-index: 1;
pointer-events: none;
mix-blend-mode: difference; /* cool effect */
transition: 0.1s;
}

h1:hover~.cursor-outline {
transform: scale(5);
}