Commit Graph
92 Commits
Author SHA1 Message Date
Gazook89 051eed0e83 restructure html, eliminate .tool divs
Treat each input and button as a direct child of the `.group` class, removing the intermediate div and reassign the `tool` classname to those inputs and buttons.  One item, the current / total page "set", is wrapped in a .tool div because they should be considered one item (even within the .group container).

And then a bunch of CSS adjustments to match the new structure.
2024-08-20 21:08:07 -05:00
Gazook89 cdc2ffeff4 remove if statement that shouldn't occur at all
Removing a redundant if/else that shouldn't be possible now that the currentPage is clamped between 1 and totalPages.
2024-08-20 20:18:54 -05:00
Gazook89 83244485ab Move scrollToPage to toolbar component
Keeps toolbar functions within the toolbar component and reduces props that need to be sent down.
2024-08-20 15:15:36 -05:00
Gazook89 f5ee55d0ca keep current page number within existing page range
Make it so that if a user enters a page number higher than the total page count, it jumps them to last page.  if lower than 1, it jumps them to first page.
2024-08-19 23:40:21 -05:00
Gazook89 2cf73698e8 white space lint 2024-08-19 23:38:48 -05:00
Gazook89 28a06348ab style tool groups, minor tweaks to spacing 2024-08-19 23:15:02 -05:00
Gazook89 9510b4d097 wrap each set of toolbars into groups
Allows more styling options, including flex wrapping by group rather than individual button.
2024-08-19 23:14:45 -05:00
Gazook89 37c8ea4fd7 Add total page count and some styling
Displaying the total page count near the current page number means we can lose the bottom right toolbar entirely (the renderer could be added to top toolbar, or just left for the metadata info in title bar).
2024-08-19 23:01:55 -05:00
Gazook89 9adc3e2e1a linting 2024-08-19 22:49:38 -05:00
Gazook89 fd00a9f81d remove some console logs and some linting 2024-08-19 22:46:25 -05:00
Gazook89 720e43e9d9 update page increment/decrement buttons
putting the `pageInput - 1` modifier in the `scrollToPage` method allows for more understandable button function ('back button' is `- 1` and 'forward button' is `+ 1`).
2024-08-19 22:43:41 -05:00
Gazook89 176977dd2a change input type to 'text'
Changing input type to text removes the "spinner" controls from within the text box.  The spinner buttons are an accessibility issue (the tiny buttons are tiny), and we already have better buttons for incrementing/decrementing page number.

Text box only accepts numbers.
2024-08-19 22:40:50 -05:00
Gazook89 a42b867bcb create handler function for controlled input
Moved onChange handler function to a component method and simplified it a smidge.

Must use parseInt now because the input type will change to 'text' rather than 'number'
2024-08-19 22:38:46 -05:00
Gazook89 1196a1577f update minZoom and maxZoom variable names
Forgot to update the zoom variable names after making them all uppercase at their assignments.
2024-08-19 22:35:35 -05:00
Gazook89 54b11b1a4c refactor useEffect for updating currentPage state
The current page and the current page input share the same value, so the useEffect hook can be simplified.
2024-08-19 22:34:32 -05:00
Gazook89 7fa9b3cdd2 rearrange state declarations for pages
totalPages shouldn't need to be in state, since this component won't be changing it.

renamed pageNumberInput to just pageInput.  Was just something that happened in the course of working on it.

currentPage doesn't need to have it's own state separate from pageInput, they should always be the same *value*.
2024-08-19 22:32:02 -05:00
Gazook89 2f42c3f857 change top level constants to all caps
Better matches style of top level constants elsewhere in repo
2024-08-19 22:27:49 -05:00
Gazook89 05dd5e4c04 Change .toolbar position to absolute
Set as relative position, the toolbar (and mysteriously, the pageInfo box) would jump up 29px (toolbar height) when the "next page" button was clicked.  absolute pos fixes this.
2024-08-18 18:51:46 -05:00
Gazook89 499c640a11 Move the Toolbar component out of the iframe
The website UI should stay out of the iframe if possible.  Otherwise, users can style the UI on their brew which may or may not be a pain, and it's simple enough to avoid it.
2024-08-18 18:50:36 -05:00
Gazook89 5a11b7918e refactor slider onChange and button onClick
Moved the zoomLevel state assignment to a newer useState hook function, making it easier (and shorter) to update that state within event handlers.

