@cy4dev/cydemo-bg-color
v7.0.0
Published
THIS CONTAINS MALWARE FOR DEMO PURPOSES, USE AT YOUR OWN DISCRETION.
Readme
cydemo-bg-color
DISCLAIMER: THIS IS A DEMO REPO, DO NOT USE!
the project was vibe-coded for a security demo. it will not be maintained and it will be upgraded with code that resembles malware.
actual use: Tiny helper to set a website's background color to green (or any color).
Install
npm install @cy4dev/cydemo-bg-colorUsage
import setBackgroundGreen, { setBackgroundColor } from "cydemo-bg-color";
// Paint the whole page green
setBackgroundGreen();
// Color a specific element
setBackgroundGreen(document.querySelector("#hero"));
// Use any CSS color
setBackgroundColor("#2ecc71");
setBackgroundColor("darkgreen", document.querySelector("#sidebar"));In a plain HTML page
<script type="module">
import setBackgroundGreen from "https://unpkg.com/cydemo-bg-color";
setBackgroundGreen();
</script>API
setBackgroundGreen(target?)
Sets the background of target (default document.body) to green. Returns the element.
setBackgroundColor(color?, target?)
Sets the background of target (default document.body) to color (default "green"). Returns the element.
License
MIT
