npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dada

v0.1.6

Published

Bring DADA to your website!

Downloads

17

Readme

DADA.js

Bring DADA to your website!

Demo

Demo: matthias-vogt.github.io/DADA.js

This is a jQuery plugin to plant something that looks like a Virus on your website. When activated, lots of Windows 98 dialogs pop up with configurable random phrases, icons and sounds. The dialogs are spinning, pulsing, rotating, and even move away from your cursor if you try to close them.

What even

Dada (/ˈdɑːdɑː/) or Dadaism was an art movement of the European avant-garde in the early 20th century. [...] The beginnings of Dada correspond to the outbreak of World War I. For many participants, the movement was a protest against the bourgeois nationalist and colonialist interests, which many Dadaists believed were the root cause of the war, and against the cultural and intellectual conformity—in art and more broadly in society—that corresponded to the war. Many Dadaists believed that the 'reason' and 'logic' of bourgeois capitalist society had led people into war. They expressed their rejection of that ideology in artistic expression that appeared to reject logic and embrace chaos and irrationality. For example, George Grosz later recalled that his Dadaist art was intended as a protest "against this world of mutual destruction."

Wikipedia

In this spirit and to celebrate DADA's 100th anniversary, this plugin is supposed to bring confusion, havoc and fun to the web. It can also be used to announce DADA performances ;)

Usage

DADA.js depends on jQuery, so make sure you have that loaded. You can use it like this:

$.DADA(options);

Install

<link href="stylesheet" type="text/css" href="DADA.min.css">
<link href="stylesheet" type="text/css" href="DADA-button.min.css"> <!-- optional -->
<script src="jquery.min.js"></script>
<script src="DADA.min.js"></script>

The plugin comes with DADA-button.scss which helps you style a cool looking button users can click to initiate the DADA. Kinda ruins the whole point of surprise and confusion but whatever.

<div class="dada-button-container">
    <button class="dada-button" title="DADA expressly dissociates itself from the contents of this website.">DADA!</button>
    <span>Please click the button now!</span>
</div>

For better loading performance, I'd recommend loading the script as non-critical content (by putting the <script> and <style> tags at the end of the body tag). Please also consider concatenating it with your other dependencies.

Install and update easily using npm:

npm install dada --save

Options

{

    // content

    phrases: [
        // possible random phrases for dialogs
        // expects array of strings
        "DADA is DADA is DADA"
    ],
    icons: [
        // possible random icons for dialogs
        // expects array of URIs as strings
    ],
    sounds: {
        random: [
            // possible random sounds for dialogs
            // expects array of URIs as strings
        ],
        special: {
            // possible random sounds for special events of dialogs

            close: [
                // possible random sounds for when dialogs close
            ],
            start: [
                // possible random sounds for the first modal
            ]
        }
    },

    // callbacks

    on: {
        start: function() {
            // when the first modal opens
        },
        end: function() {
            // when DADA ends
        },
        ok: function() {
            // when any OK button is clicked
        },
        cancel: function() {
            // when any Cancel button is clicked
        }
    },

    // timing

    time: 20000, // total time DADA should run
    baseTimePerDialog: 1500, // time before a new dialog pops up (+- a little randomization)
    waitTimeAfterFirstDialog: 8000, // time to wait after the first pop up (suspense)

    // window markup

    windowTemplate: '' + // template for windows' markups
        '<div class="window">' +
        '    <div class="bar">' +
        '        {{title}}' +
        '        <button class="close js-cancel">×</button>' +
        '    </div>' +
        '    <div class="content">' +
        '        <img class="icon" alt="DADA Icon">' +
        '        <div class="text">' +
        '            <br>' +
        '            <button class="js-ok">{{ok}}</button>' +
        '            <button class="js-cancel">{{cancel}}</button>' +
        '        </div>' +
        '    </div>' +
        '</div>',
    words: { // context for windows' templates
        title: "DADA-Error!!1",
        ok: "OK",
        cancel: "Cancel"
    },

}

Destroying

DADA cannot be stopped.

Browser support

This uses CSS3 transitions, animations and filters, so full browser support is ie10+. Everything >ie8 should degrade just fine, though.

Yes, it's responsive*.*kinda

Contributing

You are very welcome to contribute! Please send pull requests and issues.

Feature requests

Feel free to post issues to ask for features.

TODO

  • [ ] support CommonJS and AMD
  • [ ] Clean up gulpfile

License

WTFPL, no warranty. Attribution would be appreciated.