Skip to content

Commit 7c9bc8d

Browse files
committed
Airport Like Text Flip Animation with jQuery CSS3 splitFlap
1 parent 0f2f37f commit 7c9bc8d

File tree

9 files changed

+616
-0
lines changed

9 files changed

+616
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Thumbs.db
2+
Desktop.ini
3+
.DS_Store
4+
.idea/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 zemax
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
jquery-splitFlap
2+
================
3+
4+
jQuery module to transform a div text into splitflap display (airport-like).
5+
6+
[View the Demo →](http://htmlpreview.github.io/?https://github.com/zemax/jquery-splitFlap/blob/master/demo/index.html)
7+
8+
How to use
9+
----------
10+
11+
``` html
12+
<div class="my-splitflap">Hello World</div>
13+
```
14+
15+
``` javascript
16+
$('.my-spliflap').splitFlap();
17+
```
18+
19+
Options
20+
-------
21+
22+
You can pass options to the function
23+
24+
``` javascript
25+
// Default :
26+
$('.my-spliflap').splitFlap({
27+
image: 'images/chars.png',
28+
charsMap: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.,!?#@()+-=',
29+
charWidth: 50,
30+
charHeight: 100,
31+
charSubstitute: ' ',
32+
speed: 3,
33+
speedVariation: 2,
34+
text: '',
35+
textInit: '',
36+
autoplay: true
37+
});
38+
```
39+
40+
### image
41+
The path to the image used by the splitflap.
42+
43+
You will certainly need to change *charsMap*, *charWidth* and *charHeight* if you change this.
44+
45+
### charsMap
46+
The string represented in the image.
47+
48+
### charWidth
49+
The width of a character in the image, in pixels.
50+
51+
### charHeight
52+
The height of a character in the image, in pixels.
53+
54+
### charSubstitute
55+
The character used when the string contains a character not found in the charsMap.
56+
57+
### speed
58+
The speed of the rotation, in letter by seconds.
59+
60+
### speedVariation
61+
Random speed added to the fixed speed.
62+
63+
### text
64+
The destination text. If empty, the content of the element is used.
65+
66+
### textInit
67+
The initial string the animation begin with.
68+
69+
### autoplay
70+
If set to false, you'll need to start the animation manually (see below).
71+
72+
Special options
73+
---------------
74+
75+
If the string 'splitflap' is passed as options on an already existing Splitflaped div, the internal SplitFlap object is returned.
76+
77+
With this object, you can start the animation manually by calling the animate() method.
78+
79+
``` javascript
80+
// Initialise the animation
81+
$('.my-spliflap').splitFlap({autoplay: false});
82+
83+
// Get the animation object and start it manually
84+
$('.my-spliflap').splitFlap('splitflap').animate();
85+
```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
background: grey;
5+
color: white;
6+
7+
font-family: Tahoma, Geneva, sans-serif;
8+
font-size: 24px;
9+
}
10+
11+
.splitflap {
12+
margin: 20px auto;
13+
14+
-webkit-perspective-origin: top center;
15+
-moz-perspective-origin: top center;
16+
-ms-perspective-origin: top center;
17+
perspective-origin: top center;
18+
19+
-webkit-perspective: 900px;
20+
-moz-perspective: 900px;
21+
-ms-perspective: 900px;
22+
perspective: 900px;
23+
}
24+
25+
.splitflap .char {
26+
-webkit-transform-style: preserve-3d;
27+
-moz-transform-style: preserve-3d;
28+
-ms-transform-style: preserve-3d;
29+
transform-style: preserve-3d;
30+
}
68 KB
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<link type="text/css" rel="stylesheet" href="css/layout.css">
6+
<title>Split Flap</title>
7+
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
8+
<script src="js/jquery/jquery.splitflap.js"></script>
9+
<script src="js/application/main.js"></script>
10+
</head>
11+
12+
<body>
13+
<div class="do-splitflap">Hello World !</div>
14+
<div class="do-splitflap">Split Flap is fun</div>
15+
<div class="click-splitflap"> # It s nice # </div>
16+
<div class="empty-splitflap"></div>
17+
</body>
18+
</html>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(function ($) {
2+
$(document).ready(function () {
3+
$('.do-splitflap')
4+
.splitFlap();
5+
6+
$('.click-splitflap')
7+
.splitFlap({
8+
textInit: 'Click me to start',
9+
autoplay: false
10+
})
11+
.click(function () {
12+
$(this).splitFlap('splitflap').animate();
13+
});
14+
15+
$('.empty-splitflap')
16+
.splitFlap({
17+
text: 'This text was created from js'
18+
});
19+
});
20+
})(jQuery);

0 commit comments

Comments
 (0)