EmbeddedNotesImprovements removes distracting styles, adjusts to background styles, supports note resizing, and adds note nudging. The goal for this prototype is to have something to port over to mainline Danbooru.
Installation
- Chrome/Firefox: Install Tampermonkey
Project page
Main script
Usage notes
This script only activates on post pages with embedded notes.
Style differences
- 1. Box borders have been hidden
- 2. Resize icons have been hidden
Hovering over the box will restore both the borders and the resize icon.
- 4. Boxes are completely opaque normally
- 5. Boxes have reduced opacity on note editing (0.5 -> 0.25)
Hovering over the box while editing will restore the box to full opacity.
Background styles
Several styles can be mirrored on the box container when the note contains a container with the "note-box-attributes" class
Example:
Some text. <div class="note-box-attributes" style="background-color:white"></div>
Anything outside that parent container including text will count as another node and thus the background styles will not be copied.
- 1. background-color
The background color gets copied from the note attributes element onto the outer container. This makes it so that the margins don't have to be messed with to have the background color extend to the borders.
- 2. border-radius
The border radius gets copied from the parent note attributes element onto the outer container and note box. This allows for rounded containers to be created.
- 3. transform
The transform gets copied from the note attributes element onto the note box. This allows for the note box itself to be transformed.
NOTE: Since this functionality is not currently on Danbooru, others will not see the note box as you see it. So using only the preview function to experiment with is recommended at this time.
Image resizing
When clicking the "view original" link at the top of an image, the text and other attributes for all elements of a note will now scale along with the note boxes and the image. The same is true for when the "Resize to window" in the Options section gets clicked.
- font-size
- line-height
- letter-spacing
- padding
- margin
Note nudging
Now when hovering the mouse pointer over a note box, the note box can be moved by using the directional arrow keys. Clicking a key once will move it one pixel, and holding the key will slide it over. Once the note is in the desired place, open up the note dialogue as usual and save the note.
Note resizing
Now when hovering the mouse pointer over the top-left or bottom-right corners, the note box can be resized using the directional arrow keys. Clicking a key once will move it one pixel, and holding the key will slide it over. Once the note is in the desired place, open up the note dialogue as usual and save the note.
Final
Any suggestions or feedback is appreciated, as they will go into making the mainline function better as well. After the script is stable for about a week, the final product will eventually be ported over to Danbooru.
Latest edits
- (2020-01-23)
- Created OP.
- Version 1 Initial commit
- (2020-01-24)
- Updated note resizing section (Ver. 1.2)
- (2020-01-27)
- Added incremental note resizing (Ver. 1.4)
- (2020-01-30)
- Reworked how font sizes get rescaled to be simpler (Ver. 1.5)
- (2020-01-31)
- Have the popup box be the same dimensions as the note box (Ver. 1.6)
- This helps for cases where transformations and such make the text unreadable
- This also facilitate users that use CSS to make embedded notes non-embedded
Updated