Created
August 23, 2018 20:54
-
-
Save psql/e99dd8ce9dfe690c9c588fcd63dcae0e to your computer and use it in GitHub Desktop.
modal issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Data, animate, Override, Animatable } from "framer"; | |
import { button } from "./canvas"; | |
const data = Data({ | |
buttonOpacity: Animatable(0), | |
buttonScale: Animatable(0), | |
buttonOffset: Animatable(-20), | |
modalOpacity: Animatable(0), | |
modalVisibility: false | |
}); | |
export const hoverPostImageArea: Override = () => { | |
return { | |
background: "transparent", | |
onTap(e) { | |
animate.spring(data.buttonOpacity, 1, { duration: 0.2 }); | |
animate.spring(data.buttonScale, 1, { duration: 0.3 }); | |
animate.spring(data.buttonOffset, 10, { duration: 0.3 }); | |
console.log("tap on image"); | |
} | |
}; | |
}; | |
export const toggleButtonVisibility: Override = () => { | |
return { | |
opacity: data.buttonOpacity, | |
scale: data.buttonScale, | |
bottom: data.buttonOffset, | |
onTap() { | |
data.modalVisibility = true; | |
animate.spring(data.modalOpacity, 1, { duration: 0.3 }); | |
console.log("tap on button"); | |
} | |
}; | |
}; | |
export const dim: Override = () => { | |
return { | |
visible: data.modalVisibility, | |
background: "black", | |
opacity: data.modalOpacity, | |
onTap() { | |
animate.spring(data.modalOpacity, 0, { duration: 0.3 }); | |
console.log("tap on modal"); | |
// console.log("lol"); | |
} | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment