Invert parallax and keep background aspect

This commit is contained in:
2026-02-03 01:17:57 +01:00
parent bb810584ee
commit 64f5b76362
2 changed files with 18 additions and 7 deletions

View File

@@ -841,8 +841,9 @@ function setupBackgroundPan(config = {}) {
const root = document.documentElement;
const maxOffset = config.maxOffsetPx ?? 30;
const ease = config.ease ?? 0.08;
if (config.scalePercent) {
root.style.setProperty("--bg-scale", config.scalePercent);
const scaleFactor = config.scaleFactor ?? 1.12;
if (scaleFactor) {
root.style.setProperty("--bg-scale", scaleFactor);
}
let targetX = 0;
let targetY = 0;
@@ -865,7 +866,7 @@ function setupBackgroundPan(config = {}) {
window.addEventListener("mousemove", (e) => {
const nx = (e.clientX / window.innerWidth - 0.5) * 2;
const ny = (e.clientY / window.innerHeight - 0.5) * 2;
setTarget(nx * maxOffset, ny * maxOffset);
setTarget(-nx * maxOffset, -ny * maxOffset);
});
window.addEventListener("mouseleave", () => setTarget(0, 0));
@@ -934,7 +935,7 @@ function scoreToEmoji(score) {
}
function neutralEmoji() {
return "😐";
return "⬅️";
}
function signatureSuggestions(list) {