This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflip.tsx
More file actions
154 lines (144 loc) · 8.6 KB
/
flip.tsx
File metadata and controls
154 lines (144 loc) · 8.6 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import { SampleBase } from '../common/sample-base';
import './card.component.css'
// tslint:disable:max-line-length
// * Sample for CSS Basic Layout Cards.
export class Flip extends SampleBase<{}, {}> {
rendereComplete() {
/* On click event for flip the card*/
document.getElementById('card_flip').onclick = (e: Event) => {
let cardEle: HTMLElement = (e.currentTarget) as HTMLElement;
if (cardEle.classList.contains('e-flipped')) {
cardEle.classList.remove('e-flipped');
} else {
cardEle.classList.add('e-flipped');
}
};
/* On blur event for flip the card*/
document.getElementById('card_flip').onblur = (e: Event) => {
let cardEle: HTMLElement = (e.currentTarget) as HTMLElement;
cardEle.classList.remove('e-flipped');
};
/* On click event for flip the card*/
document.getElementById('card_flip_profile').onclick = (e: Event) => {
let cardEle: HTMLElement = (e.currentTarget) as HTMLElement;
if (cardEle.classList.contains('e-flipped')) {
cardEle.classList.remove('e-flipped');
} else {
cardEle.classList.add('e-flipped');
}
};
/* On blur event for flip the card*/
document.getElementById('card_flip_profile').onblur = (e: Event) => {
let cardEle: HTMLElement = (e.currentTarget) as HTMLElement;
cardEle.classList.remove('e-flipped');
};
}
render() {
return (
<div className='control-pane'>
<div className='control-section card-control-section flip_card_layout'>
<div className="e-card-resize-container">
<div className='row'>
<div className="row card-layout">
<div className="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<div className="e-card e-business e-flip" id="card_flip" title="Click to flip the Card">
<div className="e-card-header e-front">
<div className="e-card-header-caption">
<div className="e-card-header-title">Mayumi Ohno</div>
<div className="e-card-sub-title">Marketing Representative</div>
</div>
</div>
<div className="e-card-actions e-front">
<button className="e-card-btn">
<div className="e-email e-card-btn-txt">mayum@mail.com</div>
</button>
<button className="e-card-btn">
<div className="e-email e-card-btn-txt">011-232-221</div>
</button>
<button className="e-card-btn">
<div className="e-email e-card-btn-txt">www.mayum.com</div>
</button>
</div>
<div className="e-card-header e-back">
<div className="e-card-header-caption">
<div className="e-card-header-title">Address</div>
<div className="e-card-sub-title">
P.O. Box 78934
<br /> New Orleans
<br />Los Angeles
<br /> Postal Code: 70117
<br /> USA
</div></div>
</div>
</div>
</div>
<div className="col-xs-6 col-sm-6 col-lg-6 col-md-6">
<div className="e-card e-business e-flip" id="card_flip_profile" title="Click to flip the Card">
<div className="e-card-header e-back">
<div className="e-card-header-caption">
<div className="e-card-header-title">Address</div>
<div className="e-card-sub-title">
970 Drummond Street
<br /> New York
<br />New Jersey
<br /> Postal Code: 07102
<br /> USA
</div> </div>
</div>
<div className="e-card-front e-front">
<div className="e-card-header e-card-right" style={{ justifyContent: 'flex-end' }}>
<div className="e-card-header-image"></div>
</div>
<div className="e-card-header e-card-right" style={{ textAlign: 'right' }}>
<div className="e-card-header-caption">
<div className="e-card-header-title">Creative One</div>
</div>
</div>
<div className="e-card-header e-card-left" style={{ textAlign: 'left' }}>
<div className="e-card-header-caption">
<div className="e-card-header-title">John Doe</div>
<div className="e-card-sub-title">Architecture</div>
</div>
</div>
<div className="e-card-separator e-card-left"></div>
<div className="e-card-content e-card-left" style={{ textAlign: 'left' }}>
<table>
<tr>
<td>johndoe@mail.com</td>
</tr>
<tr>
<td>011-141-221</td>
</tr>
<tr>
<td>www.johndoe.com</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="action-description">
<p>
This sample demonstrates to flip(rotate) the <code>card</code> to show hidden information which is on back side of the card by clicking
or focus-out of it.
</p>
</div>
<div id="description">
<p>
Cards in this sample have a hidden content within the DOM (Document Object Model), which is set behind the visible card.
On the click action handler of front card, the back-side content is shown with a flip animation.
<p> More information about Card can be found in this
<a target="_blank" href="http://ej2.syncfusion.com/documentation/card/getting-started.html">
documentation</a> section.</p>
</p>
</div>
</div>
);
}
}