Skip to content

Commit a708ac0

Browse files
committed
- updatge to v2.4.1 Croppie.js
- add zoomer and exif options - fix package.json - code refactoring
1 parent 73fc343 commit a708ac0

File tree

6 files changed

+100
-79
lines changed

6 files changed

+100
-79
lines changed

gulpfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ gulp.task('css', ['clean'], function(cb) {
1919
gulp.src('unminified/ng-croppie.css'),
2020
rename({suffix: '.min'}),
2121
minify({compatibility: 'ie11', keepBreaks: true}),
22-
header(banner, {pkg: pkg}),
22+
//header(banner, {pkg: pkg}),
2323
gulp.dest('minified')
2424
], cb);
2525
});
@@ -29,7 +29,7 @@ gulp.task('js', ['clean'], function(cb) {
2929
gulp.src('unminified/ng-croppie.js'),
3030
rename({suffix: '.min'}),
3131
uglify(),
32-
header(banner, {pkg: pkg}),
32+
//header(banner, {pkg: pkg}),
3333
gulp.dest('minified')
3434
], cb);
3535
});

minified/ng-croppie.min.css

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

minified/ng-croppie.min.js

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

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"name": "ng-croppie",
33
"version": "1.0.0",
44
"description": "An Angular module for the awesome Croppie.js",
5-
"main": "index.js",
5+
"main": [
6+
"unminified/ng-croppie.js",
7+
"unminified/ng-croppie.css"
8+
],
69
"scripts": {
710
"test": "echo \"Error: no test specified\" && exit 1"
811
},

unminified/ng-croppie.css

+73-63
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,100 @@
11
.croppie-container {
2-
padding: 30px;
2+
width: 100%;
3+
height: 100%;
34
}
5+
46
.croppie-container .cr-image {
5-
z-index: -1;
6-
position: absolute;
7-
top: 0;
8-
left: 0;
9-
transform-origin: 0 0;
7+
z-index: -1;
8+
position: absolute;
9+
top: 0;
10+
left: 0;
11+
transform-origin: 0 0;
12+
max-height: none;
13+
max-width: none;
1014
}
1115

1216
.croppie-container .cr-boundary {
13-
position: relative;
14-
overflow: hidden;
15-
margin: 0 auto;
16-
z-index: 1;
17+
position: relative;
18+
overflow: hidden;
19+
margin: 0 auto;
20+
z-index: 1;
21+
width: 100%;
22+
height: 100%;
1723
}
1824

1925
.croppie-container .cr-viewport {
20-
position: absolute;
21-
border: 2px solid #fff;
22-
margin: auto;
23-
top: 0;
24-
bottom: 0;
25-
right: 0;
26-
left: 0;
27-
box-shadow:0 0 0 899px rgba(0, 0, 0, 0.5);
28-
z-index: 0;
26+
position: absolute;
27+
border: 2px solid #fff;
28+
margin: auto;
29+
top: 0;
30+
bottom: 0;
31+
right: 0;
32+
left: 0;
33+
box-shadow: 0 0 2000px 2000px rgba(0, 0, 0, 0.5);
34+
z-index: 0;
35+
}
36+
37+
.croppie-container .cr-original-image {
38+
display: none;
2939
}
40+
3041
.croppie-container .cr-vp-circle {
31-
border-radius: 50%;
42+
border-radius: 50%;
3243
}
44+
3345
.croppie-container .cr-overlay {
34-
z-index: 1;
35-
position: absolute;
36-
cursor: move;
46+
z-index: 1;
47+
position: absolute;
48+
cursor: move;
3749
}
50+
3851
.croppie-container .cr-slider-wrap {
39-
width: 75%;
40-
margin: 0 auto;
41-
margin-top: 25px;
42-
text-align: center;
52+
width: 75%;
53+
margin: 15px auto;
54+
text-align: center;
4355
}
56+
4457
.croppie-result {
45-
position: relative;
46-
overflow: hidden;
58+
position: relative;
59+
overflow: hidden;
4760
}
61+
4862
.croppie-result img {
49-
position: absolute;
63+
position: absolute;
64+
}
65+
66+
.croppie-container .cr-image,
67+
.croppie-container .cr-overlay,
68+
.croppie-container .cr-viewport {
69+
-webkit-transform: translateZ(0);
70+
-moz-transform: translateZ(0);
71+
-ms-transform: translateZ(0);
72+
transform: translateZ(0);
5073
}
5174

