I have a problem: I made a picture with some layer and wanted to mask them with the mask css property. It works fine on Firefox, whereas on Chrome it doesn't even with the -webkit- prefixe.
Here is the code, note the mask is applied on #plan-1
Maybe Chrome can't make a mask from a jpeg ? :o
body{
margin: 0;
background-color:black;
transform: translateZ(0);
height: 100vh;
width: 100vw;
overflow: hidden;
}
section{
display: block;
background-position: center;
height: 100%;
width: 100%;
position: absolute;
margin: auto;
}
#plan-1{
mask-image: url('http://felixjely.fr/projet/DGN1/film-couloir/img/piranese/mask-01.jpg'); /*Option de Masque*/
mask-position:center;
mask-mode: luminance;
mask-size: contain;
-webkit-mask-image: url('http://felixjely.fr/projet/DGN1/film-couloir/img/piranese/mask-01.jpg'); /*Webkit*/
-webkit-mask-position:center;
-webkit-mask-size: contain;
-webkit-mask-type: luminance;
background:url("http://felixjely.fr/projet/DGN1/film-couloir/img/piranese/03.jpg") no-repeat center;
background-size: contain;
z-index: 15;
}
#plan-2{
background-color:red;
background-size: contain;
z-index: 5;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="align">
<section id="plan-1"></section>
<section id="plan-2"></section>
</div>
EDIT
As WahhabB said, I made a vector based image out of the mask (by vectorise with illustrator/inskape).
Unfortunately, It doesn't work.
body{
margin: 0;
background-color:black;
transform: translateZ(0);
height: 100vh;
width: 100vw;
overflow: hidden;
}
section{
display: block;
background-position: center;
height: 100%;
width: 100%;
position: absolute;
margin: auto;
}
#plan-1{
mask-image: url('http://felixjely.fr/projet/DGN1/film-couloir/img/piranese/mask-01.svg'); /*Option de Masque*/
mask-position:center;
mask-mode: luminance;
mask-size: contain;
-webkit-mask-image: url('http://felixjely.fr/projet/DGN1/film-couloir/img/piranese/mask-01.svg'); /*Webkit*/
-webkit-mask-position:center;
-webkit-mask-size: contain;
-webkit-mask-type: luminance;
background:url("http://felixjely.fr/projet/DGN1/film-couloir/img/piranese/03.jpg") no-repeat center;
background-size: contain;
z-index: 15;
}
#plan-2{
background-color:red;
background-size: contain;
z-index: 5;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="align">
<section id="plan-1"></section>
<section id="plan-2"></section>
</div>