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

When lots of profiles, and panel has to expand, animation shows whitespace #10

Open
Noitidart opened this issue May 4, 2014 · 1 comment
Assignees
Milestone

Comments

@Noitidart
Copy link
Owner

When lots of profiles, and panel has to grow in height downwards so it can show all profiles/buttons, whitespace is shown.

This is due to the animation function of the menu AND the panel height growth starting at time 0. What happens is when the menu is expanding and reaches the top, so now menu height == panel height, THEN I should start the the panel animation to grow down.

But because I use ease transition function I have to split the bezier curve of the animation. I need to calculate from this split function the delay time, to when to start the panel height growth, this should pick up with the split bezier transition function.

Do reverse of the split bezier functions on collapse.

    //////////////////START FROM ISCRIPTDESIGN
    var splitBezier = function(array, perc) {
        array.unshift({x:0, y:0});
        var coll = [];
        while (array.length > 0) {
        for (var i = 0;i < array.length-1; i++) {
            coll.unshift(array[i]);
            array[i] = interpolate(array[i], array[i+1], perc);
        }
        coll.unshift(array.pop());
        }
        return {b1: [{x:coll[5].x, y:coll[5].y}, {x:coll[2].x, y:coll[2].y},{x:coll[0].x, y:coll[0].y}]
            , b2: [{x:coll[1].x - coll[0].x,y:coll[1].y-coll[0].y}, {x:coll[3].x - coll[0].x,y:coll[3].y-coll[0].y}, {x:coll[6].x - coll[0].x,y:coll[6].y-coll[0].y}]};
    }

    var interpolate = function (p0, p1, percent) {
        if (typeof percent === 'undefined') percent = 0.5;  
        return  {x: p0.x + (p1.x - p0.x) * percent
             , y: p0.y + (p1.y - p0.y) * percent};
    }
    //////////////////END FROM ISCRIPTDESIGN
    var coord = function (x,y) {
      if(!x) var x=0;
      if(!y) var y=0;
      return {x: x, y: y};
    }
    //var easeInOut = [new coord(.44,.05), new coord(.55,.95), new coord(1,1)];
    var easeInOut = [new coordhat (.88,.1), new coord(1.1,1.9), new coord(2,2)];
    var split50percent = splitBezier(easeInOut.slice(), .5);
    alert(split50percent.toSource())
@Noitidart Noitidart added this to the v1.2 milestone May 4, 2014
@Noitidart Noitidart self-assigned this May 4, 2014
@Noitidart Noitidart added minor bug and removed bug labels May 8, 2014
@Noitidart Noitidart added bug and removed enhancement labels May 28, 2014
@Noitidart Noitidart modified the milestones: v1.2, v1.3, v1.4 Aug 27, 2014
@Noitidart
Copy link
Owner Author

Use GitHubGIST :: Noitidart / _js-snippet-PointOnCubicBezier.js to figure out the time the height of the stack will reach the height of PanelUI.height - (PUIFooter.height - stack.height). Then use GitHubGIST :: Noitidart / _js-snippet-CubicBezierSplit.js to create the cubic-bezier for PanelUI, and the duration should be final time minus the time calced in first part.

@Noitidart Noitidart modified the milestones: v1.3, v1.4 Oct 13, 2014
Noitidart added a commit that referenced this issue Oct 17, 2014
### bootstrap.js
* makes the open animation have no whitespace, address issue #10 (im a
bit iffy on the animation speed, I need to test without any
console.log'ing to see if animation is smooth)
Noitidart added a commit that referenced this issue Oct 25, 2014
###### Summary: Addresses issue #10
### bootstrap.js
* Gives the collapse the split bezier to avoid white space
* It needs more work, as animation on main menu SEEMS not perfect (seems
more imperfect on collapse), but will do later, remember to gauge this
once all `console` messages are removed as `console` logging definitely
slows down stuff a lot
@Noitidart Noitidart modified the milestones: v2.0, v1.3 May 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant