Skip to content

Commit 36496c3

Browse files
committed
init
0 parents  commit 36496c3

11 files changed

+2941
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
demo.html

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 codefacebook
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, 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,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

css/demo.css

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/* main styles */
2+
3+
*, *:before, *:after {
4+
box-sizing: border-box;
5+
padding: 0;
6+
margin: 0;
7+
}
8+
9+
body {
10+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
11+
font-size: 100%;
12+
color: #444;
13+
background-color: #fff;
14+
overflow-x: hidden;
15+
overflow-y: scroll;
16+
}
17+
18+
article {
19+
max-width: 40em;
20+
padding: 0 4em;
21+
margin: 0 auto;
22+
}
23+
24+
h1, h2 {
25+
font-weight: normal;
26+
margin-top: 1em;
27+
}
28+
29+
p, a {
30+
margin-top: 1em;
31+
}
32+
33+
h2 + p {
34+
margin-top: 0;
35+
}
36+
37+
ul, ol {
38+
margin: 1em 0 0 2em;
39+
}
40+
41+
li {
42+
margin-top: 0.5em;
43+
}
44+
45+
pre {
46+
white-space: pre;
47+
padding: 2px 6px;
48+
margin-top: 1em;
49+
background-color: #ddd;
50+
border-radius: 3px;
51+
overflow: auto;
52+
}
53+
54+
code {
55+
font-family: monospace;
56+
font-size: 1em;
57+
}
58+
59+
img {
60+
max-width: 100%;
61+
}
62+
63+
.bgimg {
64+
background: url(https://ucarecdn.com/718f79c5-2868-41c8-b56e-c87237674adb/-/resize/500x/man.jpg) 50% 50% no-repeat;
65+
background-size: cover;
66+
height: 300px;
67+
margin-top: 0.5em;
68+
font-size: 2em;
69+
text-align: center;
70+
color: #fff;
71+
text-shadow: 0 0 2px #000;
72+
}
73+
74+
.bgimg.replace {
75+
background-image: url(https://ucarecdn.com/718f79c5-2868-41c8-b56e-c87237674adb/-/resize/32x/man.jpg);
76+
}
77+
78+
.primary {
79+
width: 100vw;
80+
left: 50%;
81+
margin-left: -50vw;
82+
}
83+
84+
.full, .boxout1, .boxout2 {
85+
clear: both;
86+
width: 100%;
87+
box-shadow: 0 3px 4px #000;
88+
}
89+
90+
@media (min-width: 40em) {
91+
92+
.boxout1, .boxout2 {
93+
clear: both;
94+
float: left;
95+
width: 22em;
96+
margin: 1em 1em 1em -4em;
97+
}
98+
99+
.boxout2 {
100+
float: right;
101+
margin: 1em -4em 1em 1em;
102+
}
103+
104+
}

css/lazy-load-images.css

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* progressive image CSS */
2+
.lazy-load {
3+
position: relative;
4+
display: block;
5+
overflow: hidden;
6+
outline: none;
7+
}
8+
9+
.lazy-load img {
10+
display: block;
11+
width: 100%;
12+
max-width: none;
13+
height: auto;
14+
border: 0 none;
15+
}
16+
17+
.lazy-load img.preview {
18+
filter: blur(2vw);
19+
transform: scale(1.05);
20+
}
21+
22+
.lazy-load img.reveal {
23+
position: absolute;
24+
left: 0;
25+
top: 0;
26+
will-change: transform, opacity;
27+
animation: lazyLoadReveal 1s ease-out;
28+
}
29+
30+
@keyframes lazyLoadReveal {
31+
0% { transform: scale(1.05); opacity: 0; }
32+
100% { transform: scale(1); opacity: 1; }
33+
}

gulpfile.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
var gulp = require('gulp');
2+
var concat = require('gulp-concat');
3+
var clean = require('gulp-rimraf');
4+
var cssmin = require("gulp-minify-css");
5+
var uglify = require('gulp-uglify');
6+
7+
gulp.task('clean', [], function() {
8+
console.log("Clean all files in lib folder");
9+
10+
return gulp.src("lib/*", { read: false }).pipe(clean());
11+
});
12+
13+
gulp.task('css', [], function() {
14+
console.log("Concat, move, and minify all the css files in styles folder");
15+
return gulp.src("css/**.css")
16+
.pipe(concat('lazy-load-images.min.css'))
17+
.pipe(cssmin())
18+
.pipe(gulp.dest('lib/css'));
19+
});
20+
21+
gulp.task('javascript', function () {
22+
console.log("Validate, Concat, Uglify, and Move all the javascript files");
23+
24+
return gulp.src("src/**.js")
25+
.pipe(uglify())
26+
.pipe(concat('lazy-load-images.min.js'))
27+
.pipe(gulp.dest('lib/js'));
28+
});
29+
30+
gulp.task('default', ['clean', 'css', 'javascript']);

lazy-load-images.js.zip

2.38 KB
Binary file not shown.

lib/css/lazy-load-images.min.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/lazy-load-images.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)