Skip to content

Commit

Permalink
make increments finer
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Nov 7, 2023
1 parent 1cd88f9 commit 62c72c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

function normalizeOffset(xOffset, yOffset) {
const length = Math.sqrt(xOffset ** 2 + yOffset ** 2);
const effLength = Math.min(length / 200, 1)
const effLength = Math.min(length / 400, 0.5)
return [xOffset / length * effLength, yOffset / length * effLength];
}


function layerShadow(xOffset, yOffset) {
// Repeat 10 times, with increasing offset and color
return [...Array(10).keys()].map((i) =>
// Repeat 20 times, with increasing offset and color
return [...Array(20).keys()].map((i) =>
`${xOffset * i}px ${yOffset * i}px ${shadowColor}`
).join(", ");
}
Expand Down

0 comments on commit 62c72c9

Please sign in to comment.