Code Monkey home page Code Monkey logo

keysmash-generator's Introduction

Keysmash Generator

This is currently a work in progress.

A keysmash generator with a click-to-copy function using vanilla JavaScript. This generates a random string of 8 to 25 letters from 'a' to 'l' on the keyboard.

Live Demo

Keysmash Generator

To-Dos

  • Get the generator working
  • Click-to-copy function
  • Fix footer
    • Add links: portfolio, github
  • Upload to website
    • Add live demo link to README.md
  • Responsiveness
  • Metadata

Project Breakdown

Setup

  1. Sketch a rough layout for the generator
  2. Code HTML base and SCSS
  3. Create a button with an onclick event

Button

  1. Onclick event which encompasses:
  2. Checks if the output field is empty, if it isn’t then clear it
  3. Then run the generator function

Generator Function

  1. Variable for output
  2. Array consisting of all letters from ‘a’ to ‘l’
  3. A random number generator to pick the number of letters to generate
  4. Pass that random number into a variable
  5. For loop to generate random letters from the array using the random number
  6. Another random number generator to randomly pick the letters from the array
  7. Display the result from the for loop onto the document output field

Click to Copy

  1. Read Clipboard API documentation
  2. If statement to check if there’s text in the output field
  3. If yes, display the tooltip for ‘click to copy’ when hovering over the output field
  4. Copy to clip board function
  5. Onclick event that changes the tooltip display to ‘text copied!’

keysmash-generator's People

Contributors

marlowecheng avatar

Stargazers

 avatar

Watchers

 avatar

keysmash-generator's Issues

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.