Code Monkey home page Code Monkey logo

hackatoonbutton's Introduction

HackatoonButton - our first hackathon project

A website to randomly open interesting things across the internet. Submitted for the MLH Hackatoon 2021.

Instructions

Click on the website link: https://vishaaal.github.io/HackatoonButton/button.html

How Is It Working?

One of the most common uses of a random engine is to create a random link out of a predetermined group of links. We specify in advance the URL's to be put in "black box", and have the random engine randomly draw one out to follow.

function randomlink(){
    window.open(randomlinks[Math.floor(Math.random()*randomlinks.length)]);
}

JavaScript Random Integers

Math.random() returns a random number between 0 (inclusive), and 1 (exclusive).

Math.random() always returns a number lower than 1.`

Math.random() used with Math.floor() multiplied with randomlinks.length() can be used to return random integers.

Using those as indexes of the randomlinks[] can be used to point to that link stored in that index of the Array.

The button has an onclick event of randomlink() function, which when clicked by the user takes him/her to that link generated randomly.

Why This Website?

Just have some fun while clicking through various websites and enjoy the unpredictability of a mere thing, as feeble as a button.

After all a wise man once said:

The world is so unpredictable. Things happen suddenly, unexpectedly. We want to feel we are in control of our own existence. In some ways we are, in some ways we're not. We are ruled by the forces of chance and coincidence.

~Paul Auster

hackatoonbutton's People

Contributors

mnaiwrit52 avatar vishaaal 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.