craigsapp / website-polish-scores

Front-end for digital transcriptions of the Polish Music Heritage in Open Access project
https://polishscores.org
3 stars 1 forks source link

Limit height of playback tool when analysis/configuration/download etc pane is open. #258

Closed craigsapp closed 7 months ago

craigsapp commented 7 months ago

Example for score https://polishscores.org/?id=pl-kk--kk-i-482--002-004

Default position of the MIDI playback progress bar:

Screenshot 2024-02-05 at 13 48 42

When the score view progresses towards the bottom of the page, the progress bar goes upwards, but stops before it hits the navigation tools:

Screenshot 2024-02-05 at 13 51 42

When a navigation pane is open, the

Screenshot 2024-02-05 at 13 52 46

MIDI playback progress bar travels over it:

Screenshot 2024-02-05 at 13 52 46

Instead the MIDI playback tool should stop once it reaches the pane (brownish background).

Limit the position of the MIDI playback bar to the bottom of the navigation panes. Currently the max position is fixed to a pixel height of the navigation tool bar bottom, but it will need to be adjusted dynamcally (navigation panes will have different heights, and could even be different heights depending on the active language being Polish or English).

craigsapp commented 7 months ago

Perhaps this can be done with a MutationObserver on the pane height (when it is visible).

Currently done with this CSS:

#player {
        position:sticky;
        position: -webkit-sticky;
        margin-left:-15px;
        margin-top:0px;
        visibility:hidden;
        color: #666;
}
craigsapp commented 7 months ago

Implemented with commit https://github.com/craigsapp/website-polish-scores/commit/4c29a6a2e8633f5aa0d206d3647910c79f0b0114

The scroll event listener was also required (which simulates position: sticky).

Example: https://polishscores.org/?id=pl-kk--kk-i-382--079-004

Default position:

Screenshot 2024-02-06 at 21 56 19

Opening the configuration pane:

Screenshot 2024-02-06 at 21 56 39

Scrolling down the page:

Screenshot 2024-02-06 at 21 56 57

Closing the configuration pane:

Screenshot 2024-02-06 at 21 57 16
craigsapp commented 7 months ago

Commit https://github.com/craigsapp/website-polish-scores/commit/8a94e614a0f356df670c273e4591fc7dbaf238af moves the listeners/observer to _includes/listeners where it will be easier to find later.