Skip to content

Commit b97095e

Browse files
committed
variables
1 parent 61aabb5 commit b97095e

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

modules/filters.html

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,54 +203,49 @@
203203
}
204204
function blur() {
205205
let blurValue = document.getElementsByName("blur")[0].value;
206-
return blurValue == "0" ? "" : "blur(" + blurValue + "rem) ";
206+
return blurValue == "0" ? "" : `blur(${blurValue}rem) `;
207207
}
208208
function brightness() {
209209
let brightnessValue = document.getElementsByName("brightness")[0].value;
210210
return brightnessValue.toString() === "1"
211211
? ""
212-
: "brightness(" + brightnessValue + ") ";
212+
: `brightness(${brightnessValue}) `;
213213
}
214214
function contrast() {
215215
let contrastValue = document.getElementsByName("contrast")[0].value;
216-
return contrastValue == 1 ? "" : "contrast(" + contrastValue + ") ";
216+
return contrastValue == 1 ? "" : `contrast(${contrastValue}) `;
217217
}
218218
function dropShadow() {
219219
let dropShadowValue = document.getElementsByName("dropShadow")[0].value;
220220
return dropShadowValue == 0
221221
? ""
222-
: "drop-shadow(" +
223-
dropShadowValue +
224-
"rem " +
225-
dropShadowValue +
226-
"rem " +
227-
"0rem orange) ";
222+
: `drop-shadow(${dropShadowValue}rem ${dropShadowValue}rem 0rem orange) `;
228223
}
229224
function grayscale() {
230225
let grayscaleValue = document.getElementsByName("grayscale")[0].value;
231-
return grayscaleValue == 0 ? "" : "grayscale(" + grayscaleValue + ") ";
226+
return grayscaleValue == 0 ? "" : `grayscale(${grayscaleValue}) `;
232227
}
233228
function hueRotate() {
234229
let hueRotateValue = document.getElementsByName("hueRotate")[0].value;
235230
return hueRotateValue == 0
236231
? ""
237-
: "hue-rotate(" + hueRotateValue + "turn) ";
232+
: `hue-rotate(${hueRotateValue}turn) `;
238233
}
239234
function invert() {
240235
let invertValue = document.getElementsByName("invert")[0].value;
241-
return invertValue == 0 ? "" : "invert(" + invertValue + ") ";
236+
return invertValue == 0 ? "" : `invert(${invertValue}) `;
242237
}
243238
function opacity() {
244239
let opacityValue = document.getElementsByName("opacity")[0].value;
245-
return opacityValue == 1 ? "" : "opacity(" + opacityValue + ") ";
240+
return opacityValue == 1 ? "" : `opacity(${opacityValue}) `;
246241
}
247242
function saturate() {
248243
let saturateValue = document.getElementsByName("saturate")[0].value;
249-
return saturateValue == 1 ? "" : "saturate(" + saturateValue + ") ";
244+
return saturateValue == 1 ? "" : `saturate(${saturateValue}) `;
250245
}
251246
function sepia() {
252247
let sepiaValue = document.getElementsByName("sepia")[0].value;
253-
return sepiaValue == 0 ? "" : "sepia(" + sepiaValue + ") ";
248+
return sepiaValue == 0 ? "" : `sepia(${sepiaValue})`;
254249
}
255250
</script>
256251
</body>

0 commit comments

Comments
 (0)