The slider onChange is a single easy line, and the buttons handlers are two lines for clarity.
2024-08-18 00:02:49 -05:00
Gazook89 36ab6923ed remove zoomInput state property
zoomLevel and zoomInput should always be the same, so I've removed one.
2024-08-17 23:43:32 -05:00
Gazook89 7cc967ad49 setZoomLevel to no longer use if/else
Remove the 'in'/'out' parameter of the function and just have the buttons send postive or negative integers equal to the desired change in the zoom.  No need for if/else statements using strings.
2024-08-17 23:39:59 -05:00
Gazook89 d108088295 remove unneeded handler 2024-08-17 21:23:12 -05:00
Gazook89 8be3154865 rename functions/attributes
updateZoom() => handleZoom

updateZoom prop => onZoomChange

More clarity of prop versus handler function.
2024-08-17 20:48:30 -05:00
Gazook89 9aa7c67c5b remove "makeZoom" function
The makeZoom function is redundant if we just insert the style a little further down when the `.pages` div is initialized, as a `style` attribute on the tag.
2024-08-17 20:41:59 -05:00
Gazook89 5a84c0aaa7 Merge branch 'pr/3499' into Simplify-Zoom-Slider 2024-08-17 20:22:57 -05:00
Gazook89 4a6418a475 fix padding on sides of slider
Extra padding on the sides of a range slider extends the length of the slider, such that you can't move the thumb all the way to the end.
2024-08-17 18:08:33 -05:00
Gazook89 efb4c67e2a use zoom icons rather than text 2024-08-17 15:40:52 -05:00
Gazook89 b325779466 remove extra line breaks 2024-08-17 15:38:27 -05:00
Gazook89 0d475ab035 refactor some properties
Mostly change some properties from things like "transparent" to "unset".  A lot of things that are just overriding the default Naturalcrit "colored button".  Moved some properties to the top level `.toolbar` class and let it cascade down.
2024-08-17 15:38:00 -05:00
Gazook89 c791c0f60b modify the interactive states
more closely match the properties editor behavior.  removed some unnecessary (unused) properties.  Outline only appears when element is focused (rather than on hover as well).
2024-08-17 15:36:12 -05:00
Gazook89 f204b0ebc0 tool elements use width:auto for flexibility, but with min-width
Set the child elements of the toolbar to have auto width (can expand as needed), but have a min-width so no button, such as an icon, is too small.
2024-08-17 15:34:13 -05:00
Gazook89 adab8449e0 Change toolbar spacing
replace column-/row-gap with a single gap at 5px.  Padding on each child element will provide the space.  Set a height on toolbar, so child elements can be set to 100% height to improve bg color change on hover.
2024-08-17 15:32:30 -05:00
Gazook89 fc96f6bf95 text input changes (text-transform, radius, border, focus)
Aligning input here with Properties editor inputs.  Removed border radius, added thin border, a focus border.
2024-08-17 14:45:50 -05:00
Gazook89 9924c6049e Aesthetic changes to tooltip (radius, bg color)
Matching tooltip color to the background of the input it belongs to, for better cohesion.  Removed border-radius as well.
2024-08-17 14:26:45 -05:00
Gazook89 21e9251043 aesthetic changes (border, text align, font size)
Text align isn't doing anything, and no other UI element is using a border and doesn't seem necessary here.  Maintains the "flat" design.
2024-08-17 14:25:04 -05:00
Gazook89 19e6d94419 Set as Relative position, remove extra properties
Doesn't need to be Sticky positioning, relative is fine (it is still fixed above the iframe).  Allows us to remove a bunch of extra properties.

