Created
September 5, 2018 05:24
-
-
Save tonkotsuboy/22adf2f7751738468cbdda2af0490ed0 to your computer and use it in GitHub Desktop.
イージング定数(JavaScript版)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* イージング定数。cubic-bezier()で使用する | |
* | |
* # 使用例 | |
* const fooElement = document.querySelector(".foo"); | |
* fooElement.style.transitionTimingFunction = `cubic-bezier(${Easing._6_ExpoOut})`; | |
* | |
* # 参考 | |
* アニメーションをデザインしよう! 知っておきたいCSSイージングのお手本 | |
* ICS MEDIA https://ics.media/entry/18730 | |
* | |
* Ease24 - API Documentation | |
* http://package.a24.cat/libs/tween24/asdoc/2.0/a24/tween/Ease24.html | |
* | |
*/ | |
var Easing; | |
(function (Easing) { | |
Easing["_Linear"] = "0.0, 0.0, 1.0, 1.0"; | |
// sine | |
Easing["_1_SineIn"] = ".47, 0, .745, .715"; | |
Easing["_1_SineOut"] = ".39, .575, .565, 1"; | |
Easing["_1_SineInOut"] = ".445, .05, .55, .95"; | |
// quad | |
Easing["_2_QuadIn"] = ".55, .085, .68, .53"; | |
Easing["_2_QuadOut"] = ".25, .46, .45, .94"; | |
Easing["_2_QuadInOut"] = ".455, .03, .515, .955"; | |
// cubic | |
Easing["_3_CubicIn"] = ".55, .055, .675, .19"; | |
Easing["_3_CubicOut"] = ".215, .61, .355, 1"; | |
Easing["_3_CubicInOut"] = ".645, .045, .355, 1"; | |
// quart | |
Easing["_4_QuartIn"] = ".895, .03, .685, .22"; | |
Easing["_4_QuartOut"] = ".165, .84, .44, 1"; | |
Easing["_4_QuartInOut"] = ".77, 0, .175, 1"; | |
// quint | |
Easing["_5_QuintIn"] = ".755, .05, .855, .06"; | |
Easing["_5_QuartOut"] = ".23, 1, .32, 1"; | |
Easing["_5_QuartInOut"] = ".86, 0, .07, 1"; | |
// expo | |
Easing["_6_ExpoIn"] = ".95, .05, .795, .035"; | |
Easing["_6_ExpoOut"] = ".19, 1, .22, 1"; | |
Easing["_6_ExpoInOut"] = "1, 0, 0, 1"; | |
// circ | |
Easing["_7_CircIn"] = ".6, .04, .98, .335"; | |
Easing["_7_CircOut"] = ".075, .82, .165, 1"; | |
Easing["_7_CircInOut"] = ".785, .135, .15, .86"; | |
// inback | |
Easing["_BackIn"] = ".6, -0.28, .735, .045"; | |
Easing["_BackOut"] = ".175, .885, .32, 1.275"; | |
Easing["_BackInOut"] = ".68, -0.55, .265, 1.55"; | |
})(Easing || (Easing = {})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment