Skip to main content
This package has been archived, and as such it is read-only.

Built and signed on GitHub Actions

latest

A simple javascript library for adding easter eggs to web pages

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 months ago (1.0.8)

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Paska Ovo

Paska

A simple javascript library for adding easter eggs to web pages

JSR JSR Score GitHub License GitHub Release

Installation

For Deno

deno add @egamagz/paska-ovo

For Node.js

npx jsr add @egamagz/paska-ovo

For Bun

bunx jsr add @egamagz/paska-ovo

For other package managers

Check the JSR page for more details.

Example

import { HistoricalCodes, PaskaOvo } from "@egamagz/paska-ovo";

const paskaOvo = new PaskaOvo()
  .addEasterEgg({
    code: HistoricalCodes.BarrelRoll,
    onFound: () => {
      //...
    },
    onFinish() {
      // ...
    },
    duration: 1000,
    tag: "Barrel Roll",
  })
  .addEasterEgg({
    code: HistoricalCodes.Konami,
    onFound: () => {
      // ...
    },
    tag: "Konami",
  })
  .addEasterEgg({
    code: ["a", "w", "e", "s", "o", "m", "e"],
    onFound: () => {
      // ...
    },
    tag: "Awesome",
  })
  .addCallback((easterEgg) => {
    alert(`You found the easter egg: ${easterEgg.tag}`);
  });

// Listen to keyboard events
document.getElementById("add-easter-egg").addEventListener("click", () => {
  paskaOvo.listen();
});

// Stop listening to keyboard events
document
  .getElementById("remove-easter-egg")
  .addEventListener("click", () => {
    paskaOvo.stop();
  });

Alternatively, it's possible to define the easter egg using the constructor:

import { HistoricalCodes, PaskaOvo } from "@egamagz/paska-ovo";

const paskaOvo = new PaskaOvo({
  code: HistoricalCodes.Konami,
  onFound: () => {
    alert("Gradius");
  },
  tag: "konami-code",
}).addCallback((easterEgg) => {
  console.log("Actual easter egg:", easterEgg.tag);
  console.log("Easter egg's code:", easterEgg.code);
});

paskaOvo.listen();

Check the example with source code.

Credits

Inspired by the project Egg.js and La Velada Web. Created by EGAMAGZ.

License

MIT License

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@egamagz/paska-ovo

Import symbol

import * as paska_ovo from "@egamagz/paska-ovo";

---- OR ----

Import directly with a jsr specifier

import * as paska_ovo from "jsr:@egamagz/paska-ovo";

Add Package

npx jsr add @egamagz/paska-ovo

Import symbol

import * as paska_ovo from "@egamagz/paska-ovo";

Add Package

yarn dlx jsr add @egamagz/paska-ovo

Import symbol

import * as paska_ovo from "@egamagz/paska-ovo";

Add Package

pnpm dlx jsr add @egamagz/paska-ovo

Import symbol

import * as paska_ovo from "@egamagz/paska-ovo";

Add Package

bunx jsr add @egamagz/paska-ovo

Import symbol

import * as paska_ovo from "@egamagz/paska-ovo";