Difference between revisions of "Team:Tsinghua/js/easing.js"

(Created page with "<html> <head> <title>HOME</title> <!--bootstarp-css--> <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" /> <!--/bootstarp-css --> <!--css--> <link r...")
 
Line 1: Line 1:
<html>
+
/*
<head>
+
* jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
<title>HOME</title>
+
*
<!--bootstarp-css-->
+
* Uses the built In easIng capabilities added In jQuery 1.1
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
+
* to offer multiple easIng options
<!--/bootstarp-css -->
+
*
<!--css-->
+
* Copyright (c) 2007 George Smith
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
+
* Licensed under the MIT License:
<!--/css-->
+
*  http://www.opensource.org/licenses/mit-license.php
<meta name="viewport" content="width=device-width, initial-scale=1">
+
*/
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
 
<meta name="keywords" content="Petcare Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template,  
+
// t: current time, b: begInnIng value, c: change In value, d: duration
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
+
 
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
+
jQuery.extend( jQuery.easing,
<link href="css/hover.css" rel="stylesheet" media="all">
+
{
<!--fonts-->
+
easeInQuad: function (x, t, b, c, d) {
<link href='http://fonts.useso.com/css?family=Arimo:400,700' rel='stylesheet' type='text/css'>
+
return c*(t/=d)*t + b;
<link href='http://fonts.useso.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
+
},
<!--/fonts-->
+
easeOutQuad: function (x, t, b, c, d) {
<script src="http://ajax.useso.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
+
return -c *(t/=d)*(t-2) + b;
<script src="js/modernizr.custom.js"></script>
+
},
<script src="js/responsiveslides.min.js"></script>
+
easeInOutQuad: function (x, t, b, c, d) {
<script>
+
if ((t/=d/2) < 1) return c/2*t*t + b;
    // You can also use "$(window).load(function() {"
+
return -c/2 * ((--t)*(t-2) - 1) + b;
    $(function () {
+
},
      $("#slider2").responsiveSlides({
+
easeInCubic: function (x, t, b, c, d) {
        auto: true,
+
return c*(t/=d)*t*t + b;
        pager: true,
+
},
        speed: 300,
+
easeOutCubic: function (x, t, b, c, d) {
        namespace: "callbacks",
+
return c*((t=t/d-1)*t*t + 1) + b;
      });
+
},
    });
+
easeInOutCubic: function (x, t, b, c, d) {
  </script>
+
if ((t/=d/2) < 1) return c/2*t*t*t + b;
</head>
+
return c/2*((t-=2)*t*t + 2) + b;
<body>
+
},
<!--header-->
+
easeInQuart: function (x, t, b, c, d) {
<div class="header">
+
return c*(t/=d)*t*t*t + b;
<div class="header-info">
+
},
  <div class="container">
+
easeOutQuart: function (x, t, b, c, d) {
<div class="logo">
+
return -c * ((t=t/d-1)*t*t*t - 1) + b;
<a href="index.html"><img src="images/logo.png" alt="" /></a>
+
},
</div>
+
easeInOutQuart: function (x, t, b, c, d) {
  </div>
+
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
</div>
+
return -c/2 * ((t-=2)*t*t*t - 2) + b;
</div>
+
},
  <div class="container">
+
easeInQuint: function (x, t, b, c, d) {
      <div class="header-bottom">
+
return c*(t/=d)*t*t*t*t + b;
<div class="menu">
+
},
<div align="center">
+
easeOutQuint: function (x, t, b, c, d) {
  <ul class="cl-effect-21">
+
return c*((t=t/d-1)*t*t*t*t + 1) + b;
    <li><samp><a href="index.html" class="active">HOME</a></samp></li>
+
},
    <li><samp><a href="about.html">ABOUT</a></samp></li>
+
easeInOutQuint: function (x, t, b, c, d) {
    <li><samp><a href="projects.html">PROJECTS</a></samp></li>
+
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
    <li><samp><a href="support.html">SUPPORT</a></samp></li>
+
return c/2*((t-=2)*t*t*t*t + 2) + b;
    <li><samp><a href="404.html">CAREPLUS</a></samp></li>
+
},
    <li><samp><a href="contact.html">CONTACT</a></samp></li>
+
easeInSine: function (x, t, b, c, d) {
      </ul>
+
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
  </div>
+
},
</div>
+
easeOutSine: function (x, t, b, c, d) {
        <div align="center">
+
return c * Math.sin(t/d * (Math.PI/2)) + b;
            <samp>
+
},
            <!--script-nav -->
+
easeInOutSine: function (x, t, b, c, d) {
            <script>
+
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
$("span.menu-info").click(function(){
+
},
$("ul.cl-effect-21").slideToggle("slow" , function(){
+
easeInExpo: function (x, t, b, c, d) {
});
+
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
});
+
},
          </script>
+
easeOutExpo: function (x, t, b, c, d) {
            <!-- /script-nav -->
+
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
            </samp></div>
+
},
        <div class="clearfix"> </div>
+
easeInOutExpo: function (x, t, b, c, d) {
  </div>
+
if (t==0) return b;
  </div>
+
if (t==d) return b+c;
<div class="header-banner">
+
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
  <div class="slider">
+
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
    <ul class="rslides" id="slider2">
+
},
      <li><a href="#"><img src="images/4.jpg" class="img-responsive" alt=""/></a></li>
+
easeInCirc: function (x, t, b, c, d) {
      <li><a href="#"><img src="images/2.jpg" class="img-responsive" alt=""/></a></li>
+
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
      <li><a href="#"><img src="images/3.jpg" class="img-responsive" alt=""/></a></li>
+
},
    </ul>
+
easeOutCirc: function (x, t, b, c, d) {
  </div>
+
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
</div>
+
},
<!--/header-->
+
easeInOutCirc: function (x, t, b, c, d) {
<!--doctor-self-->
+
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
<div class="doctor-self">
+
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
<div class="container">
+
},
<div class="doctor-self-info">
+
easeInElastic: function (x, t, b, c, d) {
<h3>WHAT WOULD OUR DEAN SAYS</h3>
+
var s=1.70158;var p=0;var a=c;
<div class="doctor-self-info-bottom">
+
if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
<div class="col-md-4 doctor-self-left">
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
<img src="images/5.jpg" class="img-responsive" alt=""/>
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
<h4>DR.JIMMY</h4>
+
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
<h5>lorem lipsum doolr in groem horntim</h5>
+
},
</div>
+
easeOutElastic: function (x, t, b, c, d) {
<div class="col-md-8 doctor-self-right">
+
var s=1.70158;var p=0;var a=c;
<p>"Lorem Ipsum is simply dummy text of the printing and typesetting i
+
if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
ndustry. Lorem Ipsum has been the industry's standard dummy text
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
ever since the 1500s<br /><br /> reproduced below for those interested. Sections 1.10.32
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
  and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero
+
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
  are also reproduced in their exact original form, accompanied
+
},
    by English versions from the 1914 translation by H. Rackham
+
easeInOutElastic: function (x, t, b, c, d) {
Lorem Ipsum is simply dummy text of the printing and typesetting i
+
var s=1.70158;var p=0;var a=c;
ndustry. Lorem Ipsum has been the industry's standard dummy text
+
if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
ever since the 1500s"</p>
+
if (a < Math.abs(c)) { a=c; var s=p/4; }
</div>
+
else var s = p/(2*Math.PI) * Math.asin (c/a);
<div class="clearfix"> </div>
+
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
  </div>
+
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
</div>
+
},
</div>
+
easeInBack: function (x, t, b, c, d, s) {
</div>
+
if (s == undefined) s = 1.70158;
<!--/doctor-self-->
+
return c*(t/=d)*t*((s+1)*t - s) + b;
<!--dogs-food-->
+
},
<div class="dogs-food">
+
easeOutBack: function (x, t, b, c, d, s) {
<div class="container">
+
if (s == undefined) s = 1.70158;
<div class="dogs-food-top-info">
+
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
<div class="dogs-food-top">
+
},
<div class="col-md-4 dogs-food-info">
+
easeInOutBack: function (x, t, b, c, d, s) {
<img src="images/dg-1.png">
+
if (s == undefined) s = 1.70158;  
<h4>CARE</h4>
+
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
<p>when an unknown printer took a galley of
+
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
type and scrambled it to make a type speci
+
},
men book</p>
+
easeInBounce: function (x, t, b, c, d) {
<a class="dogs-top-food" href="#">More</a>
+
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
</div>
+
},
<div class="col-md-4 dogs-food-info">
+
easeOutBounce: function (x, t, b, c, d) {
<img src="images/dg-2.png">
+
if ((t/=d) < (1/2.75)) {
<h4>CARE-+</h4>
+
return c*(7.5625*t*t) + b;
<p>when an unknown printer took a galley of
+
} else if (t < (2/2.75)) {
type and scrambled it to make a type speci
+
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
men book</p>
+
} else if (t < (2.5/2.75)) {
<a class="dogs-top-food" href="#">More</a>
+
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
</div>
+
} else {
<div class="col-md-4 dogs-food-info">
+
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
<img src="images/dg-3.png">
+
}
<h4>TRAVEL</h4>
+
},
<p>when an unknown printer took a galley of
+
easeInOutBounce: function (x, t, b, c, d) {
type and scrambled it to make a type speci
+
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
men book</p>
+
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
<a class="dogs-top-food" href="#">More</a>
+
}
</div>
+
});
<div class="col-md-4 dogs-food-info">
+
<img src="images/dg-4.png">
+
<h4>FRIEND-SHIP</h4>
+
<p>when an unknown printer took a galley of
+
type and scrambled it to make a type speci
+
men book</p>
+
<a class="dogs-top-food" href="#">More</a>
+
</div>
+
<div class="col-md-4 dogs-food-info">
+
<img src="images/dg-5.png">
+
<h4>DOG-HOME</h4>
+
<p>when an unknown printer took a galley of
+
type and scrambled it to make a type speci
+
men book</p>
+
<a class="dogs-top-food" href="#">More</a>
+
</div>
+
<div class="col-md-4 dogs-food-info">
+
<img src="images/dg-6.png">
+
<h4>DOG-FOOD</h4>
+
<p>when an unknown printer took a galley of
+
type and scrambled it to make a type speci
+
men book</p>
+
<a class="dogs-top-food" href="#">More</a>
+
</div>
+
<div class="clearfix"> </div>
+
  </div>
+
<div class="clearfix"> </div>
+
</div>
+
</div>
+
</div>
+
<!--/dogs-food-->
+
<!--daily-updates-->
+
<div class="daily-updates">
+
<div class="container">
+
<div class="daily-updates-info">
+
<h4>SUBSCRIBE FOR DAILY UPDATES</h4>
+
<form>
+
+
<input type="text" class="text" value="EMAIL" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'EMAIL';}">
+
<input type="submit"value="SUBMIT">
+
  </form>
