Skip to content

Instantly share code, notes, and snippets.

@awinogradov
Created May 15, 2016 21:28
Show Gist options
  • Save awinogradov/ab25b04e4abd6149e0bb90806612c987 to your computer and use it in GitHub Desktop.
Save awinogradov/ab25b04e4abd6149e0bb90806612c987 to your computer and use it in GitHub Desktop.
Protein Dynamics ease example
const goods = [
{ title: 'Мопед', color: '#05668D' },
{ title: 'Велик', color: '#028090' },
{ title: 'Тачила', color: '#00A896' },
{ title: 'Водокачка', color: '#02C39A' },
{ title: 'Платье', color: '#F0F3BD' },
{ title: 'Штора', color: '#AEF6C7' },
{ title: 'Люстра', color: '#5B8266' },
{ title: 'Пес', color: '#294936' }
];
const origin = Screen.layer('Group');
goods.forEach((good, i) => {
Screen.layer('title').text(good.title);
Screen.layer('image').style({ fill: good.color });
let newGood = origin.clone();
newGood.attr({
transform: `translate(10 ${i * 120})`,
filter: svg.filter(
Snap.filter.shadow(2, 2, 4, 'rgba(0, 0, 0, 0.3)')
)
});
newGood.click(() => { Screen.goTo('About'); });
origin.after(newGood);
});
origin.remove();
origin.remove()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment