Coder Social home page Coder Social logo

honkify's Introduction

Honkify.js

Honkify.js

Need a little more chaos in your life? Set a goose loose on your site to act like a jerk.

Try a demo!

Praise for Honkify.js

Nobody asked for this. – Jessica Tremblay

This is the worst thing you have ever done. – E.J. Mason

What does Honkify do?

When activated, all links and buttons on the site will stop working, instead triggering a “honk!” sound effect.

This is not transpiled and not tested on any browsers except Chrome latest, because this is a silly joke and therefore honk honk honk!

Installation and Quick Start

yarn add honkify

In your code:

import honkify from 'honkify';

// The goose is loose!
const unregister = honkify();

// Disable so links work again
unregister();

Hook

You can also use the handy React Hook (or React Honk?) to make any event handler honkable

import useHonk from 'honkify/useHonk';

const onClick = (isLoose) => {
  console.log(`goose is ${isLoose ? 'loose' : 'STILL LOOSE'}`);
}

function App() {
  const honkify = useHonk();
  const onClickHonkified = honkify(onClick);
  
  return (
    <h1 onClick={() => onClickHonkified(true)}>Sure, the header is honked too!</h1>
  )
}

Disclaimer: please don’t actually use this.

Or, if you do, make sure it’s easy to toggle off. Geese may be jerks, but developers shouldn’t be.

honkify's People

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  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  avatar  avatar

Watchers

 avatar  avatar

honkify's Issues

license

This silly package is GPL-2.0+ compatible ? :D I might ask (because maybe I push something for WordPress)

Doesn't Work on Safari Mobile

Critical bug for being able to use this lib with enterprise clients.

Steps to Reproduce

Open https://honkify.netlify.com/ and turn on Honk while on iOS Safari. Click a link.

Expected Behavior

On iOS Safari, there is a honk.

Actual Behavior

There is no honk.

totally fails to render (blank page) when cookies/storage are disabled

react-dom.production.min.js:4530 DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
    at te (https://honkify.netlify.com/app-30969a8d37278652ed77.js:1:32507)
    at https://honkify.netlify.com/app-30969a8d37278652ed77.js:1:32813
    at no (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:83153)
    at Cu (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:108494)
    at t.unstable_runWithPriority (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:128456)
    at Wl (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:51941)
    at _u (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:108248)
    at https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:108159
    at j (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:127838)
    at MessagePort.T.port1.onmessage (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:126582)
Za @ react-dom.production.min.js:4530
scheduler.production.min.js:100 Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
    at te (https://honkify.netlify.com/app-30969a8d37278652ed77.js:1:32507)
    at https://honkify.netlify.com/app-30969a8d37278652ed77.js:1:32813
    at no (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:83153)
    at Cu (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:108494)
    at t.unstable_runWithPriority (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:128456)
    at Wl (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:51941)
    at _u (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:108248)
    at https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:108159
    at j (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:127838)
    at MessagePort.T.port1.onmessage (https://honkify.netlify.com/commons-b8a79f86762a5427c7dc.js:1:126582)

Demo site `Unhonk` honks

When demoing honkify, the Unhonk button fails to unhonkify the website under Chrome 77 on MacOS. This goes against best practices of providing an easy way to disable Honkify.

Additionally, a console message is logged stating Honk! This is safari, which is incorrect.

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.