Skip to content

ishratumar/javascript30days-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 

Repository files navigation

JavaScript30

Course created by Wes Bos. Here's the challenge 👉 JavaScript30, you can join it for free!

Hi there 👋

I created this repository in order to keep track of my progress in the JavaScript 30 Day Challenge and to commit and log what I learnt every day.

What is JavaScript 30 Day Challenge ?

It's a 30-day vanilla JavaScript coding challenge. You will build 30 unique projects in 30 days using fun and easy video tutorials. You should already know some JavaScript to take on this challenge.

JavaScript 30-Day 1

Javascript Drum Kit 🥁

✍️ My learnings from this project:

  • key event
  • transitionend event
  • ES6 template strings

Methods Learnt:

1. addEventListener()
2. querySelectorAll()
3. remove()
4. play()

classList proprty -> The classList property returns the CSS classnames of an element. It returns a DOMTokenList.
Found a very useful tool for JavaScript events Keycodes at keycodes.info.

JavaScript 30-Day 2

CSS + JS clock 🕓

✍️ My learnings from this mini-project:

  • Learnt about CSS transitions and transform
  • The ES6 'const' keyword
  • Live UI update after few seconds
  • Element.style for inline styling

JavaScript 30-Day 3

Update CSS Variables with JS☑️

✦ The goal today was to create an Image editor to control the spacing, color, and blur by modifying CSS variables with JavaScript.

CSS variables explained:

  • spacing
  • base
  • blur

✍️ My learnings from this project:

  • How to declare variables in css
   :root{
   --base: yellow;<br>
   }
   img{
   background-color: var(--base);
}
  • Code snippet to select all inputs on the page -> const inputs = document.querySelectorAll('.controls input');
  • querySelector gives you a NodeList
  • Learnt about 'change' and 'mousemove' events
 Example code:

 inputs.forEach(input => input.addEventListener('change', handleUpdate));
 inputs.forEach(input => input.addEventListener('mousemove', handleUpdate));
  • Learnt about 'dataset' that can be used to access all data attributes.

JavaScript 30-Day 4

Array Cardio Day 1 💪

✦ This lesson is all about Fundamentals of JavaScript(Array methods).

✍️ My learnings from this project:

  • Worked with ES6 Arrow functions.
  • Learnt about JavaScript array methods:
    • filter() is like you give 10 things and it return 2.
    • map() returns exact same amount of elements as you give it.
    • sort() used for sorting elements in some order.
    • reduce() allow you to sort of build something on every single one.

JavaScript 30-Day 5

Flex Panels Gallery 💪

✦ The image will expand when you click on it and then shrink when you click it off.
✦ Today's lesson was about making a photo gallery

✍️My learnings from this project:

  • Primarily focused on CSS flex property.
  • Transitioned on flex-grow and font-size to expand images.
  • Used Funtions:
    • toggleOpen
    • toggleActive

Best resourse to learn CSS Flexbox:Flexbox

JavaScript 30-Day 6

Type Ahead 👀

✍️My learnings from this project:

  • Fetch API
  • Getting .json() from fetch response
  • Array spread operator
  • Match() function

JavaScript 30-Day 7

Array Cardio 💪💪

✍️My learnings from this project:

  • Learnt some more Array methods
    • some()
    • every()
    • find()
    • slice()
    • findIndex()

JavaScript 30-Day 8

Fun with HTML5 Canvas🎨

✍️My learnings from this project:

  • Learnt the fundamentals of HTML5 canvas.
  • Build a painting canvas where if you hold down the mouse button and drag, you can paint on it. Something like Microsoft Paint👀

✦ You can find a similar project in Book Eloquent JavaScript Drawing on Canvas.

JavaScript 30-Day 9

14 Must Know Dev Tools Tricks💡

✍️My learnings from this project:

  • Learnt how to use developer tools in your browser effectively.
  • Wes shared some amazing tips and tricks for using the developer tools in your browser.

All methods explained today👇

