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
// OPTION 1 | |
// Close Icon managed by CTO, alert managed by CTO | |
TryOn.init({ | |
events: { | |
close: () => { | |
window.modal.close(); // closes the popin embedding the CTO experience | |
} | |
} | |
}); |
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
export function actionTypeBuilder(prefix) { | |
return { | |
type: actionType => `${prefix}/${actionType}`, | |
loading: actionType => `${actionType}/loading`, | |
ready: actionType => `${actionType}/ready`, | |
stopped: actionType => `${actionType}/stopped`, | |
changed: actionType => `${actionType}/changed`, | |
error: actionType => `${actionType}/error`, | |
success: actionType => `${actionType}/success` | |
}; |
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
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"commonjs": true, | |
"es6": true, | |
"jest": true, | |
"node": true | |
}, | |
"globals": {}, | |
"parser": "/Users/david/repos/useAudioPlayer/node_modules/babel-eslint/lib/index.js", |
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
executeEnteringTransition = (node, done) => { | |
this.postStyler.set({ ...this.from, visibility: 'visible' }); | |
node.classList.add('post-enter-started'); // add this line | |
/* same code */ | |
complete: () => { | |
node.classList.remove('post-enter-started'); // add this line | |
done(); | |
} |
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
.page-post .underlay { | |
position: fixed; | |
top: -10vh; | |
left: 0; | |
z-index: 0; | |
width: 100vw; | |
height: 120vh; | |
background-color: #fff; | |
transition: opacity 400ms ease; | |
&::before { |
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
// .post-dragged rule is exactly the same | |
// as .post-enter | |
.page-post { | |
&.post-enter, | |
&.post-dragged { // add this rule | |
.post { | |
position: fixed; | |
overflow: hidden; | |
pointer-events: none; | |
} |
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
render() { | |
/* same code */ | |
const { dragProgress } = this.state; | |
const postStyle = | |
dragProgress > 0 | |
? { | |
transform: `scale(${1 - dragProgress * (1 - DRAG_MINIMUM_SCALE)})`, | |
borderRadius: dragProgress * 16 |
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
componentWillUnmount = () => { | |
this.removeListeners(); | |
}; | |
addListeners = () => { | |
window.addEventListener('scroll', this.onScroll); | |
}; | |
removeListeners = () => { | |
window.removeEventListener('scroll', this.onScroll); |
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
onExit = () => {} | |
executeExitingTransition = (node, done) => { | |
// we're going to do some work in there! | |
done(); | |
} | |
onAddEndListener = (node, done) => { | |
if (!this.preview) return done(); | |
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
.page-post { | |
&.post-exit, | |
&.post-enter { | |
.content, | |
.close, | |
.underlay { | |
opacity: 0; | |
} | |
.underlay { | |
transition-delay: 0; |
NewerOlder