IDEAFY / ideafy-ios-distrib

A repo to archive distribution versions of Ideafy (past and in-development) for the app store
1 stars 0 forks source link

Add spinners when searching for ideas #46

Open vweyl opened 11 years ago

vweyl commented 11 years ago

In both public and library idea list views

bredele commented 11 years ago

Hi Vincent,

You can use the following css class to animate a dom element. In this example, my spinner icon is a web font and has the class .fs1:

       .fs1 {
        display: inline-block;
        font-size:4em;
        height: 1em;
        line-height: 1;
    }

    .spinner {
        -webkit-animation: myRotate 1s linear infinite;
    }

    @-webkit-keyframes myRotate {
        from {
            -webkit-transform:rotate(0);
        }
        to {
            -webkit-transform:rotate(360deg);
        }
    }

You could create a simple Olives plugin object as below:

 define("Spinner.plugin", [], function(){
    return function SpinnerConstructor(){
               var node = null,
                    /* default class name */
                     className = "spinner";
        this.anim = function(dom, name){
                  node = dom;
                  className = name;
                };
        this.start = function(){
                   node.classList.add(className);
                };
        this.stop = function(){
                   node.classList.remove(className);
                };
    };
});
vweyl commented 11 years ago

Hi Olivier,

Right now I have opted for spin.js and it seems to be working pretty well. Your solution could be a nice enhancement.