Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sass styles #358

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,37 @@ module.exports = function(grunt) {
' */\n',

// Task configuration.
sass: {
options: {
sourceMap: false
},
dist: {
files: {
'build/loading-bar.css': 'src/loading-bar.scss'
}
}
},

postcss: {
options: {
map: false,

processors: [
require('autoprefixer')({browsers: 'last 2 versions'}), // add vendor prefixes
]
},
dist: {
src: 'build/loading-bar.css'
}
},

sasslint: {
options: {
configFile: 'sass-lint.yml'
},
target: ['src/loading-bar.scss']
},

uglify: {
options: {
banner: '<%= banner %>',
Expand All @@ -29,7 +60,7 @@ module.exports = function(grunt) {
report: 'gzip'
},
minify: {
src: 'src/loading-bar.css',
src: 'build/loading-bar.css',
dest: 'build/loading-bar.min.css'
}
},
Expand Down Expand Up @@ -82,7 +113,7 @@ module.exports = function(grunt) {
banner: '<%= banner %>'
},
files: {
'build/loading-bar.css': 'src/loading-bar.css',
// 'build/loading-bar.css': 'src/loading-bar.css',
'build/loading-bar.js': 'src/loading-bar.js',
}
}
Expand All @@ -94,8 +125,11 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-sass-lint');

grunt.registerTask('default', ['jshint', 'karma:unit', 'karma:unit13', 'karma:unit14', 'uglify', 'cssmin', 'concat:build']);
grunt.registerTask('default', ['jshint', 'sasslint', 'karma:unit', 'karma:unit13', 'karma:unit14', 'uglify', 'sass', 'postcss', 'cssmin', 'concat:build']);
grunt.registerTask('test', ['karma:watch']);
grunt.registerTask('build', ['default']);

Expand Down
167 changes: 67 additions & 100 deletions build/loading-bar.css
Original file line number Diff line number Diff line change
@@ -1,110 +1,77 @@
/*!
* angular-loading-bar v0.9.0
* https://chieffancypants.github.io/angular-loading-bar
* Copyright (c) 2016 Wes Cruver
* License: MIT
*/

/* Make clicks pass-through */
#loading-bar,
#loading-bar-spinner {
#loading-bar {
pointer-events: none;
-webkit-pointer-events: none;
-webkit-transition: 350ms linear all;
-moz-transition: 350ms linear all;
-o-transition: 350ms linear all;
transition: 350ms linear all;
}

#loading-bar.ng-enter,
#loading-bar.ng-leave.ng-leave-active,
#loading-bar-spinner.ng-enter,
#loading-bar-spinner.ng-leave.ng-leave-active {
opacity: 0;
}

#loading-bar.ng-enter.ng-enter-active,
#loading-bar.ng-leave,
#loading-bar-spinner.ng-enter.ng-enter-active,
#loading-bar-spinner.ng-leave {
opacity: 1;
}

#loading-bar .bar {
-webkit-transition: width 350ms;
-moz-transition: width 350ms;
-o-transition: width 350ms;
transition: width 350ms;

background: #29d;
position: fixed;
z-index: 10002;
top: 0;
left: 0;
width: 100%;
height: 2px;
border-bottom-right-radius: 1px;
border-top-right-radius: 1px;
}

/* Fancy blur effect */
#loading-bar .peg {
position: absolute;
width: 70px;
right: 0;
top: 0;
height: 2px;
opacity: .45;
-moz-box-shadow: #29d 1px 0 6px 1px;
-ms-box-shadow: #29d 1px 0 6px 1px;
-webkit-box-shadow: #29d 1px 0 6px 1px;
box-shadow: #29d 1px 0 6px 1px;
-moz-border-radius: 100%;
-webkit-border-radius: 100%;
border-radius: 100%;
}
transition: 350ms linear all; }
#loading-bar.ng-enter {
opacity: 0; }
#loading-bar.ng-enter.ng-enter-active {
opacity: 1; }
#loading-bar.ng-leave {
opacity: 1; }
#loading-bar.ng-leave.ng-leave-active {
opacity: 0; }
#loading-bar .bar {
background: #29d;
border-bottom-right-radius: 1px;
border-top-right-radius: 1px;
height: 2px;
left: 0;
position: fixed;
top: 0;
-webkit-transition: width 350ms;
transition: width 350ms;
width: 100%;
z-index: 10002; }
#loading-bar .peg {
border-radius: 100%;
-webkit-box-shadow: #29d 1px 0 6px 1px;
box-shadow: #29d 1px 0 6px 1px;
height: 2px;
opacity: .45;
position: absolute;
right: 0;
top: 0;
width: 70px; }

