Bug 467488 - Use checker background for images
Summary: Use checker background for images
Status: REPORTED
Alias: None
Product: Falkon
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-17 12:52 UTC by genghiskhan
Modified: 2023-03-17 12:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description genghiskhan 2023-03-17 12:52:28 UTC
Use checker background
1) always; or
2) for image filetypes that support transparency (e.g. gif, png, webp, perhaps there are even more).

Run the following code on https://www.falkon.org/images/screenshot.png

for (let i = 0; i < fileType.length; i++) { 
  if (document.contentType.match(fileType[i])) {
    // 808080 525c66 dddddd
    // Source: /questions/35361986/css-gradient-checkerboard-pattern
    document.body.style.backgroundImage = 'linear-gradient(45deg, #a3a3a3 25%, transparent 25%), linear-gradient(-45deg, #a3a3a3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #a3a3a3 75%), linear-gradient(-45deg, transparent 75%, #a3a3a3 75%)';
    document.body.style.backgroundSize = '20px 20px';
    document.body.style.backgroundPosition = '0 0, 0 10px, 10px -10px, -10px 0px';
  }
}