Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gsap animation #17

Merged
merged 45 commits into from
Feb 7, 2017
Merged

Gsap animation #17

merged 45 commits into from
Feb 7, 2017

Conversation

elsmr
Copy link
Collaborator

@elsmr elsmr commented Feb 6, 2017

New animation for the pods that follows the path of the roads.
fixes #9 and #16

I removed the buzz animation for now.
closes #12

@Haroenv
Copy link
Member

Haroenv commented Feb 6, 2017

How does it close #10? We won't do it for now, but it can be in the "after-dekrook" part right?

@@ -19,8 +18,3 @@ export const listenToQueries = () => (
});
}
);

export const deleteVisible = (index) => ({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't read everything, but how do you delete the visible ones after x amount of time? do they stay in the DOM now? :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They do but i max them at 40, after that they get trimmed. I can do it more elegantly but the perf doesnt really suffer I think. I will probably let them expire after their animation again after i clean up Pod.js etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah trimming at 40 makes perfect sense and is an easier implementation. Will cause an edge case when there are more than 40 supposed to be visible though 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im probably going to write another action that will fire after the gsap animation completes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should probably dispatch after x amount of seconds after the gsap animation

@@ -35,11 +31,6 @@ export const queryReducer = (state = INITIAL_STATE, action) => {
all = all.slice(0, 20);
}

// VISIBLE_INDEX++;
// setTimeout((index) => {
// store.dispatch(deleteVisible(index));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get why it's not needed anymore

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no more visible field in the store, instead i use queries.all to render the pods.

@@ -61,10 +61,10 @@ class Scene extends Component {
renderPods() {
const {queries, removePod} = this.props;
return queries.all
.map((query, i) => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map((query,index)) => (
  <Pod
    key={index}
    />

this will work without needing to keep track of a specific index

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An array/object always already has an internal index

Copy link
Collaborator Author

@elsmr elsmr Feb 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It causes a bug because the index of the pods changes as they are deleted/inserted.
Pods will randomly dissappear while they are animating, that's why I changed it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dommerik

Copy link
Member

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you 😉

@@ -32,12 +32,16 @@ class App extends Component {
this.props.listenToQueries();
}

removePod = (query) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use

removePod(query) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, didn't think of "this"

[curve, z, scaleEnd] = [[...hub.paths.back_right.bezier].reverse(), 2, 0.33];
break;
case DIRECTIONS.southwest:
[curve, z, scaleEnd, west] = [[...hub.paths.front_left.bezier].reverse(), 2, 2, true];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would an object be clearer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this notation more because I don't have to write () around it every time. I don't think it makes a difference anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer named arguments, but let's not make an argument about that now :^-)

@elsmr elsmr merged commit b783fb9 into master Feb 7, 2017
@Haroenv Haroenv mentioned this pull request Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tweak the buzz animation make the pods obey perspective
3 participants