From a7f1cf8ec892792d1ee2308bfdbd3725ba0edfcc Mon Sep 17 00:00:00 2001 From: Dimash Date: Mon, 29 Aug 2022 17:21:45 +0600 Subject: [PATCH 1/3] finished the assignment --- animation.js | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 77 +++++++++++++++++++++++++++++++++++--- server.js | 6 +++ styles.css | 31 +++++++++++++++ 4 files changed, 212 insertions(+), 6 deletions(-) create mode 100644 animation.js create mode 100644 styles.css diff --git a/animation.js b/animation.js new file mode 100644 index 0000000..9eb29a8 --- /dev/null +++ b/animation.js @@ -0,0 +1,104 @@ +const resolver = { + resolve: function resolve(options, callback) { + const resolveString = options.resolveString || options.element.getAttribute('data-target-resolver'); + const combinedOptions = Object.assign({}, options, {resolveString: resolveString}); + + function getRandomInteger(min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; + }; + + function randomCharacter(characters) { + return characters[getRandomInteger(0, characters.length - 1)]; + }; + + function doRandomiserEffect(options, callback) { + const characters = options.characters; + const timeout = options.timeout; + const element = options.element; + const partialString = options.partialString; + + let iterations = options.iterations; + + setTimeout(() => { + if (iterations >= 0) { + const nextOptions = Object.assign({}, options, {iterations: iterations - 1}); + if (iterations === 0) { + element.textContent = partialString; + } else { + element.textContent = partialString.substring(0, partialString.length - 1) + randomCharacter(characters); + } + + doRandomiserEffect(nextOptions, callback) + } else if (typeof callback === "function") { + callback(); + } + }, options.timeout); + }; + + function doResolverEffect(options, callback) { + const resolveString = options.resolveString; + const characters = options.characters; + const offset = options.offset; + const partialString = resolveString.substring(0, offset); + const combinedOptions = Object.assign({}, options, {partialString: partialString}); + + doRandomiserEffect(combinedOptions, () => { + const nextOptions = Object.assign({}, options, {offset: offset + 1}); + + if (offset <= resolveString.length) { + doResolverEffect(nextOptions, callback); + } else if (typeof callback === "function") { + callback(); + } + }); + }; + + doResolverEffect(combinedOptions, callback); + } + } + + + const strings = [ + 'Thank you for visiting my website', + 'Hope you enjoyed it', + 'The pallete is bad, I know', + 'That is why I usually hire designers before creating websites', + 'Or use simple colors, such as white, grey and so on', + "But I'm good at creating websites(not true)", + "I think my eyes are bleeding now", + "I'm leaving, bye...", + '......', + "Are you still here?", + "I'm really sorry for that", + "How was your day?", + "Did I aks that before?", + "It's an infinite loop, so I would probably ask that million times", + "Dormammu, I come to bargain", + '...' + ]; + + let counter = 0; + + const options = { + offset: 0, + timeout: 5, + iterations: 10, + characters: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'x', '#', '%', '&', '-', '+', '_', '?', '/', '\\', '='], + resolveString: strings[counter], + element: document.querySelector('[data-target-resolver]') + } + + function callback() { + setTimeout(() => { + counter ++; + + if (counter >= strings.length) { + counter = 0; + } + + let nextOptions = Object.assign({}, options, {resolveString: strings[counter]}); + resolver.resolve(nextOptions, callback); + }, 1000); + } + + resolver.resolve(options, callback); \ No newline at end of file diff --git a/index.html b/index.html index 37ac8c3..dbced12 100644 --- a/index.html +++ b/index.html @@ -3,26 +3,91 @@ CS4241 Assignment 1 + + + + -

Information about [Your name here]

+

Information about Dinmukhamed

- [Self introduction] + I'm an international student from Kazakhstan. I used to work as react developer, one of my latest works is this website.

- [Major and other information] + Computer Science major - class of 2023.

- [Other things] + My biggest passion is boxing. I also enjoy playing video games (especially FPS).

+ +

+ Taken Computer Science courses +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CS 1101 Intro to Program Design
CS 2102 Object-Oriented Design Concepts
CS 2011 Intro to Machine Organization and Assembly Language
CS 2022 Discrete Mathematics
CS 2223 Algorithms
CS 3013 Operating Systems
CS 3043 Social Implications of Information Processing
CS 3733 Software Engineering
CS 4341 Intro to Artificial Intelligence
CS 4801 Intro to Cryptography and Communication Security
CS 509 Design of Software Systems

Experience

Working experience

+ +
+

+
+ diff --git a/server.js b/server.js index b18d6a1..6ad1e46 100644 --- a/server.js +++ b/server.js @@ -10,6 +10,12 @@ const server = http.createServer( function( request,response ) { case '/index.html': sendFile( response, 'index.html' ) break + case '/styles.css': + sendFile( response, 'styles.css' ) + break + case '/animation.js': + sendFile( response, 'animation.js' ) + break default: response.end( '404 Error: File Not Found' ) } diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..31ccd62 --- /dev/null +++ b/styles.css @@ -0,0 +1,31 @@ +* { + font-family: 'Encode Sans Expanded', sans-serif; + font-family: 'Roboto', sans-serif; + } + + body { + background-color: #E0A29D; + } + + h1 { + text-align: center; + color: #664947; + } + + table, th, td { + border: 2px solid black; + border-collapse: collapse; + } + + h2 { + color: #664947; + } + + #container { + position: absolute; + width: 200px; + height: 200px; + margin: auto; + transform: rotate(45deg); + top: 0; bottom: 0; left: 0; right: 0; + } \ No newline at end of file From f7699f1dbcf584518a2cced2ce85703dcd075226 Mon Sep 17 00:00:00 2001 From: Dimash Date: Mon, 29 Aug 2022 17:39:49 +0600 Subject: [PATCH 2/3] Final changes --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index dbced12..d07358b 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ -

Information about Dinmukhamed

+

Information about Dinmukhamed Umbetzhan

I'm an international student from Kazakhstan. I used to work as react developer, one of my latest works is this website.

@@ -17,7 +17,7 @@

Information about Dinmukhamed

Computer Science major - class of 2023.

- My biggest passion is boxing. I also enjoy playing video games (especially FPS). + My biggest passion is boxing. I also enjoy playing video games (especially FPS).

From 080ef00859e4f0762e5c3931ccd201a485f43a6c Mon Sep 17 00:00:00 2001 From: JustForFun29 <39866114+JustForFun29@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:41:34 +0600 Subject: [PATCH 3/3] Update README.md --- README.md | 96 +++++-------------------------------------------------- 1 file changed, 8 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index 60ccbf9..e554303 100644 --- a/README.md +++ b/README.md @@ -3,98 +3,18 @@ Assignment 1 - Hello World: Basic Deployment w/ Git, GitHub, Glitch *DUE: Monday, August 29th by 11:59 AM (before the start of class!)* -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/). +Dinmukhamed Umbetzhan https://a1-justforfun29.glitch.me -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). - -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. +This project shows interesting information about me including: my major, class at WPI, previous computer science courses that I took, my experience. I also included my last react website that I've created. 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. - *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. +1. CSS styling. In this assignment I used 6 style rules, mostly to use coloring palette and creating borders for table. I also used some styling for my js animation in the bottom of the website +2. I have Futuristic Typing text JavaScript animation with funny text (Hope you will enjoy it). I created new JS file and connected it to html by