Skip to content

Commit

Permalink
Print.js First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
crabbly committed Apr 14, 2016
1 parent 8b22ee5 commit 22ebea3
Show file tree
Hide file tree
Showing 9 changed files with 614 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
node_modules/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Rodrigo
Copyright (c) 2016 Rodrigo Vieira (@crabbly)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,45 @@
# printJS
A tiny javascript library to help printing from the web.

For documentation and examples please visit: [printjs.crabbly.com](http://printjs.crabbly.com)


##Contributing to Print.js

Contributions to Print.js are welcome and encouraged.


#####Using issues

The [issue tracker](https://github.com/crabbly/Print.js/issues) is the preferred channel for reporting bugs, requesting new features and submitting pull requests.

Keep in mind that we would like to keep this a lightweight library.

Please do not use issues for support requests. For help using Print.js, please ask questions on Stack Overflow and use the tag `printjs`.


#####Reporting bugs

Well structured, detailed bug reports are hugely valuable for the project.

- Check the issue search to see if it has already been reported
- Isolate the problem to a simple test case
- Provide a demonstration of the problem on [JS Bin](http://jsbin.com), [JSFiddle](http://jsfiddle.net) or similar

Please provide any additional details associated with the bug, if it's browser or screen density specific, or only happens with a certain configuration or data.


#####Pull requests

Clear, concise pull requests are excellent at continuing the project's community driven growth.

- Please create an issue first:
- For bugs, we can discuss the fixing approach
- For enhancements, we can discuss if it is within the project scope and avoid duplicate effort
- Tabs for indentation, not spaces please
- Please make your commits in logical sections with clear commit messages


##License

Print.js is available under the [MIT license](https://github.com/crabbly/Print.js/blob/master/LICENSE.md).
1 change: 1 addition & 0 deletions dist/print.min.css

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

1 change: 1 addition & 0 deletions dist/print.min.js

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

22 changes: 22 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
cleanCSS = require('gulp-clean-css');

gulp.task('js', function() {
return gulp.src('src/print.js')
.pipe(uglify())
.pipe(rename('print.min.js'))
.pipe(gulp.dest('dist/'));
});


gulp.task('css', function() {
return gulp.src('src/print.css')
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(rename('print.min.css'))
.pipe(gulp.dest('dist'));
});

gulp.task('default', ['js', 'css']);
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "print.js",
"homepage": "http://printjs.crabbly.com",
"description": "A tiny javascript library to help printing from the web.",
"version": "1.0.0",
"main": "Print.js",
"repository": {
"type": "git",
"url": "https://github.com/crabbly/Print.js"
},
"license": "MIT",
"dependences": {},
"devDependencies": {
"gulp": "3.9.x",
"gulp-uglify": "~1.5.x",
"gulp-rename": "1.2.x",
"gulp-clean-css": "2.0.x"
},
"spm": {
"main": "Print.js"
}
}
73 changes: 73 additions & 0 deletions src/print.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Print.js
* http://printJS.crabbly.com
* Version: 1.0.0
*
* Copyright 2016 Rodrigo Vieira (@crabbly)
* Released under the MIT license
* https://github.com/crabbly/print.js/LICENSE.md
*/

/* === Print Modal === */

.printModal {
font-family:sans-serif;
display:flex;
text-align:center;
font-weight:300;
font-size:30px;
left:0;
top:0;
position:absolute;
color: #0460B5;
width: 100%;
height: 100%;
background-color:rgba(255, 255, 255, 0.91);
}

/* === Print Modal Spinner */
.printSpinner {
margin-top: 3px;
margin-left: -40px;
position: absolute;
display: inline-block;
width: 25px;
height: 25px;
border: 2px solid #0460B5;
border-radius: 50%;
animation: spin 0.75s infinite linear;
}
.printSpinner::before, .printSpinner::after {
left: -2px;
top: -2px;
display: none;
position: absolute;
content: '';
width: inherit;
height: inherit;
border: inherit;
border-radius: inherit;
}

.printSpinner, .printSpinner::before, .printSpinner::after {
display: inline-block;
border-color: transparent;
border-top-color: #0460B5;
animation-duration: 1.2s;
}
.printSpinner::before {
transform: rotate(120deg);
}
.printSpinner::after {
transform: rotate(240deg);
}

/* Keyframes for the animation */
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
Loading

0 comments on commit 22ebea3

Please sign in to comment.