Giter Club home page Giter Club logo

jsproject30's Introduction

30 JS Projects

####1. DrumKit

  • This project will provide a simulation drum by click keyboard
  • Add Class: key.classList.add('playing');
  • document.querySelectorAll('.key').forEach(key => ...)

####2. Clock

  • This project is create a clock with hour-hand, min-hand and sec-hand.
  • transition-timing-function: cubic-bezier(0.16, 0.24, 0.57, 1.29);
  • const now = new Date();
    const second = now.getSeconds();
    const min = now.getMinutes();
  • document.querySelector('.second-hand').style.transform = rotate(${minDegrees}deg);
  • transition: all 0.5s;
  • transform-origin: 100%; -> move hand to the end ####3. Update CSS variables with JS
  • This project is the way to dynamic change Spacing and blur.
  • <input id="spacing" type="range" name="spacing" min="10" max="200" value="10" data-sizing="px">
  • Using --space by define in :root{] and using with --spacing
    :root{--spacing: 10px;}
    img{ padding: var(--spacing);}
  • document.querySelectorAll('.controls input')
    forEach(input => input.addEventListener('change', handleUpdate))

####4. Array Cardio

  • array.filter(inventor => (inventor.year >= 1500))

  • console.table(fifteen) -> table console

  • const fullNames = inventors.map(inventor => inventor.first + " " + inventor.last)
    const fullNames = inventors.map(inventor => ${inventor.first} ${inventor.last})

  • const links = Array.from(category.querySelectorAll('a')); const links = [...category.querySelectorAll('a')];

  • Hash table

    : `const transportation = data.reduce(function (obj, item) {` `if(!obj[item]){obj[item] = 0;}`
    `obj[item]++;`
    `return obj`
    `},{});`

####5. Flex Panel

  • justify-content: center;
    align-items: center;
  • .panel > *:first-child{transform: translateY(-100%);}
  • myDIV:hover { width: 400px;} document.getElementById("myDIV").addEventListener("transitionend", myFunction);

####6. Ajax

  • function numberWithCommas(x){ return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');}
  • Promise.then(data => arr.push(...data)

####7. Array

  • const isAdult = people.some(person => (new Date()).getFullYear() - 19 >= person.year)
  • const isAdult = people.every(person => (new Date()).getFullYear() - 19 >= person.year)
  • const isAdult = people.find (comment => comment.id === 823423)
  • const index = comments.findIndex(comment => comment.id === 823423);
  • Delete const newCommand = [
    ...comments.slice(0, index),
    ...comments.slice(index + 1)
    ];

8. Canvas

  • Make line become round:
    ctx.lineJoin ='round';
    ctx.lineCap = 'round';
    ctx.lineWidth = 20

  • The way to change color:
    ctx.strokeStyle = hsl(${hue}, 100%, 50%);

  • console.group()
    console.groupEnd()

  • console.time('for loop');
    for(let i = 0; i < 1000; i++){}
    console.timeEnd('for loop');

jsproject30's People

Contributors

540792740 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.