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

Links open in new page, params auto fill, vite.config.js removed, WIP options disabled

Changed files
+41 -14
src
+3 -3
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">Help</a></li>
-
<li><a href="https://buymeacoffee.com/treysdevshed">Buy me a coffee</a></li>
</ul>
</div>
···
<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>
</ul>
</div>
+33
src/getParams.js
···
···
+
window.addEventListener("DOMContentLoaded", () => {
+
const defaults = {
+
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
+
}
+
+
let params = {};
+
+
if (document.referrer.includes("/")) {
+
const indexParms = new URLSearchParams(new URL(document.referrer).search);
+
+
for (const [key, value] of indexParms.entries()) {
+
params[key] = value;
+
}
+
} else {
+
params = { ...defaults }
+
}
+
+
document.querySelectorAll("input").forEach(input => {
+
input.value = params[input.name] || "";
+
});
+
})
+5 -3
src/pages/config.html
···
<h1>Settings</h1>
-
<form action="/index.html" method="get" class="form-container">
<input type="hidden" name="v" value="1">
···
<label for="smnsz">Plow direction</label>
<select name="plwd" id="plwd" placeholder="right" required>
<option value="left">left</option>
-
<option value="right">right WIP</option>
-
<option value="random">random WIP</option>
</select>
<label for="plws">Plow scale</label>
···
<button type="submit" value="submit">Submit</button>
</form>
</div>
</body>
</html>
···
<h1>Settings</h1>
+
<form action="../../index.html" method="get" class="form-container">
<input type="hidden" name="v" value="1">
···
<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>
···
<button type="submit" value="submit">Submit</button>
</form>
</div>
+
+
<script type="module" src="../getParams.js"></script>
</body>
</html>
-8
vite.config.js
···
-
/**
-
* @type {import('vite').UserConfig}
-
*/
-
const config = {
-
publicDir: "assets",
-
};
-
-
export default config;
···