Add a smidgen of padding.
2024-08-17 14:23:33 -05:00
Gazook89 232f28b5b4 Remove extra styling of the slider thumb
can just use browser defaults for this.
2024-08-17 14:06:58 -05:00
Gazook89 6af5abd37d Rearrange nesting of slider tooltip
Just moving the :hover:after tooltip to within the existing css rule for sliders.
2024-08-17 14:06:14 -05:00
Gazook89 e0e49c606f Utilize browser defined style for slider, with accent-color
Avoid over-styling of browser-defined slider, but still apply a HB appropriate color scheme.  Prevents us from having to create our own tick marks, so we can just define the `option`s in the datalist and get tick marks in the right spot.
2024-08-17 14:05:14 -05:00
Gazook89 e9e49e39fb Set preview zoom to update with onChange
Commented out the existing onChange handler, switched the onMouseUp that actually applies the zoom to onChange.
2024-08-17 13:59:58 -05:00
Gazook89 ee4eb19f1e Run ESLint auto lint (spaces to tabs mostly) 2024-08-17 13:57:50 -05:00
Gazook89 7c9cc25923 update editor ref's in edit, home, and new pages. 2024-05-16 23:29:30 -05:00
Gazook89 78ce8aa6e3 remove unused ref attributes
from editPage, homePage, newPage, and printPage, as well as splitPane.   The refs were declared, but never used.
2024-05-16 23:25:22 -05:00
Gazook89 8ae22bdc27 fix refs in codeEditor.jsx 2024-05-16 23:15:54 -05:00
Gazook89 46c14ef23b fix refs in editor.jsx
now has refs `editorWrapper` and `editor`-- the former includes the snippet bar and codemirror editor, and the latter includes only the codemirror editor.
2024-05-16 23:12:10 -05:00
Gazook89 b748a597d2 some fixes post merge. 2024-05-15 21:25:45 -05:00
Gazook89 5fb0e123e3 install new dependencies from merging master 2024-05-15 20:50:52 -05:00
Gazook89 9a4a14fa97 add license, rename files for clarity, update references 2024-05-15 20:48:58 -05:00
Gazook89 0c76a546e4 Merge branch 'master' into RPG-Awesome-Redux 2024-05-15 20:19:00 -05:00
Gazook89 295fea7581 Add dropdownTexture for user theme options
If a user theme document has a thumbnail, this will include that thumbnail as a dropdown texture in the options.
2024-05-07 11:00:20 -05:00
Gazook89 928a8b351e Merge branch 'master' into RPG-Awesome-Redux 2024-04-21 20:12:56 -05:00
Gazook89 7ca38b88ad add RPG awesome icons
This branch just does the same thing as the RPG Awesome repo, but more closely aligns with the code used in the other icon fonts and isn't an NPM package.
2024-04-19 23:15:02 -05:00
Gazook89 52904eea09 add a comment 2024-04-13 20:47:38 -05:00
Gazook89 ff84ded547 Convert page to functional component 2024-04-13 11:10:43 -05:00
Gazook89 6220e4f63f Remove unused defaultProps
The defaultProps are not used, and may be a relic of previous error page function.
2024-04-13 10:30:04 -05:00
Gazook89 ed85f77c48 ESLint linting (one small whitespace change). 2024-04-06 21:34:04 -05:00
Gazook89 777438fd94 rename props.brew.uiItems to ...accountDetails
and destructure props at start of account page component.

