summaryrefslogtreecommitdiff
path: root/src/animation.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation.js')
-rw-r--r--src/animation.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/animation.js b/src/animation.js
index 5d9b5f5..85c6dd7 100644
--- a/src/animation.js
+++ b/src/animation.js
@@ -4,7 +4,11 @@ export default class Animation {
static calculateFinalState(element) {
let finals = {}
- const margin = config.margin;
+ let margin = config.margin;
+ if (window.innerWidth <= config.zeroMarginBreakpoint) {
+ margin = 0
+ }
+
const nw = element.naturalWidth;
const nh = element.naturalHeight;
const ratio = nw / nh;