Code Monkey home page Code Monkey logo

thanos-snap's Introduction

thanos-snap by Ankit

A custom web component to make your html element disappear with one snap of thanos. But unlike thanos power, this component does not bring back the dead. Use it wisely. :)

Hover gif

Installation

Install via npm:

$ npm install thanos-end-game

Usage

To use thanos-snap in your website, just add the thanos.min.js into your document's <head>. That's it! You've thanos power now. Please use it wisely.

Add the custom component tag, give the id of the object and of the weapon. For example:

<thanos-snap object='iron-man' weapon='thumb'> </thanos-snap>

In the above component iron-man and thumb are id given to the div and the button respectively.

<div id='iron-man' class="iron-man mt-4">
    <img src="iron-man.png" />
</div>
<button id='thumb'>Snap</button>

Adding js file to your page

<script src="thanos.min.js"></script>

or use a CDN version by jsDelivr

You need to add the css as well to make pixel effect work properly

.dust {
    position: absolute;
  }
  * {
      margin: 0px;
      overflow-x: hidden;
  }
.iron-man {
    display: inline-block;
}
You can rename the `.iron man` class with the one which you gave in the component. 

Dependencies

html2canvas chance jQuery jQueryUi

Add the scripts in sequential manner as per the above list.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

Add the scripts present in scripts folder after doing npm install

<script type="text/javascript" src="scripts/html2canvas.js"></script>
<script type="text/javascript" src="scripts/chance.js"></script>

Demo

Click here

thanos-snap's People

Contributors

knowankit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mewx

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.