subject-f / guyamoe

Kaguya Manga Reader Website
https://guya.moe
GNU Affero General Public License v3.0
462 stars 66 forks source link

Fix annoying manga-card behaviour #115

Closed isaqueks closed 3 years ago

isaqueks commented 3 years ago

As the .manga-card.bigg > .picture element content is inserted via JavaScript, while the script doesn't load, it's width is 0. When JavaScript loads (and inserts the content), the card width is calculated, which cause an annoying layout change. This PR fix the issue by setting an initial width to the card. These GIFs bellow demonstrate the difference (sorry for the crappy image quality!): Before the fix: old After the fix: new This PR also lower the Cumulative Layout Shift

Algoinde commented 3 years ago

Instamerge, thanks for the fix!