Giter Club home page Giter Club logo

easter-break's Introduction

NPM JavaScript Style Guide NPM npm GitHub stars

Easter break

Ideal package for some easter egg in your site. This package just give you onClick function with canvas destroying current page


Examples

video-example.mp4

Komotedly - NextJS

Check here (button on the opened left menu): https://komotedly.netlify.app/

image

Vue boilerplate

image

Codesandbox

Installation

Write in terminal of your workspace:

npm i easter-break

or

yarn add easter-break

Usage

Note: Button is fully customizable because this package it's just onClick function with Canvas support

React

react

//  EasterBreaker.tsx
import easterBreaker from "easter-break";

 const EasterBraker = () => {
    return (
        <button onClick={easterBreaker}>Break me </button>

    );
  };
  export default EasterBraker
// App.tsx
import EasterBreaker from './EasterBreaker'

function App() {

  return (
    <div className="App">
        ...
        <EasterBreaker/>
        ...
    </div>

Full example - https://github.com/Ivan-Corporation/Easter-break/tree/master/examples/react


Vue 3

react

// EasterBreaker.vue
<template>
   <div class="button" @click="destroy" >
     Break me
   </div>
</template>

<script >
import easterBreaker from 'easter-break'


export default {
  name: 'easter-breaker',
   methods: {
    destroy(){
      easterBreaker();
    }
}
}

</script>
// HelloWorld.vue
<template>
  ...
    <button>
      <easter-breaker/>
    </button>
    ...
</template>

<script>
import EasterBreaker from './EasterBreaker.vue'
    ...
</script>

Full example - https://github.com/Ivan-Corporation/Easter-break/tree/master/examples/vue


Native JavaScript

react

// JS file
import easterBreaker from "easter-break";
document.getElementById("dangerous-button")
        .addEventListener("click", () => easterBreaker());

react

// HTML File

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="button.css">
    <script src="index.js"></script>
</head>
<body>
    <button id="dangerous-button"></button>
</body>
</html>

File size:

image

If you have CRA 5.0.0 and above and get some garbage in terminal try this script:

"start": "GENERATE_SOURCEMAP=false react-scripts start",


If after cliked on button you see:

You need to enable JavaScript to run this app. In the left-up corner

Just delete text from your index.html here:

<noscript>You need to enable JavaScript to run this app.</noscript>

Note: it's only for some kind of boilerplate

easter-break's People

Contributors

dependabot[bot] avatar ivan-corporation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jorik041

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.