We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f72b507 commit 7f63ff1Copy full SHA for 7f63ff1
coffee/script.coffee
@@ -1,2 +1,9 @@
1
-$ ->
2
- $('h1').append('Hello')
+$list = $('#list')
+$('#add').click ->
3
+ $li = $('<li class="animate">')
4
+ $list.append $li
5
+ $li.html 'test'
6
+ return
7
+$('#remove').click ->
8
+ $('#list li:last').remove()
9
css/style.css
@@ -1,2 +1,12 @@
.test {
+ color: red; }
+
+.animate {
+ transition-property: transform, color;
+ transition-timing: ease-out;
+ transition-duration: .3s;
10
+.animation:active {
11
+ transform: scale(1.02);
12
color: blue; }
dist/all.js
@@ -1 +1,14 @@
-alert("Hello");
+var $list;
+$list = $('#list');
+$('#add').click(function() {
+ var $li;
+ $li = $('<li class="animate">');
+ $list.append($li);
+ $li.html('test');
+});
+$('#remove').click(function() {
13
+ $('#list li:last').remove();
14
dist/all.min.js
gulpfile.js
@@ -29,8 +29,7 @@ gulp.task('sass', function() {
29
gulp.task('coffee', function() {
30
gulp.src('coffee/*.coffee')
31
.pipe(coffee({bare: true}))
32
- .on('error', gutil.log)
33
- .pipe(gulp.dest('scripts'));
+ .pipe(gulp.dest('js'));
34
});
35
36
// Concatenate & Minify JS
@@ -47,12 +46,13 @@ gulp.task('scripts', function() {
47
46
// Watch Files For Changes
48
gulp.task('watch', function() {
49
livereload.listen();
+ gulp.watch('coffee/*.coffee', ['coffee']);
50
gulp.watch('js/*.js', ['lint', 'scripts']);
51
- gulp.watch('scss/*.scss', ['sass']);
52
gulp.watch('*.html', function(e){
53
livereload.changed(e.path);
54
+ gulp.watch('scss/*.scss', ['sass']);
55
56
57
// Default Task
58
-gulp.task('default', ['lint', 'sass', 'scripts', 'watch']);
+gulp.task('default', ['lint', 'sass', 'coffee', 'scripts', 'watch']);
index.html
@@ -4,9 +4,15 @@
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/style.css">
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
</head>
<body>
<h1 class="test">Hello, world!</h1>
- <script src="js/script.js"></script>
+ <ul id="list">
+ <li class='animate'>test</li>
+ </ul>
+ <input type="button" value="add" id="add">
15
+ <input type="button" value="remove" id="remove">
16
+ <script src="dist/all.min.js"></script>
17
</body>
18
</html>
js/script.js
scss/style.scss
@@ -1,3 +1,15 @@
.test{
+ color: red;
+}
+.animate{
+.animation:active{
color: blue;
}
0 commit comments