Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background center with transform 3D and filter blur on Firefox

inb4: Sorry for the horribly oversized images that takes super long to load, click on the links and read the question after if you dont like to wait!

So I'm making this prototype of a site where I make a fake 3D effect with 2d images moving with the mouse. I wanted to use the filter blur when the user click on one of the triangles to make a focus on a pop up.

My problem is that it completely breaks in firefox when I add the blur. I have no problem with the blur in chrome but for some reason in firefox, the background image that's supposed to be centered become right aligned and cropped by its own div and if I change in the inspector the background position it moves out of the buggy area.

here's a screen shot of chrome followed by what I get in firefox.

No problem in Chrome Weird bug in firefox

I'm not exactly shure what to do at this point beside giving up the whole blur idea. Any ideas of solutions are apreciated

like image 224
Samuel Charpentier Avatar asked May 12 '17 19:05

Samuel Charpentier


People also ask

Does Firefox support backdrop filter?

While Firefox does not support the backdrop filter property, you can still test your web pages that use backdrop-filter. You can enable the property manually, however, just enabling it in your browser won't help, because it won't be enabled in your client's browser.

How do I blur the background of a picture in Firefox?

(2) There is also a Firefox-specific implementation that can work with any background graphic (e.g., the image drawn with Canvas API): using -moz-element() to copy the background and blur it with filter: blur() .

How do I make the background of a div blurry?

The trick is to use background-position:fixed; on html / body and the element to blur on top of it, so , both background-image lays on the same area of the window. The duplicate uses an extra element, this can be a pseudo element if you do not wish to modify HTML structure. Flex can also be used to center body.


1 Answers

So I've had to set completely to 0 the rotate X Y and Z before changing the parents filter blur settings via javascript (only when Firefox is detected). Here's what it looks like as of now. Click on the animated GIf to blur and then click anywhere to remove the blur. works both on Chrome and Firefox!

It basicaly works like this:

var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
if(!isFirefox){
  3Danimation();
}
like image 184
Samuel Charpentier Avatar answered Sep 28 '22 00:09

Samuel Charpentier