+
<p>FOR HELP<span><a href="mailto:example@mail.com">pets-care@mail.com</a></span></p>
+
  </div>
+
</div>
+
</div>
+
<!--/daily-updates-->
+
<!--support-->
+
<div class="support">
+
<div class="container">
+
<div class="support-info">
+
<h4>OUR TEAM FOR SUPPORT</h4>
+
<div class="support-info-left">
+
<div class="col-md-10 support-info-left-bottom">
+
<p>"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
+
the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of ty
+
pe and scrambled</p>
+
</div>
+
<div class="col-md-2 support-info-left-top">
+
<img src="images/support.png" class="img-responsive" alt=""/>
+
</div>
+
<div class="clearfix"> </div>
+
</div>
+
<div class="support-info-right">
+
<div class="col-md-2 support-info-right-bottom">
+
<img src="images/support.png" class="img-responsive" alt=""/>
+
</div>
+
<div class="col-md-10 support-info-right-top">
+
<p>"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
+
the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of ty
+
pe and scrambled</p>
+
</div>
+
<div class="clearfix"> </div>
+
</div>
+
<div class="clearfix"> </div>
+
</div>
+
</div>
+
</div>
+
<!--/support-->
+
</body>
+
</html>
+

Revision as of 16:36, 16 September 2015

/*

* jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
*
* Uses the built In easIng capabilities added In jQuery 1.1
* to offer multiple easIng options
*
* Copyright (c) 2007 George Smith
* Licensed under the MIT License:
*   http://www.opensource.org/licenses/mit-license.php
*/

// t: current time, b: begInnIng value, c: change In value, d: duration

jQuery.extend( jQuery.easing, { easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } });