0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-30 17:32:38 +00:00
Commit Graph

454 Commits

Author SHA1 Message Date
Gazook89
28a7f24989 add scrollToHash method back in
pretty much completely unchanged, was originally moved just to help with merging master in (ie it was erroneously removed)
2024-11-07 20:32:30 -06:00
Gazook89
28855d02a6 dynamic text input width to match characters 2024-11-07 19:46:07 -06:00
Gazook89
650ec04417 fix 'disabled' attribute on min/max of page range 2024-11-07 18:56:19 -06:00
Gazook89
9ef11bca99 lint and refactor 2024-11-07 10:40:44 -06:00
Gazook89
88b34a7ba3 Fix 'current page' input when zoomed in close
When the page is zoomed in very close, such that <30% of the page is in view, it doesn't register changes to the 'current page'.  This fixes that, passing in the 'centerPage' if 'visiblePages' is empty.

I don't love this fix, i think the visiblePages should always have *something* in it, but I can't quite figure out how to set that (since the normal update to visiblePages is happening in an observer that doesn't fire if nothing is in view).
2024-11-07 10:17:43 -06:00
Gazook89
9d86384032 refactor styles 2024-11-06 23:07:46 -06:00
Gazook89
a6bc87bcea apply displayOptions to legacy brews as well. 2024-11-06 23:07:03 -06:00
Gazook89
63add047b6 'fit page' zoom button fits two pages in "facing" spread
If the 'facing' spread is active, the 'fit to view' zoom button fits two pages side by side in the view, rather than setting only one page in view.
2024-11-06 23:03:24 -06:00
Gazook89
5b14e0e9b5 tweak alignment of spreads
the `safe` keyword for `justify-content`, in combo with `center`, means that the content will be centered in the viewport unless there is not enough space for it.  If there is not enough space, it aligns it to the *start*/left edge, rather than keeping it centered and clipping the left edge of the page.
2024-11-06 21:55:16 -06:00
Gazook89
274e734135 add displayOptions to dependency array for memo
The memoization of the renderPages() method prevents a re-render when something like pageShadows is updated, so displayOptions are added to the dependency array in the memo method.
2024-11-06 21:53:14 -06:00
Gazook89
3818424251 Adjust "next page" button
Prior to fix, the "next page" button in the toolbar wouldn't work well if there were multiple pages in view that were in a single 'row'.  This is because the logic is to take the pages that are "visible", take the max of those pages, and then scroll to that page.  But the issue is that if the 'max' page is in the same row as other pages, the range of visible pages doesn't change....the max will always be the same.

So the change here basically runs the scroll function twice-- if the first run results in the same 'max' page as before the scroll, it runs it again but with the target page being "max + 1", which will bump the target to the next row.
2024-11-06 21:24:18 -06:00
Gazook89
93b9f1d1da Merge branch 'Intersection-Observer' into Observer-Master-merge 2024-11-05 14:03:09 -06:00
Gazook89
89a16956b9 Merge branch 'master' into View-Modes 2024-11-04 14:22:54 -06:00
Gazook89
b098d28407 linting 2024-11-04 14:08:06 -06:00
Gazook89
1be1b3b747 small accessibility changes. 2024-11-04 13:55:18 -06:00
Trevor Buckner
f63d2de8f4 Refactor toolbar view options (#2)
* Refactor toolbar view options

* Remove a couple more unused states
2024-11-01 22:19:48 -05:00
G.Ambatte
f5bc490380 Remove type='submit' attribute 2024-10-29 18:10:25 +13:00
G.Ambatte
be4ba06081 Removed unused themes.json import 2024-10-29 17:32:31 +13:00
G.Ambatte
0fda0673b2 Simplify logic & reduce nesting 2024-10-29 17:27:59 +13:00
G.Ambatte
9edf65c252 Shift to element.remove() 2024-10-29 16:50:44 +13:00
G.Ambatte
3f8ec30f89 Fix broken check for document existence 2024-10-29 16:50:33 +13:00
G.Ambatte
f1bebe3895 Move import to be adjacent to existing requires 2024-10-29 16:36:49 +13:00
G.Ambatte
f5954b03f2 Add comment to reference vue-html-secure pacakge 2024-10-29 16:34:50 +13:00
G.Ambatte
a265723c57 Merge branch 'master' into fixLinks-#3547 2024-10-29 16:32:23 +13:00
Víctor Losada Hernández
ddfccba822 Merge branch 'master' of https://github.com/naturalcrit/homebrewery into add-notification-client-side 2024-10-23 19:48:45 +02:00
Víctor Losada Hernández
069d054e30 remove console logs and lint 2024-10-23 19:47:12 +02:00
Víctor Losada Hernández
1f7ff4386b fix html in notifs 2024-10-23 19:45:47 +02:00
Trevor Buckner
6373c398bc Fix scroll PR when no hash 2024-10-23 13:45:10 -04:00
Víctor Losada Hernández
7a78408415 Merge branch 'add-notification-client-side' of https://github.com/5e-Cleric/homebrewery; branch 'master' of https://github.com/naturalcrit/homebrewery into add-notification-client-side 2024-10-23 19:33:14 +02:00
Gazook89
5ab867f21e adjust prev/next page buttons to meet expectations
i hope
2024-10-22 22:36:13 -05:00
Víctor Losada Hernández
999a96b5ce "Rename dismissKeys to dismisskeys in Dialog component and its usage" 2024-10-22 21:46:57 +02:00
Trevor Buckner
d5f498cbf9 Merge branch 'master' into scroll-to-element 2024-10-22 14:09:49 -04:00
Trevor Buckner
5040b9528f cleanup 2024-10-22 14:08:20 -04:00
Trevor Buckner
83a48b8d0c Simplify observer 2024-10-22 13:58:35 -04:00
Trevor Buckner
9fbdd24d01 Cleanup 2024-10-22 13:52:34 -04:00
Trevor Buckner
5b136f651c Call scrollToHash from our existing "frameDidMount`
`frameDidMount` is equivalent to using iframe.addEventListener('load');

Let's not add a new listener and just use the existing event we already have. Functionality still works.
2024-10-22 13:03:12 -04:00
Gazook89
4126188df1 linting 2024-10-21 22:29:58 -05:00
Gazook89
26050e2134 add comment 2024-10-21 22:20:52 -05:00
Gazook89
5c0d6e6012 move formatting of visible pages to toolbar
Doesn't need to be set in brewRenderer state and passed as a prop, when it can just do it's work directly in the toolbar.
2024-10-21 22:18:25 -05:00
Gazook89
de7b13bc15 Add some comments and cleanup
Little changes like removing console.logs and adding comments.
2024-10-21 22:13:12 -05:00
Gazook89
822d0c7738 Fix NaN/undefined showing on first load
Removes currentPage as a variable since it's been replaced.
2024-10-21 21:27:06 -05:00
Gazook89
183dd63021 style change on page text input
Reduce the visual prominence of the page input by using a darker background and a text color that matches the rest of the toolbar icons.  Darker background still indicates this is an interactive item (is an input), hopefully.
2024-10-21 21:19:49 -05:00
Gazook89
0afc2ab2e6 modify effect to enable Jump Editor button
This fixes the "jump editor to preview position" button.
2024-10-21 20:43:32 -05:00
Gazook89
119755e23a Merge branch 'master' into Intersection-Observer 2024-10-21 00:33:56 -05:00
Gazook89
41fdf48ad3 Setup Intersection Observers & more...
Bad commit here with too much stuff.  I apologize.

This sets up two Intersection Observers: the first captures every page that is at least 30% visible inside the `.pages` container, and the second captures every page that has at least one pixel on the horizontal center line of `.pages`.  Both can be arrays of integers (page index).

The "visiblePages" array is duplicated and formatted into a "formattedPages" state, which gets displayed in the toolbar.

The toolbar displays that, unless the user clicks into the page input and enters their own integer (only a single integer, no range), which can then jump the preview to that page on Enter or blur().

The Arrow 'change page' buttons jump the preview back and forth by a 'full set'.
 If one page is viewed at a time, this is moved on page a time, and if 10 pages are viewed at a time it jumps the pages by 10.

Left to do:  adapt the "jump editor to match preview" divider button to work with new "centerPage".
2024-10-21 00:30:45 -05:00
Trevor Buckner
ac766f3b37 Update brewRenderer.jsx 2024-10-18 10:23:56 -04:00
Víctor Losada Hernández
189625c79b adding margin to scroll action to prevent toolbar overlapping 2024-10-17 23:38:27 +02:00
Víctor Losada Hernández
d872a496a7 fix mutation observer integration 2024-10-17 23:38:11 +02:00
Víctor Losada Hernández
9a4473526a move around 2 2024-10-17 22:59:29 +02:00
Víctor Losada Hernández
5077fda3f6 move stuff around for minimal changes 2024-10-17 22:58:14 +02:00