Regular console.log('text')
Interpolated console.log('text with a %s', 'placeholder')
Styled console.log( '%c text styling', 'background:red')
Warning! console.warn('warning message')
Error console.error('error message')
Info console.info('message info')
Testing console.assert(false, 'the word is %s', 'foo')
Clearing console.clear()
Grouping together console.group()
console.groupCollapsed()
console.groupEnd()
Counting console.count('Count')
Timing console.time('fetching data')

JavaScript 30-Day 10

Hold Shift to Check Multiple Checkboxes

✍️My learnings from this project:

Code Example: const checkboxes = document.querySelectorAll('.inbox input[type="checkbox"]');

  • Check if they had the shift key down
  • AND check that they are checking it
    inBetween = !inBetween;
    checkboxes.forEach(checkbox => checkbox.addEventListener('click', handleCheck));

✦ How it works:

  • When you click a checkbox, hold Shift, and click another checkbox a few rows down or up, all the checkboxes in between those two are checked. BOOM!! Wes style :D

JavaScript 30-Day 11

Custom Video Player

✍️My learnings from this project:

  • learnt some useful tips on customizing HTML5 video player controls.
    • Used togglePlay to play and pause the video.
    • Added click event.
    • Used event listners mousemove,mouseup.

JavaScript 30-Day 12

Key Sequence Detection

✍️My learnings from this project:

  • It works in a way when when someone types in a series of keys, something occurs.
  • Learnt about Key Sequence Detection and Konami Code.

JavaScript 30-Day 13

Slide in on Scroll

✦ Today we used Javascript to add the Slide-In-On-Scroll functionality to a pre-built page.
✦ As you scroll down, images slide in from the right or left sides of the page.

✍️ My learnings from this project:

  • Learnt about JavaScript debounce fuction
    • The overhead of a function can be reduced by preventing it from being called repeatedly. This will help to speed up the website.

Sample Code:

    function debounce(func, wait = 20, immediate = true) {
    var timeout;
    return function() {
      var context = this, args = arguments;
      var later = function() {
        timeout = null;
        if (!immediate) func.apply(context, args);
      };
      var callNow = immediate && !timeout;
      clearTimeout(timeout);
      timeout = setTimeout(later, wait);
      if (callNow) func.apply(context, args);
    };
  };

JavaScript 30-Day 14

JavaScript References VS Copying

✍️My learnings from this project:

  • Learnt the differences between array & object references and actual copies.
  • A primitive type can be manipulated by its value, whereas a reference type can be modified by its reference.

JavaScript 30-Day 15

LocalStorage

  • Today's Challenge is about 2 main things:
    1. Local Storage
    2. Event Deligation

✍️My learnings from this project:

  • e.preventDefault() -> stops the page from reloading.
  • JSON.stringify(items) -> When you pass items it's going to convert your objects and arrays into a JSON string.
  • JSON.parse() -> take items from the string and put it back into form whatever it was initially.
  • If you addEventListner() on something that doesn't exist, you'll know that in future it won't be clicked.

JavaScript 30-Day 16

Mouse Move Shadow

✍️My learnings from this project:

  • Day-16 is about adding shadow with mousemove.
  • Mainly learnt about ES6 Object destructuring and updating CSS rules, like text-shadow, using javascript.

JavaScript 30-Day 17

Sort Without Articles

✍️My learnings from this project:

  • Learnt about array.sort() method to sort a list of band names without 'Articles'.

JavaScript 30-Day 18

Adding Up Times with Reduce

✍️My learnings from this project:

  • See the usability test case scenario for Array.prototype.reduce().
  • When used correctly, reduce() can be quite effective.

JavaScript 30-Day 19

Webcam Fun

✍️My learnings from this project:

  • Learnt how to make a photo booth using JavaScript.
  • Real-time image pipelining and canvas were new concepts to me.

JavaScript 30-Day 20

Speech Detection

✍️My learnings from this project:

  • Learnt about SpeechRecognition something like google voice search. Definitely a good challenge!

JavaScript 30-Day 21

Geolocation

