FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ionic/ionic/transitions/transition-md.ts at ion-datetime · Java1024/ionic · GitHub
Java1024
ionic
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ionic
/
ionic
/
transitions
/
transition-md.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
65 lines (50 loc) · 2.1 KB
Breadcrumbs
ionic
/
ionic
/
transitions
/
transition-md.ts
Copy path
File metadata and controls
65 lines (50 loc) · 2.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import
{
Animation
}
from
'../animations/animation'
;
import
{
Transition
,
TransitionOptions
}
from
'./transition'
;
import
{
ViewController
}
from
'../components/nav/view-controller'
;
const
TRANSLATEY
=
'translateY'
;
const
OFF_BOTTOM
=
'40px'
;
const
CENTER
=
'0px'
;
const
SHOW_BACK_BTN_CSS
=
'show-back-button'
;
class
MDTransition
extends
Transition
{
constructor
(
enteringView
:
ViewController
,
leavingView
:
ViewController
,
opts
:
TransitionOptions
)
{
super
(
opts
)
;
// what direction is the transition going
let
backDirection
=
(
opts
.
direction
===
'back'
)
;
// do they have navbars?
let
enteringHasNavbar
=
enteringView
.
hasNavbar
(
)
;
let
leavingHasNavbar
=
leavingView
&&
leavingView
.
hasNavbar
(
)
;
// entering content item moves in bottom to center
let
enteringPage
=
new
Animation
(
enteringView
.
pageRef
(
)
)
;
enteringPage
.
before
.
addClass
(
'show-page'
)
;
this
.
add
(
enteringPage
)
;
if
(
backDirection
)
{
this
.
duration
(
opts
.
duration
||
200
)
.
easing
(
'cubic-bezier(0.47,0,0.745,0.715)'
)
;
enteringPage
.
before
.
clearStyles
(
[
TRANSLATEY
]
)
;
}
else
{
this
.
duration
(
opts
.
duration
||
280
)
.
easing
(
'cubic-bezier(0.36,0.66,0.04,1)'
)
;
enteringPage
.
fromTo
(
TRANSLATEY
,
OFF_BOTTOM
,
CENTER
,
true
)
.
fadeIn
(
)
;
}
if
(
enteringHasNavbar
)
{
let
enteringNavBar
=
new
Animation
(
enteringView
.
navbarRef
(
)
)
;
enteringNavBar
.
before
.
addClass
(
'show-navbar'
)
;
this
.
add
(
enteringNavBar
)
;
let
enteringBackButton
=
new
Animation
(
enteringView
.
backBtnRef
(
)
)
;
this
.
add
(
enteringBackButton
)
;
if
(
enteringView
.
enableBack
(
)
)
{
enteringBackButton
.
before
.
addClass
(
SHOW_BACK_BTN_CSS
)
;
}
else
{
enteringBackButton
.
before
.
removeClass
(
SHOW_BACK_BTN_CSS
)
;
}
}
// setup leaving view
if
(
leavingView
&&
backDirection
)
{
// leaving content
this
.
duration
(
opts
.
duration
||
200
)
.
easing
(
'cubic-bezier(0.47,0,0.745,0.715)'
)
;
let
leavingPage
=
new
Animation
(
leavingView
.
pageRef
(
)
)
;
this
.
add
(
leavingPage
.
fromTo
(
TRANSLATEY
,
CENTER
,
OFF_BOTTOM
)
.
fadeOut
(
)
)
;
}
}
}
Transition
.
register
(
'md-transition'
,
MDTransition
)
;
Back
|
FazBrowse Home
|
New Git URL