|
@@ -26,6 +26,7 @@
|
|
|
const SCROLL_DELAY = 50;
|
|
const SCROLL_DELAY = 50;
|
|
|
|
|
|
|
|
window._singleFile_getBoundingClientRect = Element.prototype.getBoundingClientRect;
|
|
window._singleFile_getBoundingClientRect = Element.prototype.getBoundingClientRect;
|
|
|
|
|
+ window._singleFile_offsetY = window.scrollY;
|
|
|
Element.prototype.getBoundingClientRect = function () {
|
|
Element.prototype.getBoundingClientRect = function () {
|
|
|
const boundingRect = window._singleFile_getBoundingClientRect.call(this);
|
|
const boundingRect = window._singleFile_getBoundingClientRect.call(this);
|
|
|
const quarterLeft = Math.floor(screen.width / 4);
|
|
const quarterLeft = Math.floor(screen.width / 4);
|
|
@@ -38,7 +39,6 @@
|
|
|
};
|
|
};
|
|
|
scrollBy(0, 1);
|
|
scrollBy(0, 1);
|
|
|
requestAnimationFrame(() => scrollBy(0, -1));
|
|
requestAnimationFrame(() => scrollBy(0, -1));
|
|
|
- window._singleFile_offsetY = window.scrollY;
|
|
|
|
|
scroll(SCROLL_LENGTH, document.documentElement.scrollHeight - screen.height);
|
|
scroll(SCROLL_LENGTH, document.documentElement.scrollHeight - screen.height);
|
|
|
|
|
|
|
|
function scroll(offsetY, maxOffsetY) {
|
|
function scroll(offsetY, maxOffsetY) {
|