✍️My learnings from this project:

  • Learnt abbout Geolocation and Orientation Api.
  • Learnt that mobile devices generally use GPS hardware to locate themselves.

JavaScript 30-Day 22

Follow Along Link Highlighter

✍️My learnings from this project:

  • Learnt about Element.getBoundingClientRect() method and how it works.

✦ The function returns a DOMRect containing information about the size and position of an element in relation to the viewport.

JavaScript 30-Day 23

Speech Synthesis

✍️My learnings from this project:

  • Learnt about speech Speech Synthesis CSS radial-gradient.
  • Method Used:
    • addEventListener()
    • toggle()
    • querySelectorAll()
    • querySelector()
    • includes()

JavaScript 30-Day 24

Sticky nav

✍️My learnings from this project:

  • Learnt how to fix a nav using JavaScript when you scroll to it.
  • You use nav.OffsetHeight -> to grab the height of the pixels.

JavaScript 30-Day 25

Event Capture, Propagation, Bubbling, and Once

✍️My learnings from this project:

  • Learnt about propagation, bubbling, event capturing, and new property once.

    • Bubbling refers to the browser being able to determine what you clicked on, as well as trigger clicks to ripple up every time you click. For example: Whenever you click on a nested element, it actually starts from the top and then captures all of those events. It then starts at the bottom and starts doing something called a bubble.
    • The capture happens from top to bottom and then the events, the events haven't started yet. It only captures where you clicked, and is storing them. As you go up, it will begin to bubble up, which means it will start triggering events as you go up.
  • e.stopPropagation();-> stop bubbling this event up

  • If you set once to true it will listen for a click and unbind itself and unbinding itself is the same thing as div.removeEvent.Listener('click', logText)

  • You can use it for buttons when someone clicks that button more than once. (Example: Store checkouts)

  button.addEventListner('click', () =>{
   console.log('click!!!');
 },{
  once: true
});

JavaScript 30-Day 26

Stripe Follow Along Dropdown

✍️My learnings from this project

  • Learnt how to make a "Follow Along" Navigation.
  • Learnt about getBoundingClientRect().

SEJ- Search Engine Journal: Best website I have found for finding SEO information which has Stripe Follow Along Dropdown navigation. Check it out for inspiration.

JavaScript 30-Day 27

Click and Drag to Scroll

✍️My learnings from this project:

  • Learnt logic behind Click and Drag to Scroll using that plays main role element.offsetLeft.
  • It's just a combination of mouse down, mouse leave, mouse out, mouse up, and mouse move.
CSS code:
   .item.active{
    background: rgba();
    cursor: grabbing;
    cursor: -webkit-grabbing;
    transform: scale(1);
}

JavaScript 30-Day 28

Video Speed Controller UI

✍️My learnings from this project:

  • Learnt how to use offset techniques for design presentations. By making use of the offset property, you can align elements exactly where you want them.
Code Sample:
<script>
const speed = document.querySelector('.speed');
const bar = speed.querySelector('.speed-bar');
const video = document.querySelector('.flex');

function handleMove(e) {
    const y = e.pageY - this.offsetTop;
    const percent = y / this.offsetHeight;
    const min = 0.4;
    const max = 4;
    const height = Math.round(percent * 100) + '%';
    const playbackRate = percent * (max - min) + min;
    bar.style.height = height;
    bar.textContent = playbackRate.toFixed(2) + '×';
    video.playbackRate = playbackRate;
  }
speed.addEventListener('mousemove', handleMove);
</script>

JavaScript 30-Day 29

Countdown Clock

✍️My learnings from this project:

  • Learnt about Date.now(), clearInterval() functions.

JavaScript 30-Day 30

Whack A Mole Game

✍️My learnings from this project:

  • Completed today's challenge used document. query selector, classList.add('up') and classList.remove('up').

✦ It is recommended for those who wish to gain a deeper understanding of JavaScript.

Give A Star ⭐

Thank you for sticking with me all the way to the end! Please consider staring this repo on top right of the page if you enjoy it and find it useful!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published