`accountDetails` is more descriptive of what set of info is being passed through props to the account page, info which is only *then* displayed as UI items.
2024-04-06 21:23:26 -05:00
Gazook89 08406de5cc add code comments for each step. 2024-04-06 15:44:19 -05:00
Gazook89 e1599909bc change name of render method to be more discriptive
"UiItems" is not descriptive enough for a render method because most anything that is rendered is part of the UI.  This could be left as just `render()`, but `renderAccountPage()` provides best context of what is happening.
2024-04-06 15:30:18 -05:00
Gazook89 e7eda1f5ec Convert class component to functional component
Used OpenAI ChatGPT to do the bulk of this, and then fixed some formatting and looked for obvious mistakes.
2024-04-06 15:26:40 -05:00
Gazook89 9f2aaf01c7 Remove unnecessary Nav components and methods. 2024-04-06 14:50:20 -05:00
Gazook89 3b2a48eabf remove + 1 from editor height 2024-04-03 22:52:16 -05:00
Gazook89 e324de8f4f remove 'remake' from font names 2024-04-03 14:09:07 -05:00
Gazook89 7954ae8692 set a min-width on icons, reduce font sizes 2024-04-03 12:57:24 -05:00
Gazook89 59b3038b9b small style changes to terminal output of server start 2024-03-29 20:42:07 -05:00
Gazook89 31cf8b7d28 add browser-readable address and some styling to log. 2024-03-28 14:58:05 -05:00
Gazook89 323d84974c Combine nav and navbar styles
- moves all the nav.less styling to navbar.less in the `client` directory
- deletes nav.less
- changes the nav.jsx import of styles to navbar.less
- stylelint navbar.less
- added a couple comments about easy future changes.
2024-02-10 22:29:16 -06:00
Gazook89 d648bacd26 Merge branch 'master' into theme-selector-styling 2024-01-13 15:28:51 -06:00
Gazook89 1ca5ba1086 Merge branch 'theme-selector-styling' of https://github.com/Gazook89/homebrewery into theme-selector-styling 2024-01-13 15:19:40 -06:00
Gazook89 7c28f60e0a fix z-index layering issue 2024-01-13 15:19:38 -06:00
Gazook89 8674bc9da2 change gray to #999 2023-12-23 20:49:59 -06:00
Gazook89 407c35d9f7 switch to gray 'active' color 2023-12-22 23:40:29 -06:00
Gazook89 8575d72f6e add e.target check to prevent dismissal of select menu 2023-12-22 23:36:46 -06:00
Gazook89 7b8e398891 improve simple styling on theme selector. nest inside toggle. 2023-12-22 22:58:13 -06:00
Gazook89 3cf6691e67 remove width constraint on editors in snippet bar. 2023-09-29 09:31:20 -05:00
Gazook89 8077a91ff7 add foldAll and unfoldAll buttons to snippet bar. 2023-09-29 09:31:20 -05:00
Gazook89 09670b8535 Stylelint the v3 PHB theme. 2023-09-28 00:04:21 -05:00
Gazook89 36f8f39486 Tweak monster H3 sizing and spacing per recommendation 2023-09-28 00:02:57 -05:00
Gazook89 1556cf361a Check for author in author list before increasing views. 2023-09-27 23:46:38 -05:00
Gazook89 c6ef051232 Stylelint the editor.less file. 2023-09-27 22:56:20 -05:00
Gazook89 2c130d1943 add styling for definition lists in the editor. 2023-09-27 22:46:51 -05:00
Gazook89 f1e6a9a41e add syntax highlighting for definition lists 2023-09-27 22:46:51 -05:00
Gazook89 8d3329069a remove logs 2023-08-01 14:16:31 -05:00
Gazook89 2e13eed2ef revert moving pointerMove & pointerUp, now on splitPane 2023-08-01 13:53:38 -05:00
Gazook89 310faa449d set editor font size to 16px on touchscreens
iOS requires minimum 16px font to prevent auto-zooming into input fields.
2023-08-01 13:29:57 -05:00
Gazook89 0bde336226 move all pointer events to divider, not splitPane 2023-07-31 22:20:27 -05:00
Gazook89 73e44b8d7a add touch-action css property to splitPane 2023-07-31 15:06:09 -05:00
Gazook89 a8db7353b0 preventDefaults on pointerEvents to prevent some default behavior. 2023-07-30 20:49:16 -05:00
Gazook89 bda8037cd6 change onMouse events to onPointer events for mobile use. 2023-07-30 20:12:16 -05:00
Gazook89 1f173814ec Add viewport meta tag for mobile view. 2023-07-30 19:40:39 -05:00
Gazook89 deb0e2f85b add meta viewport tag in header 2023-07-30 15:00:42 -05:00