0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-27 22:22:42 +00:00
Commit Graph

109 Commits

Author SHA1 Message Date
Víctor Losada Hernández
2c5c3d40df revert toolbar changes 2024-12-09 22:08:39 +01:00
Víctor Losada Hernández
eca0f59b40 Merge branch 'master' of https://github.com/naturalcrit/homebrewery into adress-small-accessibility-concerns 2024-12-09 21:52:25 +01:00
Gazook89
9bc4b1fb56 Changes to core.less, reset.less, and toolbar
Making some changes to the reset.less so that some default UA button styling is removed.

Then, changing core.less so that the classic "HB" button styling is scoped to a certain class `.colorButton`.  This will make it easier to use the button element in other places.
2024-11-10 21:48:01 -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
Gazook89
810c2140c9 move some toolbar specific styling to toolbar.less 2024-10-13 20:45:05 -05:00
Gazook89
96ae07a456 Small style change on checkbox inputs 2024-10-13 09:39:41 -05:00
Gazook89
b33d9264d3 unify terms to 'spreads'
This commit only renames things, changes no logic.  Any mention of "book", "view", or "mode" is renamed in relation to "spreads".

The AnchoredBox.jsx file is renamed to Anchored.jsx

Extra icons are deleted, and the remaining ones are renamed.
2024-10-12 23:25:14 -05:00
Gazook89
1741abc3fe Refactor AnchoredBox for greater flexibility
Big change to how the AnchoredBox component is structured so that it can be used in more than just one spot.  Now composed of the wrapper Anchored, with two children AnchoredTrigger and AnchoredBox, each of which can have their own arbitrary children.

Next steps will involve renaming the component file to Anchored.jsx, moving most styling out of the attached stylesheet (and into brewRenderer.less), and adding props to pass in Anchor Positioning properties.
2024-10-12 23:12:27 -05:00
Gazook89
27f471791d Small change in title phrasing 2024-10-12 13:28:25 -05:00
Gazook89
b58b9ca8f0 Merge branch 'View-Modes-Radio-Options' into View-Modes 2024-10-12 11:06:09 -05:00
Gazook89
ba0b3e7d93 Add toggle for Page Shadows
Reworks the pagesStyles to a broader object previewStyles.  This new object has this structure:

```
{
  targetElement : { cssProperty: value }
}
```
2024-10-12 11:05:23 -05:00
Gazook89
6fca21b6ed set defaultValue of gap sliders
defaultValue matches the normal styled values of the gap property on the .pages element.

removed the "tooltip" that showed the current value from the range sliders inside the anchoredbox (the gap sliders).
2024-10-11 22:53:38 -05:00
Gazook89
835305bcf6 Add a title to each button
add a role to the toolbr.
2024-10-11 22:32:53 -05:00
Gazook89
395f2d16fa change view mode toggles to indiv buttons
Rather than a single button with three states, it is three buttons.  Went with buttons with `role='radio'` rather than true radios mostly because that is what Radix does.
2024-10-11 22:06:41 -05:00
Víctor Losada Hernández
3e6884b506 dynamic input width 2024-10-11 00:32:28 +02:00
Gazook89
d6d6cc1e29 Add View Mode Options
Adds a new AnchoredBox component that is functionally a clone of the "saving error" notifications, but drops a lot of the JS in favor of the new (chrome-only!) CSS Anchor Positioning API.  In subsequent commits, either alternate styling or a polyfill will be added non-supported browsers.

The box contains a few inputs that modify the CSS applied to `.pages`, most critically a "start on right" toggle for the Facing Pages mode.
2024-10-06 21:51:44 -05:00
Gazook89
9fce94af63 Small CSS tweaks/display 'value' tooltip only if exists
The range slider should only display a tooltip for the value if the value attribute exists.  For example, the difference between controlled and uncontrolled inputs.

