From 1ce2ecd737d1e8a0559006f675422fc99e7cb1a3 Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Tue, 18 Feb 2025 15:42:36 -0800 Subject: [PATCH] Create a footer for shepherding purposes --- public/Program Files/eSheep/eSheep.js | 10 ++++++---- utils/spawnSheep.ts | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/public/Program Files/eSheep/eSheep.js b/public/Program Files/eSheep/eSheep.js index 910b68a4..9dfd6273 100644 --- a/public/Program Files/eSheep/eSheep.js +++ b/public/Program Files/eSheep/eSheep.js @@ -36,9 +36,10 @@ window.Sheep = class eSheep { document.body.clientWidth; // window width this.screenH = - window.innerHeight || + (window.innerHeight || document.documentElement.clientHeight || - document.body.clientHeight; // window height + document.body.clientHeight) // window height + - (this.userOptions.footerMargin || 0); } Start(animation) { @@ -154,9 +155,10 @@ window.Sheep = class eSheep { document.body.clientWidth; this.screenH = - window.innerHeight || + (window.innerHeight || document.documentElement.clientHeight || - document.body.clientHeight; + document.body.clientHeight) + - (this.userOptions.footerMargin || 0); if (this.imageY + this.imageH > this.screenH) { this.imageY = this.screenH - this.imageH; diff --git a/utils/spawnSheep.ts b/utils/spawnSheep.ts index b75c757b..9e33997d 100644 --- a/utils/spawnSheep.ts +++ b/utils/spawnSheep.ts @@ -1,8 +1,10 @@ +import { TASKBAR_HEIGHT } from "utils/constants"; import { loadFiles } from "utils/functions"; type SheepOptions = { allowPopup: string; collisionsWith: string[]; + footerMargin: number; spawnContainer: HTMLElement; }; @@ -47,6 +49,7 @@ export const spawnSheep = (): Promise => const sheep = new window.Sheep({ allowPopup: "no", collisionsWith: ["nav", "section"], + footerMargin: TASKBAR_HEIGHT, spawnContainer: document.querySelector("main") as HTMLElement, });