separate reader mode into individual controller, add scroll triggers for fragments

This commit is contained in:
Hakim El Hattab
2023-09-14 13:00:31 +02:00
parent 6aa1eae796
commit f26d31570e
15 changed files with 415 additions and 211 deletions

View File

@@ -194,8 +194,6 @@ const Plugin = {
var startTop = block.scrollTop;
var targetTop = highlightBounds.top + ( Math.min( highlightBounds.bottom - highlightBounds.top, viewportHeight ) - viewportHeight ) / 2;
console.log(startTop, targetTop)
// Account for offsets in position applied to the
// <table> that holds our lines of code
var lineTable = block.querySelector( '.hljs-ln' );