Update toolBar.less
2024-10-06 21:26:48 -05:00
Gazook89
41f390b305 Add a classname to recto configuration
Adding class name so that it can be toggled between 'recto' and 'verso'.  Verso being the normal left/right configuration, no styling is needed.  With recto, the first page is shifted to the second slot, or right side.
2024-10-06 21:24:50 -05:00
Gazook89
4259931b67 Merge branch 'master' into View-Modes 2024-10-05 21:39:06 -05:00
Trevor Buckner
5cc5eec619 Lint toolbar and snippetbar 2024-09-16 01:41:46 -04:00
Trevor Buckner
58a2993fe1 use className for react classes
Avoid warning of conflict with JS "class" keyword.
2024-09-09 11:00:45 -04:00
Gazook89
49e072f03f Add button to toggle Preview tools
Toggles a state variable to either visible or hidden which is used to set a related class on the toolbar.  The hiding is done with CSS, just reducing the width of the toolbar and the opacity of the tools.
2024-09-04 13:54:55 -05:00
Gazook89
a7ddeafd06 revert change 2024-08-27 11:59:29 -05:00
Trevor Buckner
0ce3ac9be2 Merge branch 'master' into Fix-Toolbar-Positioning 2024-08-27 11:27:36 -04:00
Gazook89
a7c4b78ec8 set position relative, remove padding 2024-08-27 09:03:24 -05:00
Gazook89
7bc0af9a8c utilize Infinity and reduce() 2024-08-27 08:42:45 -05:00
Gazook89
e06611a90f set all zoom buttons to use handleZoomButton
All zoom buttons run through same handler now.

They no longer take only the delta of the current zoom and desired zoom-- they take the actual desired zoom.

calculateZoom is now calculateChange, to help get the desired delta.
2024-08-26 16:16:13 -05:00
Gazook89
7b767368df Change icons to mask-image
Removes icons as components, uses mask-image instead.

Sets a size on the .fac icons to 1em so by default they are 1em and retain their aspect ratio.

rename the icon files for consistency.
2024-08-26 15:51:35 -05:00
Trevor Buckner
d4d27aab6a Merge branch 'master' into Fill-Pane-Buttons 2024-08-24 23:59:19 -04:00
Trevor Buckner
4b0b56dd35 Lint the jsx files 2024-08-24 23:55:17 -04:00
Trevor Buckner
bf6eae7b3c Simplify some logic in Toolbar 2024-08-24 23:54:09 -04:00
Trevor Buckner
5069eadd0a Manual tidying of .less files 2024-08-24 23:53:07 -04:00
Gazook89
609b40e84c Merge branch 'pr/3499' into View-Modes 2024-08-24 21:28:39 -05:00
Gazook89
94ae33d328 Merge branch 'pr/3499' into Fill-Pane-Buttons 2024-08-24 21:28:13 -05:00
Gazook89
690c683943 select text when clicking into page input 2024-08-24 09:08:19 -05:00
Gazook89
3acf90dfdb Add handlePageChange() to control input
Reintroducing handlePageChange() method to handle the page input separately from the scroll function.  It tests the regex pattern on the string, parses to integer, and sets pageNum state.

scrollToPage also now sets the pageNum state after performing the scroll so the input box matches the new current page.
2024-08-24 09:05:43 -05:00
Gazook89
07c574fa42 Merge branch 'Fill-Pane-Buttons' into View-Modes 2024-08-23 23:26:24 -05:00
Gazook89
6bb5d04f07 round the calculated zoom level 2024-08-23 23:02:04 -05:00
Gazook89
b0b1f7fd0b update method calls for zoom buttons
update method names in onClick events to match latest changes to the branch this builds from.
2024-08-23 22:58:43 -05:00
Gazook89
c25bf95a66 Merge branch 'pr/3499' into Fill-Pane-Buttons 2024-08-23 22:56:37 -05:00
Gazook89
a351013359 remove some odd if statement in onChange 2024-08-23 22:54:29 -05:00
Gazook89
f3ed174b0e eslint and stylelint
stylelint has a problem with the `:horizontal` pseudo selector in brewRenderer.jsx, which is being used to apply some styling to the custom scrollbars.  As far as i can tell, the selector is not standards-track, so that is probably why.  Not sure if we want to adjsut our stylelint config to allow it?
2024-08-23 19:16:59 -05:00
Gazook89
977d0ea73a eslint 2024-08-23 19:05:23 -05:00
Gazook89
04effa2150 removed whitepsace 2024-08-23 18:59:32 -05:00
Gazook89
7f694e6ca7 fold handlePageChange directly into input onChange
Moved the single-line handler to operate directly in the onChange handler of the input that is calling it.

Considered doing the same with handleZoomChange, but that handler is used by two buttons rather than just one.
2024-08-23 18:58:51 -05:00
Gazook89
769a03916b rename pageInput state variable to pageNum 2024-08-23 18:48:36 -05:00
Gazook89
f34107ee1d fix typo 2024-08-23 15:06:48 -05:00
Gazook89
49a4daa8f6 useEffect hook to update view after mode select
utilize useEffect hook to trigger render when the mode state is changed.

Move modes array to top level array, and change 'book-mode' to 'facing', and add 'flow' mode.

toggle modes as class names in .pages div, which are each styled as required.
2024-08-23 14:29:02 -05:00