1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
$dropzone-link-color: #0BA7D1; // match default `a` styling
$dropzone-link-color--awakened: #0D7CCE; // match default `a:hover` styling
$dropzone-border-color: #888; // match default form inputs
$dropzone-border-color--awakened: $dropzone-link-color--awakened;
$dropzone-border-color--full: #bf002a;
$dropzone-border-radius: 0.25em; // match default form inputs
$dropzone-background-color: #fff;
$dropzone-background-color--awakened: mix($dropzone-link-color, $dropzone-background-color, 10%);
$dropzone-background-color--full: mix($dropzone-border-color--full, $dropzone-background-color, 10%);
.dropzone {
@include clearfix();
border: 0.125em solid $dropzone-border-color;
background-color: $dropzone-background-color;
border-radius: $dropzone-border-radius;
padding: 1.5em;
text-align: center;
}
.dz-clickable {
cursor: pointer;
* {
cursor: auto;
}
.dz-message,
.dz-message *,
.dz-remove,
.dz-cancel {
cursor: pointer;
}
.dz-message u {
color: $dropzone-link-color;
}
}
.dz-clickable:hover,
.dz-drag-hover {
border-color: $dropzone-link-color--awakened;
background-color: $dropzone-background-color--awakened;
.dz-remove,
.dz-cancel {
border-color: $dropzone-background-color--awakened;
}
.dz-message u {
color: $dropzone-link-color--awakened;
}
}
.dz-max-files-reached {
cursor: auto;
&:hover {
border-color: $dropzone-border-color;
background-color: $dropzone-background-color;
.dz-remove,
.dz-cancel {
border-color: $dropzone-background-color;
}
}
&.dz-drag-hover {
border-color: $dropzone-border-color--full;
background-color: $dropzone-background-color--full;
.dz-remove,
.dz-cancel {
border-color: $dropzone-background-color--full;
}
}
.dz-message.dz-default {
display: none;
}
.dz-preview {
margin-top: 0;
}
}
.dz-message {
margin-bottom: 1.5em;
&:last-child {
margin-bottom: 0;
}
}
.dz-preview {
position: relative;
float: left;
width: 30%;
height: 0;
padding-bottom: 30%; // makes a square element
margin-right: 5%;
&:last-child {
margin-right: 0;
}
}
.dz-image {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: $dropzone-border-radius;
overflow: hidden; // crop child image to border radius, even before img src has loaded
img {
width: 100%;
height: 100%;
}
}
// If there was an error, we don't want to display the preview image on top of it.
.dz-error .dz-image {
display: none;
}
.dz-progress {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
// http://loading.io/loader/?use=eyJzaXplIjo1MCwic3BlZWQiOjEsImNiayI6IiNlZWVlZWUiLCJjMSI6IiM5OTk5OTkiLCJjMiI6IjEyIiwiYzMiOiI0IiwiYzQiOiIxNSIsImM1IjoiMiIsImM2IjoiMjAiLCJ0eXBlIjoiZGVmYXVsdCJ9
background: #eee url(/cobrands/fixmystreet/images/spinner-grey-eee.gif) no-repeat center center;
background-image: url(/cobrands/fixmystreet/images/spinner-grey-eee.svg), none;
background-size: 100px;
border-radius: 0.3em;
.dz-complete & {
display: none;
}
.dz-upload {
background: rgba(0,0,0,0.2);
border-radius: $dropzone-border-radius;
height: 100%;
width: 0;
display: block;
}
}
.dz-error-message {
color: #881111;
padding-top: 1.5em;
}
.dz-remove,
.dz-cancel {
display: block;
width: 1.5em;
height: 0;
padding-top: 1.5em;
overflow: hidden;
position: absolute;
top: -0.5em;
right: -0.5em;
border: 4px solid #fff;
border-radius: 100%;
background: #888 url(/cobrands/fixmystreet/images/cross-14px.png) no-repeat center center;
background-image: url(/cobrands/fixmystreet/images/cross-14px.svg), none;
background-size: 14px;
&:hover,
&:focus {
background-color: red;
}
}
// Deviously use pseudo-elements to preload a few images so they appear as soon as a file is picked
.dz-message {
&:before {
content: "";
position: absolute;
background: transparent url(/cobrands/fixmystreet/images/spinner-grey-eee.gif) no-repeat 0 0;
background-image: url(/cobrands/fixmystreet/images/spinner-grey-eee.svg), none;
}
&:after {
content: "";
position: absolute;
background: transparent url(/cobrands/fixmystreet/images/cross-14px.png) no-repeat 0 0;
background-image: url(/cobrands/fixmystreet/images/cross-14px.svg), none;
}
}
// Don't really need these
.dz-details, .dz-success-mark, .dz-error-mark {
display: none;
}
|