#loading-bar-spinner {
display: block;
left: 10px;
pointer-events: none;
position: fixed;
z-index: 10002;
top: 10px;
left: 10px;
}

#loading-bar-spinner .spinner-icon {
width: 14px;
height: 14px;

border: solid 2px transparent;
border-top-color: #29d;
border-left-color: #29d;
border-radius: 50%;

-webkit-animation: loading-bar-spinner 400ms linear infinite;
-moz-animation: loading-bar-spinner 400ms linear infinite;
-ms-animation: loading-bar-spinner 400ms linear infinite;
-o-animation: loading-bar-spinner 400ms linear infinite;
animation: loading-bar-spinner 400ms linear infinite;
}
-webkit-transition: 350ms linear all;
transition: 350ms linear all;
z-index: 10002; }
#loading-bar-spinner.ng-enter {
opacity: 0; }
#loading-bar-spinner.ng-enter.ng-enter-active {
opacity: 1; }
#loading-bar-spinner.ng-leave {
opacity: 1; }
#loading-bar-spinner.ng-leave.ng-leave-active {
opacity: 0; }
#loading-bar-spinner .spinner-icon {
-webkit-animation: loading-bar-spinner 400ms linear infinite;
animation: loading-bar-spinner 400ms linear infinite;
border: solid 2px transparent;
border-left-color: #29d;
border-radius: 50%;
border-top-color: #29d;
height: 14px;
width: 14px; }

@-webkit-keyframes loading-bar-spinner {
0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@-moz-keyframes loading-bar-spinner {
0% { -moz-transform: rotate(0deg); transform: rotate(0deg); }
100% { -moz-transform: rotate(360deg); transform: rotate(360deg); }
}
@-o-keyframes loading-bar-spinner {
0% { -o-transform: rotate(0deg); transform: rotate(0deg); }
100% { -o-transform: rotate(360deg); transform: rotate(360deg); }
}
@-ms-keyframes loading-bar-spinner {
0% { -ms-transform: rotate(0deg); transform: rotate(0deg); }
100% { -ms-transform: rotate(360deg); transform: rotate(360deg); }
}
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }

@keyframes loading-bar-spinner {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg); }
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg); } }
2 changes: 1 addition & 1 deletion build/loading-bar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* angular-loading-bar v0.9.0
* https://chieffancypants.github.io/angular-loading-bar
* Copyright (c) 2016 Wes Cruver
* Copyright (c) 2017 Wes Cruver
* License: MIT
*/
/*
Expand Down
2 changes: 1 addition & 1 deletion build/loading-bar.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions build/loading-bar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!-- loadingbar -->
<script src="../src/loading-bar.js"></script>
<link href='../src/loading-bar.css' rel='stylesheet' />
<link href='../build/loading-bar.min.css' rel='stylesheet' />

<!-- example app -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
Expand Down
27 changes: 16 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@
},
"homepage": "https://chieffancypants.github.io/angular-loading-bar",
"devDependencies": {
"karma-jasmine": "^0.1.3",
"karma-coffee-preprocessor": "^0.2.0",
"karma-phantomjs-launcher": "^0.1.0",
"karma": "~0.12.0",
"karma-coverage": "^0.1.0",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-cssmin": "~0.12.0",
"grunt-karma": "~0.11.0",
"grunt-contrib-concat": "^0.5.0"
"autoprefixer": "^7.1.1",
"grunt": "^1.0.1",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-cssmin": "^2.2.0",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-uglify": "^3.0.0",
"grunt-karma": "^2.0.0",
"grunt-postcss": "^0.8.0",
"grunt-sass": "^2.0.0",
"grunt-sass-lint": "^0.2.2",
"jasmine-core": "^2.6.2",
"karma": "^1.7.0",
"karma-coffee-preprocessor": "^1.0.1",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.4"
}
}
6 changes: 6 additions & 0 deletions sass-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
options:
formatter: stylish
merge-default-rules: true
rules:
no-ids: 0
no-transition-all: 0
Loading