diff --git a/Color_Palette.jpeg b/Color_Palette.jpeg new file mode 100644 index 0000000..004ed13 Binary files /dev/null and b/Color_Palette.jpeg differ diff --git a/Gibby.mp4 b/Gibby.mp4 new file mode 100644 index 0000000..b56cfb4 Binary files /dev/null and b/Gibby.mp4 differ diff --git a/JohnWick.wav b/JohnWick.wav new file mode 100644 index 0000000..e12bb30 Binary files /dev/null and b/JohnWick.wav differ diff --git a/MichaelLai.jpg b/MichaelLai.jpg new file mode 100644 index 0000000..b1910d3 Binary files /dev/null and b/MichaelLai.jpg differ diff --git a/README.md b/README.md index bbf146f..1206b45 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,67 @@ -Assignment 1 - Hello World: Basic Deployment w/ Git, GitHub, Glitch -=== +Michael Lai +http://a1-azinxtheonix.glitch.me + +This project demostrates that I remember the basic elements of html, css, and javascript, as well as some clever tricks to lead to more advanced techniques. Details can be found below. + +## Technical Achievements: + +**1 - Style Rules:** +I'll be naming what I consider the most important style rules here (even though the style sheet has more than 5 rules). + + background-color: + This is used for, of course, the background color, which changes depending on the location of the page. Used primarily for the body selector and the animation at the bottom. + + color: + Very similar to background-color, but instead it's used for the text. Used primarily for the .text selector. + + font-family: + Helps to set the font of all the text in the page. + + td/th -> padding: + This is to make sure there's enough space for the text in the table. + + .titleArea::after -> *all the style rules under this*: + This is to stop the float style rules from causing parts of the bottom section to move into the top section. + +**2 - Javascript Animation:** +I've designed it so that depending on what section of the webpage you're viewing, it will change the color of the background and text. In order to accomplish this, on a scroll event, I took the current scroll position and the max scroll position in order to find a percentage, and then used that in order to do some rgb calculations. After that, I located the background color and text elements to change their colors. + +Just in case that doesn't count as an animation, I made a small animation at the bottom of the page that simply bounces a square with the button toggle. + +**3 - Other HTML Tags:** +First, lets go over what tags do not count for this catagory. I'm assuming all tags that are initally included do not count. These tags are: h1, h2, p, and ul/li. I'm also counting h3 -> h6 as well as any similarly functional tags. + + table/tr/th/td: + I'm putting all of these tags in one catagory, as they all relate with the same function of a table. + + a: + This is used for a link, which leads to something really disappointing. I can't directly describe the link, as it would ruin it, but from what I'm describing, the warning text before the link, and the modern internet, you could probably figure it out. + + img: + This is for an image of myself. + + video/source: + This is for a video. The tag looked interesting but I had no idea what to put in it, so I put a video of Gibby from iCarly hitting the floor. + + audio: + This is for an audio file inserted into page. It's a cringe .wav file I had on my computer as a joke. I'm also slowly running out of interesting tags (with content) to use. Luckly, this is the 5th tag. + +## Design Achievements: + +**1 - Color palette:** +*see file named Color_Palette.jpeg* +Two of the colors are used for the first color set, two others are used for the second color set where the animation switches between the two, and the final color is used for the borders of the table. Some of the colors are used for the small backup animation at the bottom. + +**2 - Google Font:** +From the linked google font, I chose Hina Mincho as the font for my site. For the Chinese characters (because why not), I chose Long Cang. + + +## Note: Old Readme Below + +--- + +Assignment 1 - Hello World: Basic Deployment w/ Git, GitHub, Glitch *DUE: Monday, August 30th by 11:59 AM (before the start of class!)* This assignment is a "warm-up" exercise. @@ -76,25 +137,11 @@ Below are some suggested technical and design achievements. You can use these to *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. +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... - -### Design Achievements -- **Used the Roboto Font from Google Fonts**: I used Roboto as the font for the primary copy text in my site. +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). \ No newline at end of file diff --git a/colorchanger.js b/colorchanger.js new file mode 100644 index 0000000..c765954 --- /dev/null +++ b/colorchanger.js @@ -0,0 +1,110 @@ +var colorChangeOff = false; +var id = null; +var xpos = 0 +var ypos = 0; +var xaccl = 1; +var yaccl = 1; +var animationOff = true; + +function changeColor() { + if(colorChangeOff == false) { /* Only trigger while the animation is enabled */ + /* Get the location of the scroll bar and the max scroll value; + apparently these attributes are different between browsers */ + let currentPos = window.pageYOffset || document.documentElement.scrollTop; + let scrollLimit = Math.max( document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, + document.documentElement.scrollHeight, document.documentElement.offsetHeight) - window.innerHeight; + + let positionPercent = currentPos / scrollLimit; + + /*console.log(currentPos); + console.log(scrollLimit); + console.log(positionPercent);*/ + + /* + Now we have to calculate the colors to show between + these colors, with the percentage we have + #fceaae (r: 252, g: 234, b:174) + #aefced (r: 174, g: 252, b:237) + */ + + var red = 252 - (76 * positionPercent); + var green = 234 + (18 * positionPercent); + var blue = 174 + (63 * positionPercent); + + document.getElementById("background").style.backgroundColor = rgb(red, green, blue); + /*console.log(document.getElementById("background").style.backgroundColor);*/ + + /* + The same calculation for text + #635527 (r: 99, g: 85, b:39) + #54c7d1 (r: 84, g: 199, b:209) + */ + + var red = 99 - (15 * positionPercent); + var green = 85 + (114 * positionPercent); + var blue = 39 + (170 * positionPercent); + + for(var text of document.getElementsByClassName("text")) { + text.style.color = rgb(red, green, blue); + } + } +} + +function colorToggle() { + /*console.log(colorChangeOff);*/ + if(colorChangeOff == false) { + document.getElementById("colorButton").innerHTML = "Enable Color Change"; + colorChangeOff = true; + document.getElementById("background").style.backgroundColor = "#fceaae"; + for(var text of document.getElementsByClassName("text")) { + text.style.color = "#635527"; + } + } else { + document.getElementById("colorButton").innerHTML = "Disable Color Change"; + colorChangeOff = false; + changeColor(); + } +} + +function rgb(r, g, b) { + return "rgb("+r+","+g+","+b+")"; +} + +function animationToggle() { + console.log("press"); + if(animationOff == true) { + document.getElementById("animationButton").innerHTML = "Stop Animation"; + animationOff = false; + var box = document.getElementById("animationBox"); + clearInterval(id); + id = setInterval(frame, 10); + + function frame() { + /*console.log(box.style.left); + console.log(box.style.top); + console.log(xpos); + console.log(ypos); + console.log(xaccl); + console.log(yaccl);*/ + if(xpos == 340) { + xaccl = -1; + } else if(ypos == 195) { + yaccl = -1; + } else if(xpos == 0) { + xaccl = 1; + } else if(ypos == 0) { + yaccl = 1; + } + + xpos = xpos + xaccl; + ypos = ypos + yaccl; + + box.style.left = xpos + 'px'; + box.style.top = ypos + 'px'; + } + } else { + document.getElementById("animationButton").innerHTML = "Start Animation"; + animationOff = true; + clearInterval(id); + } +} \ No newline at end of file diff --git a/index.html b/index.html index 37ac8c3..b06081a 100644 --- a/index.html +++ b/index.html @@ -3,26 +3,160 @@ CS4241 Assignment 1 + + + + - -

