Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pull all settings from env variables. remove Meteor.settings
- Loading branch information
Showing
8 changed files
with
92 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ meteorhacks:npm | |
npm-container | ||
ostrio:neo4jdriver | ||
momentjs:moment | ||
raix:ui-dropped-event |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,60 @@ | ||
Template.infoMenu.rendered = function() { | ||
// todo: Meteor.settings.public.options.displayIntroAnimation | ||
if (true) { | ||
Meteor.call('getSetting', 'displayIntroAnimation', function (err, displayIntroAnimation) { | ||
if (displayIntroAnimation) { | ||
|
||
var timelineSequence = new TimelineMax({ paused: true }); | ||
var timelineSequence = new TimelineMax({ paused: true }); | ||
|
||
// Greensock .call is similar to its .add, | ||
// except .call lets us pass params to our function | ||
timelineSequence | ||
.add(timelineMenu()) | ||
.call( | ||
// Greensock .call is similar to its .add, | ||
// except .call lets us pass params to our function | ||
timelineSequence | ||
.add(timelineMenu()) | ||
.call( | ||
Parallels.Animation.General.shimmer, | ||
[ | ||
{ $elements: $(".map .bit") } | ||
]) | ||
.play(); | ||
.play(); | ||
|
||
// TODO: extract into Animation class | ||
// adapted from: http://codepen.io/vdaguenet/pen/raXBKp | ||
function timelineMenu () { | ||
// TODO: extract into Animation class | ||
// adapted from: http://codepen.io/vdaguenet/pen/raXBKp | ||
function timelineMenu () { | ||
|
||
var menu = $(".info-menu"); | ||
var viewportWidth = 1385; // verge.viewportW(); | ||
var viewportHeight = 534; // verge.viewportH(); | ||
var timeline = new TimelineMax(); | ||
var menu = $(".info-menu"); | ||
var viewportWidth = verge.viewportW(); | ||
var viewportHeight = verge.viewportH(); | ||
var timeline = new TimelineMax(); | ||
|
||
var topToBottomLine = $('.wipe.top-to-bottom .line'); | ||
var maskTop = $('.wipe.top-to-bottom .mask.top'); | ||
var maskBottom = $('.wipe.top-to-bottom .mask.bottom'); | ||
var topToBottomLine = $('.wipe.top-to-bottom .line'); | ||
var maskTop = $('.wipe.top-to-bottom .mask.top'); | ||
var maskBottom = $('.wipe.top-to-bottom .mask.bottom'); | ||
|
||
var sideToSideLine = $('.wipe.side-to-side .line'); | ||
var maskLeft = $('.wipe.load.side-to-side .mask.left'); | ||
var maskRight = $('.wipe.load.side-to-side .mask.right'); | ||
var sideToSideLine = $('.wipe.side-to-side .line'); | ||
var maskLeft = $('.wipe.load.side-to-side .mask.left'); | ||
var maskRight = $('.wipe.load.side-to-side .mask.right'); | ||
|
||
TweenMax.set($('.wipe.load.side-to-side'), { alpha: 0 }); | ||
TweenMax.set($('.wipe.load.side-to-side'), { alpha: 0 }); | ||
|
||
timeline.fromTo(topToBottomLine, 0.4, { x: viewportWidth }, { x: 0, ease: Circ.easeIn }, 0); | ||
timeline.fromTo(maskTop, 0.4, { y: 0 }, { y: -viewportHeight / 2, ease: Expo.easeOut, delay: 0.1 }, 0.4); | ||
timeline.fromTo(maskBottom, 0.4, { y: 0 }, { y: viewportHeight / 2, ease: Expo.easeOut, delay: 0.1 }, 0.4); | ||
timeline.set($('.wipe.load.top-to-bottom'), { alpha: 0, display: "none" }); | ||
timeline.fromTo(topToBottomLine, 0.4, { x: viewportWidth }, { x: 0, ease: Circ.easeIn }, 0); | ||
timeline.fromTo(maskTop, 0.4, { y: 0 }, { y: -viewportHeight / 2, ease: Expo.easeOut, delay: 0.1 }, 0.4); | ||
timeline.fromTo(maskBottom, 0.4, { y: 0 }, { y: viewportHeight / 2, ease: Expo.easeOut, delay: 0.1 }, 0.4); | ||
timeline.set($('.wipe.load.top-to-bottom'), { alpha: 0, display: "none" }); | ||
|
||
timeline.set($('.wipe.load.side-to-side'), { alpha: 1, display: "block"}); | ||
timeline.fromTo(sideToSideLine, 0.4, { y: -viewportHeight}, {y: 0, ease: Circ.easeIn}); | ||
timeline.fromTo(maskRight, 0.4, { x: 0 }, {x: viewportWidth / 2, ease: Expo.easeOut, delay: 0.1 }, 1.2); // 2.5 | ||
timeline.fromTo(maskLeft, 0.4, { x: 0 }, {x: -viewportWidth / 2, ease: Expo.easeOut, delay: 0.1 }, 1.2); | ||
timeline.set($('.wipe.load.side-to-side'), { alpha: 0, display: "none" }); | ||
timeline.set($('.wipe.load.side-to-side'), { alpha: 1, display: "block"}); | ||
timeline.fromTo(sideToSideLine, 0.4, { y: -viewportHeight}, {y: 0, ease: Circ.easeIn}); | ||
timeline.fromTo(maskRight, 0.4, { x: 0 }, {x: viewportWidth / 2, ease: Expo.easeOut, delay: 0.1 }, 1.2); // 2.5 | ||
timeline.fromTo(maskLeft, 0.4, { x: 0 }, {x: -viewportWidth / 2, ease: Expo.easeOut, delay: 0.1 }, 1.2); | ||
timeline.set($('.wipe.load.side-to-side'), { alpha: 0, display: "none" }); | ||
|
||
timeline.to(menu, 1, { top: "0", ease:Elastic.easeOut }); | ||
timeline.to(menu, 1, { top: "0", ease:Elastic.easeOut }); | ||
|
||
return timeline; | ||
} | ||
|
||
} | ||
|
||
else { | ||
$('.wipe. load').hide(); | ||
} | ||
return timeline; | ||
} | ||
|
||
} | ||
|
||
else { | ||
$('.wipe.load').hide(); | ||
} | ||
}); | ||
}; | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
const ConfigurationOptions = { | ||
displayIntroAnimation: {key: 'DISPLAY_INTRO_ANIMATION', defaultValue: "true", valueType: 'boolean' }, | ||
uploader: {key: 'UPLOADER', defaultValue: 'fileSystemUploader', valueType: 'string' } | ||
}; | ||
|
||
function stringToBool(string) { | ||
switch (string.trim().toLowerCase()) { | ||
case "false": | ||
case "no": | ||
case "0": | ||
case "": | ||
return false; | ||
default: | ||
return true; | ||
} | ||
} | ||
|
||
Meteor.methods({ | ||
getSetting: function (name) { | ||
check(name, String); | ||
var setting = ConfigurationOptions[name]; | ||
|
||
if (!setting) { | ||
throw new Meteor.Error("setting-not-found", "Can't find a configuration for " + name); | ||
} | ||
|
||
var value = process.env[setting.key] || setting.defaultValue; | ||
|
||
if (setting.valueType === 'boolean') { | ||
return stringToBool(value); | ||
} else { | ||
return value.trim(); | ||
} | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.