A browser source overlay for winter vibes for your Live Streams or Videos

Compare changes

Choose any two refs to compare.

Changed files
+237 -56
md
src
+39 -9
README.md
···
-
# winterVibesJS
-
No build JS twitch wintery overlay.
+
# Winter Vibes JS
+
Simple, no build OBS winter overlay!
-
Run locally and tweak or add the Github page https://treybastian.github.io/winterVibesJS as a browser source.
+
## About
-
## 0 Dependencies required!
-
This project has no required dependencies.
+
This is a simple winter overlay you can use for your Twitch stream or for anything else! What does it do? It adds snow that you can adjust, and a small plow that will clear all the accumulated snow. The easiest way to use it for your stream is by adding it as a browser source in OBS, and boom, it's snowing!!
-
The only dependency in package.json is vite for HMR purposes while developing.
+
You can find it at [https://wintervibes.treybastian.com](https://wintervibes.treybastian.com/index.html?v=1&cw=320&ch=180&smx=40&smnsz=1&smxsz=4&smxspd=0.07&snmnspd=0.04&plwspd=0.1&plwd=left&plws=1&gamax=4&gas=20")
-
Everything uses JSDoc
+
Once on the page, you can right-click, and a context menu will appear, from which you can navigate to settings.
+
##### What all can you adjust:
+
- Window size
+
- Snow (max, size, speed)
+
- Plow (speed, direction WIP, scale)
+
- Ground (accumulator max, accumulator slices)
-
# THIS IS NOT DONE YET AND IS A WIP
-
# WARNING The query parameters are versioned, but the version isn't enforced yet bookmarks may be unstable
+
You can run it locally if you want to change sprites or any other code. It has 0 dependencies; the only dependency in the `package.json` is Vite for HMR purposes while developing.
+
+
To run it, use:
+
```sh
+
pnpm run dev
+
```
+
or any other way you would like to render index.html
+
+
Optionally, if you want to use dependencies:
+
```sh
+
pnpm install
+
```
+
+
## WIP
+
+
Keep in mind that this project is still a work in progress. Some features are not yet implemented.
+
- [ ] Plow direction - Right
+
- [ ] More customization
+
- [ ] More weather types...
+
+
+
## Contributing
+
+
This project is open source, not just public source.
+
+
To contribute email a git patch to patches@treybastian.com
+
+
I do not accept pull requests on any of my projects.
+1 -2
index.html
···
<div id="contextMenu" class="context-menu" style="display:none">
<ul>
<li><a href="./src/pages/config.html">Settings</a></li>
-
<li><a href="https://github.com/TreyBastian/winterVibesJS/blob/main/README.md" target="_blank">Help</a></li>
-
<li><a href="https://buymeacoffee.com/treysdevshed" target="_blank">Buy me a coffee</a></li>
+
<li><a href="https://tangled.org/TreyBastian.com/winterVibesJS" target="_blank">Help</a></li>
</ul>
</div>
+70
md
···
+
[?1049h[?1h=[?2004h[?u[?25h[?25l(B
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[?1004h[?25h[?25l(B 1
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
(BREADME 0,0-1 All(B
+
[2 q[2 q[?1002h[?1006h 1 
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
~
+
(BREADME 0,0-1 All(B
+
[?25h[?25l[2 q[?1002l[?1006l(B[?25h[2 q[?1l>[>4;0m[?2004l[?1004l[?25h[?25l [?1049l[?25h
+15 -13
src/contextMenu.js
···
document.oncontextmenu = rightClick;
function hideMenu() {
-
document.getElementById("contextMenu").style.display = "none"
+
document.getElementById("contextMenu").style.display = "none";
}
+
/**
+
* @param {MouseEvent} e
+
*/
function rightClick(e) {
-
e.preventDefault();
+
e.preventDefault();
-
if (document.getElementById(
-
"contextMenu").style.display == "block")
-
hideMenu();
-
else {
-
let menu = document
-
.getElementById("contextMenu")
+
if (document.getElementById("contextMenu").style.display == "block")
+
hideMenu();
+
else {
+
let menu = document.getElementById("contextMenu");
-
menu.style.display = 'block';
-
menu.style.left = e.pageX + "px";
-
menu.style.top = e.pageY + "px";
-
}
-
}
+
menu.style.display = "block";
+
menu.style.left = e.pageX + "px";
+
menu.style.top = e.pageY + "px";
+
}
+
}
+
+103 -28
src/pages/config.html
···
</head>
<body>
<div class="container">
-
<h1>Settings</h1>
<form action="../../index.html" method="get" class="form-container">
+
<input type="hidden" name="v" value="1" />
-
<input type="hidden" name="v" value="1">
-
<div class="settings-group">
<span class="title">Window</span>
<div class="separator"></div>
<label for="cw">Width</label>
-
<input type="number" name="cw" id="cw" placeholder="320" min="0" required>
-
+
<input
+
type="number"
+
name="cw"
+
id="cw"
+
placeholder="320"
+
min="0"
+
required
+
/>
+
<label for="ch">Height</label>
-
<input type="number" name="ch" id="ch" placeholder="180" min="0" required>
+
<input
+
type="number"
+
name="ch"
+
id="ch"
+
placeholder="180"
+
min="0"
+
required
+
/>
</div>
-
+
<div class="settings-group">
<span class="title">Snow</span>
<div class="separator"></div>
<label for="smx">Snow max</label>
-
<input type="number" name="smx" id="smx" placeholder="40" min="0" required>
-
+
<input
+
type="number"
+
name="smx"
+
id="smx"
+
placeholder="40"
+
min="0"
+
required
+
/>
+
<label for="smnsz">Snow min size</label>
-
<input type="number" name="smnsz" id="smnz" placeholder="1" min="0" required>
-
+
<input
+
type="number"
+
name="smnsz"
+
id="smnz"
+
placeholder="1"
+
min="0"
+
required
+
/>
+
<label for="smxsz">Snow max size</label>
-
<input type="number" name="smxsz" id="smxsz" placeholder="4" min="0" required>
-
+
<input
+
type="number"
+
name="smxsz"
+
id="smxsz"
+
placeholder="4"
+
min="0"
+
required
+
/>
+
<label for="smxspd">Snow max speed</label>
-
<input type="number" step=".01" name="smxspd" id="smxspd" placeholder="0.07" required>
-
+
<input
+
type="number"
+
step=".01"
+
name="smxspd"
+
id="smxspd"
+
placeholder="0.07"
+
required
+
/>
+
<label for="snmnspd">Snow min speed</label>
-
<input type="number" step=".01" name="snmnspd" id="snmnspd" placeholder="0.04" required>
+
<input
+
type="number"
+
step=".01"
+
name="snmnspd"
+
id="snmnspd"
+
placeholder="0.04"
+
required
+
/>
</div>
-
+
<div class="settings-group">
<span class="title">Plow</span>
<div class="separator"></div>
<label for="plwspd">Plow speed</label>
-
<input type="number" step=".01" name="plwspd" id="plwspd" placeholder="0.1" required>
-
+
<input
+
type="number"
+
step=".01"
+
name="plwspd"
+
id="plwspd"
+
placeholder="0.1"
+
required
+
/>
+
<label for="smnsz">Plow direction</label>
<select name="plwd" id="plwd" placeholder="right" required>
<option value="left">left</option>
<option value="right" disabled>right WIP</option>
<option value="random" disabled>random WIP</option>
</select>
-
+
<label for="plws">Plow scale</label>
-
<input type="number" name="plws" id="plws" placeholder="1" min="0" required>
+
<input
+
type="number"
+
name="plws"
+
id="plws"
+
placeholder="1"
+
min="0"
+
required
+
/>
</div>
-
+
<div class="settings-group">
<span class="title">Ground</span>
<div class="separator"></div>
<label for="gamax">Ground accumulator max</label>
-
<input type="number" name="gamax" id="gamax" placeholder="4" min="0" required>
-
+
<input
+
type="number"
+
name="gamax"
+
id="gamax"
+
placeholder="4"
+
min="0"
+
required
+
/>
+
<label for="gas">Ground accumulatior slices</label>
-
<input type="number" name="gas" id="gas" placeholder="20" min="0" required>
+
<input
+
type="number"
+
name="gas"
+
id="gas"
+
placeholder="20"
+
min="0"
+
required
+
/>
</div>
-
-
<button type="button" onclick="window.location.href='/'">Cancel</button>
-
<button type="submit" value="submit">Submit</button>
+
+
<a href="../../index.html" class="button" style="color: red">Default</a>
+
<button type="submit" value="submit" style="color: green">Save</button>
</form>
</div>
+9 -4
src/styles/config.css
···
-
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');
+
@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap");
* {
font-family: "Pixelify Sans", sans-serif;
···
color: #e0e0e0;
}
-
button {
+
button,
+
.button {
+
text-decoration: none;
+
font-size: 1em;
border-radius: 10px;
padding: 5px;
background-color: #1e2a3a;
···
border: 1px solid #555;
}
-
button:hover {
+
button:hover,
+
.button:hover {
background-color: #273950;
cursor: pointer;
}
···
height: 1px;
background-color: #555;
margin: 10px 0;
-
}
+
}
+