Information about [Your name here]

-

- [Self introduction] -

-

- [Major and other information] -

-

- [Other things] -

-

Experience

-

- Working experience -

- + + + +
+ + Michael Lai +

Information about Michael Lai (赖智豪)

+

Computer Science (Concentration in Cybersecurity) 2022

+

Kind of a gamer, not gonna lie

+

By the way, do not click this link: + Right Here +

+

+
+ + *just in case you can't read the bottom sections*

+
+ +
+ +

Play me

+ +
+
+ +
+
+ +
+

Experience

+

*Also known as, the actual serious portion*

+ +

Previous WPI CS Courses

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Course NumberCourse NameGrade
CS 1102Accelerated Intro to Program DesignA
CS 2022Discrete MathematicsC
CS 2103Accelerated Object-Oriented Design ConceptsA
CS 2011Intro to Machine Organization and AssemblyB
CS 2303Systems Programming ConceptsA
CS 2223AlgorithmsA
CS 3013Operating SystemsB
CS 3733Software EngineeringA
CS 3133Foundations of Computer ScienceA
CS 3516Computer NetworksA
CS 3043Social Implications of Information ProcessingB
CS 4401Software Security EngineeringB
CS 4515Computer ArchitectureA
+ +

Experience with following technologies and methods

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HTMLA lot (but rusty)
CSSA lot (but rusty)
JavaA lot
JavascriptA lot (but rusty)
RubyNone
PythonA lot
Unit TestingA lot
+
+ +
+ +

+
+
+
diff --git a/package.json b/package.json index 1699a50..4eb5c4e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "cr-4241-simple-glitch", - "version": "0.1.0", - "description": "WPI CS 4241 first assignment", - "author": "Charlie Roberts", + "version": "1.0.0", + "description": "WPI CS 4241 First Assignment", + "author": "Michael Lai and Charlie Roberts", "scripts": { "start": "node server.js" } diff --git a/style.css b/style.css new file mode 100644 index 0000000..0de1867 --- /dev/null +++ b/style.css @@ -0,0 +1,74 @@ +/* +#fceaae (r: 252, g: 234, b:174) *background* +#635527 (r: 99, g: 85, b:39) *text* +#c9b79f +#54c7d1 (r: 84, g: 199, b:209) *text* +#aefced (r: 174, g: 252, b:237) *background* +*/ +body { + background-color: #fceaae; +} + +.text { + color: #635527; +} + +table { + font-family: 'Hina Mincho', serif; + border-collapse: collapse; + width: 100%; +} + +td, th { + border: 1px solid #c9b79f; + text-align: left; + padding: 8px; +} + +h2, h3, p, span { + font-family: 'Hina Mincho', serif; +} + +.mainTitle { + font-size: 32px; + margin-top: 0.67em; + margin-bottom: 0.67em; + margin-left: 0; + margin-right: 0; + font-weight: bold; + font-family: 'Hina Mincho', serif; +} + +.chineseName { + font-size: 32px; + margin-top: 0.67em; + margin-bottom: 0.67em; + margin-left: 0; + margin-right: 0; + font-weight: bold; + font-family: 'Long Cang', cursive; +} + +.titleArea::after { + content: ""; + clear: both; + display: table; +} + +.mainImage { + float:left; +} + +#animationContainer { + width: 390px; + height: 245px; + position: relative; + background-color:#54c7d1 +} + +#animationBox { + width: 50px; + height: 50px; + position: absolute; + background-color: #c9b79f; +} \ No newline at end of file