Skip to content

A slightly refactored and documented version of oneko.js with a few additions like scaling.

License

Notifications You must be signed in to change notification settings

CatWithCode/oneko.js.cwc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 

Repository files navigation

oneko.js.cwc

A hacky script adryd325 wrote to put a cat on her site.

The default image is oneko.gif in the Assets directory.

I made changes to fit my workflow better and work with my website and some paths need probably some adjustments. The main changes are:

  • Slight refactoring.
  • Removing unneeded code.
  • Added scaling to any Zoom level incl. speed.

og-demo: https://adryd.com

This script is meant to be simple so that it can easily be extended upon.

The script is heavily adjusted in the way it must be loaded to fit my setup. Here is how to call it (It is very jank):

// Path to OnekoJS-File:
var onekoJsFile = '/Assets/SubScripts/OnekoJS/OnekoJS.js'

// This can load a Script file into the current page. Works with a callback. The return needs to be executed on, to launch the function in the script. See loadOneko for an example:
function loadScript(url, callback) {
    const script = document.createElement('script');
    script.src = url;
    script.onload = callback;
    document.head.appendChild(script);
}

// Loads Oneko without being a Module or imported. This works with using a onload callback call to execute a method on. This is very VERY janky (This can be also be viewed as an example on how to use "loadScript"):
function runOneko() {
    loadScript(onekoJsFile, function() {
        // Call function after loading:
        window.oneko();
    });
}

original neko program

implemented in a few different places

feature forks

About

A slightly refactored and documented version of oneko.js with a few additions like scaling.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%