Frosted Glass/Panel Effect, Cross Browser Solution, Vanilla JavaScript and CSS
github.com
github.com
edit: Demo is changed slightly on smaller screens to better demonstrate the blur.
Things changed:
- Reverted back to using xlink:href rather than href attribute within the image element (the newer href attr was not supported in Safari)
- Added two new attributes inside the filter element:
1) filterRes (needed for Safari to display the blur on page load without being prompted by a resize)
2) color-interpolation-filters (some older versions of Safari were using a different variation of this filter and the blur effect would't look right)
- Autoprefixed main.css for older browser compatibility
Frosted Panel is a cross browser solution which allows you to have a full scale, centered, background-image with a responsive, blurry panel overlapping it, of which you can put whatever content you would like inside.
It works by taking advantage of SVG filters, which are supported in most (if not all) browsers, while panning and zooming a duplicate SVG image of the original background-image in order to mimic the actual background-image of the body tag.
Also the extra element attributes are not 'data-' attributes and will not validate as HTML5.
Webkit/Blink/Firefox on mobile/desktop is all there in the referred to article. Edge is soon to be Webkit so for me the target browser list is not as extensive as for some. IE is depreciated and was never HTML5.
Can we just have this smaller list of browsers, CSS only and HTML5 valid with no warnings?
Apart from that, great work!
Why support IE you ask? Why not? Some clients force their devs to support legacy browsers such as Internet Explorer.
The panel was located in a bad place for demonstrating the blur effect on smaller screens because there was just blue sky with nothing else going on, therefore I have changed the height dimension to 80% so it covers the snowboard and better demonstrates the effect.