Skip to content

Instantly share code, notes, and snippets.

View jefBinomed's full-sized avatar

Jean-François Garreau - Binomed jefBinomed

View GitHub Profile
function generateSnapshot(user, dataUrl) {
// We start our flash effect
let rectCanvas = document.querySelector('.canvas-container').getBoundingClientRect();
let flashDiv = document.getElementById('flash-effect')
flashDiv.style.top = (rectCanvas.top - 250) + "px";
flashDiv.style.left = (rectCanvas.left - 250) + "px";
flashDiv.classList.add('flash');
//When the animation is done (1s of opacity .7 -> 0 => ~500ms to wait)
setTimeout(() => {
$size-photo: 200px;
$size-photo-big: 500px;
.img-ori-parent.big{
width:$size-photo-big+90px;
height: $size-photo-big+200px;
background:white;
box-shadow : 0px 0px 5px 0px rgba(50, 50, 50, 0.75);
.img-ori{
top:45px;
.img-ori-parent{
position:absolute;
width:calc(200px + 40px);
height: calc(200px + 100px);
background:white;
z-index: 10;
box-shadow : 0px 0px 5px 0px rgba(50, 50, 50, 0.75);
}
.img-ori{
<div class="img-ori-parent" data-author="jefBinomed">
<img class="img-ori" src="/assets/2016-12-legonnary/gdg_logo_legonnary.png" >
</div>
#flash-effect{
position:absolute;
width:500px;
height:500px;
background:radial-gradient(ellipse at center, rgba(255,255,255,1) 0%, rgba(0,0,0,0) 80%);
opacity:0;
}
#flash-effect.flash{
animation: flash;
animation-duration: 1s;
new fabric.Text('GDG', {
fontSize: cellSize / 5,
fill: ColorLuminance(color, -0.15),
originX: 'center',
originY: 'center',
stroke: ColorLuminance(color, -0.20),
strokeWidth: 1
});
new fabric.Circle({
radius: (cellSize / 2) - 5,
fill: ColorLuminance(color, -0.1),
originX: 'center',
originY: 'center',
shadow : "0px 2px 10px rgba(0,0,0,0.2)"
});
new fabric.Circle({
radius: (cellSize / 2) - 4,
fill: ColorLuminance(color, 0.1),
originX: 'center',
originY: 'center'
});
this.rectBasic = new fabric.Rect({
width: cellSize * size.col,
height: cellSize * size.row,
fill: color,
originX: 'center',
originY: 'center',
centeredRotation: true,
hasControls: false,
shadow : "5px 5px 10px rgba(0,0,0,0.2)"
});
{
"rules":{
"drawSaved":{
"$userId":{
".read": "auth != null && $userId === auth.uid",
".write": "auth != null && root.child('admins').child(auth.token.email.replace('.', '*')).exists() && auth.token.email_verified == true"
}
}
}
}