5275
/*************************************/
5376
/***** STYLING RANGE INPUT ***********/
5477
/*************************************/
55-
/*http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */
78+
/* http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */
5679
/*************************************/
5780

5881
.cr-slider {
59-
-webkit-appearance: none;/*removes default webkit styles*/
82+
-webkit-appearance: none;
83+
/*removes default webkit styles*/
6084
/*border: 1px solid white; *//*fix for FF unable to apply focus style bug */
61-
width: 300px;/*required for proper track sizing in FF*/
85+
width: 300px;
86+
/*required for proper track sizing in FF*/
6287
max-width: 100%;
6388
}
89+
6490
.cr-slider::-webkit-slider-runnable-track {
6591
width: 100%;
6692
height: 3px;
6793
background: rgba(0, 0, 0, 0.5);
6894
border: 0;
6995
border-radius: 3px;
7096
}
97+
7198
.cr-slider::-webkit-slider-thumb {
7299
-webkit-appearance: none;
73100
border: none;
@@ -77,6 +104,7 @@
77104
background: #ddd;
78105
margin-top: -6px;
79106
}
107+
80108
.cr-slider:focus {
81109
outline: none;
82110
}
@@ -93,6 +121,7 @@
93121
border: 0;
94122
border-radius: 3px;
95123
}
124+
96125
.cr-slider::-moz-range-thumb {
97126
border: none;
98127
height: 16px;
@@ -102,19 +131,19 @@
102131
margin-top: -6px;
103132
}
104133

105-
/*hide the outline behind the border*/
106-
.cr-slider:-moz-focusring{
134+
/* hide the outline behind the border */
135+
.cr-slider:-moz-focusring {
107136
outline: 1px solid white;
108137
outline-offset: -1px;
109138
}
110139

111140
.cr-slider::-ms-track {
112-
width: 300px;
141+
width: 100%;
113142
height: 5px;
114-
background: transparent;/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
115-
border-color: transparent;/*leave room for the larger thumb to overflow with a transparent border */
143+
background: transparent; /* remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
144+
border-color: transparent; /* leave room for the larger thumb to overflow with a transparent border */
116145
border-width: 6px 0;
117-
color: transparent;/*remove default tick marks*/
146+
color: transparent;/* remove default tick marks */
118147
}
119148
.cr-slider::-ms-fill-lower {
120149
background: rgba(0, 0, 0, 0.5);
@@ -130,16 +159,19 @@
130159
width: 16px;
131160
border-radius: 50%;
132161
background: #ddd;
162+
margin-top:1px;
133163
}
134164
.cr-slider:focus::-ms-fill-lower {
135165
background: rgba(0, 0, 0, 0.5);
136166
}
137167
.cr-slider:focus::-ms-fill-upper {
138168
background: rgba(0, 0, 0, 0.5);
139169
}
170+
/*******************************************/
140171

172+
/***********************************/
141173
/* Rotation Tools */
142-
/******************/
174+
/***********************************/
143175
.cr-rotate-controls {
144176
position: absolute;
145177
bottom: 5px;
@@ -161,26 +193,4 @@
161193
}
162194
.cr-rotate-r i:before {
163195
content: '↻';
164-
}
165-
/*******************************************/
166-
167-
168-
/* Just cross hairs for debugging - can be removed upon release */
169-
.croppie-container .cr-viewport.debug:before,
170-
.croppie-container .cr-viewport.debug:after {
171-
background: white;
172-
width: 1px;
173-
height: 1px;
174-
content: '';
175-
position: absolute;
176-
}
177-
.croppie-container .cr-viewport.debug:before {
178-
top: 0;
179-
height: 100%;
180-
left: 50%;
181-
}
182-
.croppie-container .cr-viewport.debug:after {
183-
top: 50%;
184-
left: 0;
185-
width: 100%;
186-
}
196+
}

0 commit comments

Comments
 (0)