typed.js 2.0.12 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +1 -1
- package/README.md +88 -37
- package/dist/typed.cjs +2 -0
- package/dist/typed.cjs.map +1 -0
- package/dist/typed.module.js +2 -0
- package/dist/typed.module.js.map +1 -0
- package/dist/typed.umd.js +3 -0
- package/dist/typed.umd.js.map +1 -0
- package/index.d.ts +253 -134
- package/package.json +21 -28
- package/.codeclimate.yml +0 -31
- package/.csslintrc +0 -2
- package/.esdoc.json +0 -4
- package/.eslintignore +0 -3
- package/.eslintrc.yml +0 -25
- package/.github/CONTRIBUTING.md +0 -44
- package/.github/ISSUE_TEMPLATE.md +0 -27
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -38
- package/.prettierrc +0 -4
- package/.travis.yml +0 -16
- package/.vscode/launch.json +0 -14
- package/.vscode/settings.json +0 -11
- package/CODE_OF_CONDUCT.md +0 -46
- package/app.js +0 -12
- package/assets/demos.css +0 -61
- package/assets/demos.js +0 -133
- package/bower.json +0 -11
- package/docs/API.md +0 -231
- package/docs/assets/anchor.js +0 -197
- package/docs/assets/bass-addons.css +0 -12
- package/docs/assets/bass.css +0 -543
- package/docs/assets/fonts/EOT/SourceCodePro-Bold.eot +0 -0
- package/docs/assets/fonts/EOT/SourceCodePro-Regular.eot +0 -0
- package/docs/assets/fonts/LICENSE.txt +0 -93
- package/docs/assets/fonts/OTF/SourceCodePro-Bold.otf +0 -0
- package/docs/assets/fonts/OTF/SourceCodePro-Regular.otf +0 -0
- package/docs/assets/fonts/TTF/SourceCodePro-Bold.ttf +0 -0
- package/docs/assets/fonts/TTF/SourceCodePro-Regular.ttf +0 -0
- package/docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff +0 -0
- package/docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff +0 -0
- package/docs/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff +0 -0
- package/docs/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff +0 -0
- package/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 +0 -0
- package/docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 +0 -0
- package/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 +0 -0
- package/docs/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 +0 -0
- package/docs/assets/fonts/source-code-pro.css +0 -23
- package/docs/assets/github.css +0 -123
- package/docs/assets/site.js +0 -108
- package/docs/assets/style.css +0 -136
- package/docs/index.html +0 -2187
- package/gulpfile.js +0 -95
- package/index.html +0 -184
- package/lib/typed.js +0 -1052
- package/lib/typed.min.js +0 -11
- package/lib/typed.min.js.map +0 -1
- package/logo-cropped.png +0 -0
- package/logo.png +0 -0
- package/src/defaults.js +0 -164
- package/src/html-parser.js +0 -67
- package/src/initializer.js +0 -207
- package/src/typed.js +0 -433
- package/webpack.config.js +0 -45
package/gulpfile.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
require('babel/register');
|
|
2
|
-
const gulp = require('gulp');
|
|
3
|
-
const webpack = require('webpack-stream');
|
|
4
|
-
const sourcemaps = require('gulp-sourcemaps');
|
|
5
|
-
const rename = require('gulp-rename');
|
|
6
|
-
const uglify = require('gulp-uglify');
|
|
7
|
-
const livereload = require('gulp-livereload');
|
|
8
|
-
const gulpDocumentation = require('gulp-documentation');
|
|
9
|
-
const eslint = require('gulp-eslint');
|
|
10
|
-
const server = require('gulp-express');
|
|
11
|
-
|
|
12
|
-
gulp.task('lint', () => {
|
|
13
|
-
return (
|
|
14
|
-
gulp
|
|
15
|
-
.src('src/*.js')
|
|
16
|
-
// default: use local linting config
|
|
17
|
-
.pipe(eslint())
|
|
18
|
-
// format ESLint results and print them to the console
|
|
19
|
-
.pipe(eslint.format())
|
|
20
|
-
.pipe(eslint.failAfterError())
|
|
21
|
-
);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
gulp.task('build', () => {
|
|
25
|
-
return gulp
|
|
26
|
-
.src('src/*.js')
|
|
27
|
-
.pipe(webpack(require('./webpack.config.js')))
|
|
28
|
-
.pipe(gulp.dest('./lib'))
|
|
29
|
-
.pipe(sourcemaps.init({ loadMaps: true }))
|
|
30
|
-
.pipe(
|
|
31
|
-
uglify({
|
|
32
|
-
preserveComments: 'license',
|
|
33
|
-
compress: {
|
|
34
|
-
/*eslint-disable */
|
|
35
|
-
negate_iife: false
|
|
36
|
-
/*eslint-enable */
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
)
|
|
40
|
-
.pipe(rename('typed.min.js'))
|
|
41
|
-
.pipe(sourcemaps.write('./'))
|
|
42
|
-
.pipe(gulp.dest('lib/'))
|
|
43
|
-
.pipe(livereload());
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
gulp.task('md-docs', () => {
|
|
47
|
-
return gulp
|
|
48
|
-
.src('./src/*.js')
|
|
49
|
-
.pipe(gulpDocumentation('md'))
|
|
50
|
-
.pipe(gulp.dest('docs'));
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
gulp.task('html-docs', () => {
|
|
54
|
-
return gulp
|
|
55
|
-
.src('./src/*.js')
|
|
56
|
-
.pipe(
|
|
57
|
-
gulpDocumentation('html'),
|
|
58
|
-
{},
|
|
59
|
-
{
|
|
60
|
-
name: 'Typed.js Docs',
|
|
61
|
-
version: '2.0.12'
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
.pipe(gulp.dest('docs'));
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
gulp.task('server', function() {
|
|
68
|
-
// Start the server at the beginning of the task
|
|
69
|
-
server.run(['app.js']);
|
|
70
|
-
// Restart the server when file changes
|
|
71
|
-
gulp.watch(['docs/**/*.html'], server.notify);
|
|
72
|
-
gulp.watch(['docs/styles/**/*.scss'], ['styles:scss']);
|
|
73
|
-
//gulp.watch(['{.tmp,app}/styles/**/*.css'], ['styles:css', server.notify]);
|
|
74
|
-
//Event object won't pass down to gulp.watch's callback if there's more than one of them.
|
|
75
|
-
//So the correct way to use server.notify is as following:
|
|
76
|
-
gulp.watch(['{.tmp,docs}/styles/**/*.css'], function(event) {
|
|
77
|
-
gulp.run('styles:css');
|
|
78
|
-
server.notify(event);
|
|
79
|
-
//pipe support is added for server.notify since v0.1.5,
|
|
80
|
-
//see https://github.com/gimm/gulp-express#servernotifyevent
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
gulp.watch(['docs/scripts/**/*.js'], ['jshint']);
|
|
84
|
-
gulp.watch(['docs/images/**/*'], server.notify);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
gulp.task('serve', ['watch', 'server']);
|
|
88
|
-
|
|
89
|
-
// Watch Task
|
|
90
|
-
gulp.task('watch', () => {
|
|
91
|
-
livereload({ start: true });
|
|
92
|
-
gulp.watch('src/*.js', ['md-docs', 'html-docs', 'default']);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
gulp.task('default', ['lint', 'build']);
|
package/index.html
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>Typed.js - Type your heart out</title>
|
|
6
|
-
<script src="lib/typed.js" type="text/javascript"></script>
|
|
7
|
-
<script src="assets/demos.js"></script>
|
|
8
|
-
<link href="assets/demos.css" rel="stylesheet"/>
|
|
9
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
|
|
10
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
|
|
11
|
-
<script>hljs.initHighlightingOnLoad();</script>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
|
|
15
|
-
<div class="wrap">
|
|
16
|
-
<h1 class="title">Typed.js</h1>
|
|
17
|
-
|
|
18
|
-
<div class="links">
|
|
19
|
-
<a href="https://github.com/mattboldt/typed.js">GitHub</a> |
|
|
20
|
-
<a href="http://www.mattboldt.com/typed.js/docs">Documentation</a> |
|
|
21
|
-
<a href="http://www.mattboldt.com/demos/typed-js">View original demo</a> |
|
|
22
|
-
<a href="http://www.mattboldt.com">View mattboldt.com</a> |
|
|
23
|
-
<a href="https://twitter.com/atmattb">Complain to Matt about how awful this is</a>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<hr>
|
|
27
|
-
|
|
28
|
-
<h2 id="basic">Basic Demo</h2>
|
|
29
|
-
<div class="type-wrap">
|
|
30
|
-
<div id="typed-strings">
|
|
31
|
-
<span>Typed.js^10 is a <strong>JavaScript</strong> library.</span>
|
|
32
|
-
<p>It <em>types</em> out sentences.</p>
|
|
33
|
-
<p>And then deletes them.</p>
|
|
34
|
-
<p>Try it out!</p>
|
|
35
|
-
</div>
|
|
36
|
-
<span id="typed" style="white-space:pre;"></span>
|
|
37
|
-
</div>
|
|
38
|
-
<button class="toggle">Toggle</button>
|
|
39
|
-
<button class="start">Start</button>
|
|
40
|
-
<button class="stop">Stop</button>
|
|
41
|
-
<button class="reset">Reset</button>
|
|
42
|
-
<button class="destroy">Destroy</button>
|
|
43
|
-
<button class="loop">Toggle Loop</button>
|
|
44
|
-
|
|
45
|
-
<pre>
|
|
46
|
-
<code class="javascript">
|
|
47
|
-
var typed = new Typed("#typed", {
|
|
48
|
-
stringsElement: '#typed-strings',
|
|
49
|
-
typeSpeed: 0,
|
|
50
|
-
backSpeed: 0,
|
|
51
|
-
backDelay: 500,
|
|
52
|
-
startDelay: 1000,
|
|
53
|
-
loop: false,
|
|
54
|
-
onBegin: function(self) { prettyLog('onBegin ' + self) },
|
|
55
|
-
onComplete: function(self) { prettyLog('onCmplete ' + self) },
|
|
56
|
-
preStringTyped: function(pos, self) { prettyLog('preStringTyped ' + pos + ' ' + self); },
|
|
57
|
-
onStringTyped: function(pos, self) { prettyLog('onStringTyped ' + pos + ' ' + self) },
|
|
58
|
-
onLastStringBackspaced: function(self) { prettyLog('onLastStringBackspaced ' + self) },
|
|
59
|
-
onTypingPaused: function(pos, self) { prettyLog('onTypingPaused ' + pos + ' ' + self) },
|
|
60
|
-
onTypingResumed: function(pos, self) { prettyLog('onTypingResumed ' + pos + ' ' + self) },
|
|
61
|
-
onReset: function(self) { prettyLog('onReset ' + self) },
|
|
62
|
-
onStop: function(pos, self) { prettyLog('onStop ' + pos + ' ' + self) },
|
|
63
|
-
onStart: function(pos, self) { prettyLog('onStart ' + pos + ' ' + self) },
|
|
64
|
-
onDestroy: function(self) { prettyLog('onDestroy ' + self) }
|
|
65
|
-
});
|
|
66
|
-
</code>
|
|
67
|
-
</pre>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<hr>
|
|
71
|
-
|
|
72
|
-
<h2 id="fade">Fade Out</h2>
|
|
73
|
-
<div class="type-wrap">
|
|
74
|
-
<span id="typed2" style="white-space:pre;"></span>
|
|
75
|
-
</div>
|
|
76
|
-
<button class="loop2">Toggle Loop</button>
|
|
77
|
-
|
|
78
|
-
<pre>
|
|
79
|
-
<code class="javascript">
|
|
80
|
-
var typed2 = new Typed('#typed2', {
|
|
81
|
-
strings: ['Some <i>strings</i> with', 'Some <strong>HTML</strong>', 'Chars &times; &copy;'],
|
|
82
|
-
typeSpeed: 0,
|
|
83
|
-
backSpeed: 0,
|
|
84
|
-
fadeOut: true,
|
|
85
|
-
loop: true
|
|
86
|
-
});
|
|
87
|
-
</code>
|
|
88
|
-
</pre>
|
|
89
|
-
|
|
90
|
-
<hr>
|
|
91
|
-
|
|
92
|
-
<h2 id="smartBack">Smart Backspace</h2>
|
|
93
|
-
<div class="type-wrap">
|
|
94
|
-
<span id="typed3"></span>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<pre>
|
|
98
|
-
<code class="javascript">
|
|
99
|
-
var typed3 = new Typed('#typed3', {
|
|
100
|
-
strings: ['My strings are: <i>strings</i> with', 'My strings are: <strong>HTML</strong>', 'My strings are: Chars &times; &copy;'],
|
|
101
|
-
typeSpeed: 0,
|
|
102
|
-
backSpeed: 0,
|
|
103
|
-
smartBackspace: true, // this is a default
|
|
104
|
-
loop: true
|
|
105
|
-
});
|
|
106
|
-
</code>
|
|
107
|
-
</pre>
|
|
108
|
-
|
|
109
|
-
<hr>
|
|
110
|
-
|
|
111
|
-
<h2 id="input">In an input</h2>
|
|
112
|
-
<div class="type-wrap">
|
|
113
|
-
<input id="typed4" type="text" style="padding: 10px;">
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<pre>
|
|
117
|
-
<code class="javascript">
|
|
118
|
-
var typed4 = new Typed('#typed4', {
|
|
119
|
-
strings: ['Some strings without', 'Some HTML', 'Chars'],
|
|
120
|
-
typeSpeed: 0,
|
|
121
|
-
backSpeed: 0,
|
|
122
|
-
attr: 'placeholder',
|
|
123
|
-
bindInputFocusEvents: true,
|
|
124
|
-
loop: true
|
|
125
|
-
});
|
|
126
|
-
</code>
|
|
127
|
-
</pre>
|
|
128
|
-
|
|
129
|
-
<hr>
|
|
130
|
-
|
|
131
|
-
<h2 id="shuffle">Shuffled</h2>
|
|
132
|
-
<div class="type-wrap">
|
|
133
|
-
<span id="typed5" style="white-space:pre;"></span>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
<pre>
|
|
137
|
-
<code class="javascript">
|
|
138
|
-
var typed5 = new Typed('#typed5', {
|
|
139
|
-
strings: ['1 Some <i>strings</i> with', '2 Some <strong>HTML</strong>', '3 Chars &times; &copy;'],
|
|
140
|
-
typeSpeed: 0,
|
|
141
|
-
backSpeed: 0,
|
|
142
|
-
cursorChar: '_',
|
|
143
|
-
shuffle: true,
|
|
144
|
-
smartBackspace: false,
|
|
145
|
-
loop: true
|
|
146
|
-
});
|
|
147
|
-
</code>
|
|
148
|
-
</pre>
|
|
149
|
-
|
|
150
|
-
<hr>
|
|
151
|
-
|
|
152
|
-
<h2 id="bulk">Bulk Typing</h2>
|
|
153
|
-
<div class="type-wrap" style="height: 50px;">
|
|
154
|
-
<span id="typed6" style="white-space:pre;"></span>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
<pre>
|
|
158
|
-
<code class="javascript">
|
|
159
|
-
var typed6 = new Typed('#typed6', {
|
|
160
|
-
strings: ['npm install^1000\n `installing components...` ^1000\n `Fetching from source...`'],
|
|
161
|
-
typeSpeed: 40,
|
|
162
|
-
backSpeed: 0,
|
|
163
|
-
loop: true
|
|
164
|
-
});
|
|
165
|
-
</code>
|
|
166
|
-
</pre>
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<script type="text/javascript">
|
|
172
|
-
var _gaq = _gaq || [];
|
|
173
|
-
_gaq.push(['_setAccount', 'UA-11539016-1']);
|
|
174
|
-
_gaq.push(['_trackPageview']);
|
|
175
|
-
|
|
176
|
-
(function() {
|
|
177
|
-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
178
|
-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
179
|
-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
180
|
-
})();
|
|
181
|
-
</script>
|
|
182
|
-
|
|
183
|
-
</body>
|
|
184
|
-
</html>
|