
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
dom-animator
Advanced tools
A nifty JavaScript library, used to show small ASCII animations within comments in your dom. It's a little easter egg for anyone inspecting your code. Nothing more, nothing less.
A nifty JavaScript library, used to show small ASCII animations within comments in your dom. It's a little easter egg for anyone inspecting your code. Nothing more, nothing less.
dom-animator.js
is a stand alone library (no jQuery, or the likes) so usage is pretty straight forward. You won't need any CSS, or HTML... just JavaScript. (since the animations live in comment nodes, in the dom, only)
DomAnimator.js
can be simple, or complex, depending on what you're trying to achieve with your animation. You'll need to create a new instance of domanimator (having already included the script in the page). Here is the most simple example, a winking face.
<script>
var domAnimator = new DomAnimator();
domAnimator.addFrame('o_o');
domAnimator.addFrame('-_o');
domAnimator.animate();
</script>
The above animation, exists on a single line. If you want multiple levels, you can pass in a list of strings to the frame. Or include your own carriage returns (\n
's)
<script>
var domAnimator = new DomAnimator();
domAnimator.addFrame(['0_0', ' | ', ' | ']);
domAnimator.addFrame(['0_-', ' | ', ' | ']);
domAnimator.animate();
</script>
If you like, you can set the one speed, for all of the frames. Otherwise they will default to 500ms intervals. (these are ascii animations, no need for 60fps)
<script>
var domAnimator = new DomAnimator();
domAnimator.addFrame('o_o');
domAnimator.addFrame('-_o');
domAnimator.animate(1000); //ms
</script>
If you want to stop the animation, for any given reason, just call stop
<script>
// Setup
var domAnimator = new DomAnimator();
domAnimator.addFrame('o_o');
domAnimator.addFrame('-_o');
domAnimator.animate();
// After 10 seconds.
setTimeout(function() {
domAnimator.stop(); // Stop the animation
}, 10000);
</script>
You can see the animation in the console on the demo page. There's also a video, if you're really confused.
Dom Animator has been tested in the latest stable builds of Safari, Chrome & Firefox... Chrome displays the a little cleaner, since it supports newlines in the console. But all the browsers work.
The MIT License (MIT)
Copyright (C) ~ Tim Holman ~ timothy.w.holman@gmail.com
FAQs
A nifty JavaScript library, used to show small ASCII animations within comments in your dom. It's a little easter egg for anyone inspecting your code. Nothing more, nothing less.
The npm package dom-animator receives a total of 0 weekly downloads. As such, dom-animator popularity was classified as not popular.
We found that dom-animator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.