Skip to content

Commit 7c03409

Browse files
estelleteoli2003
andauthored
Apply suggestions from code review
Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com>
1 parent e755c61 commit 7c03409

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

modules/filters.html

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
}, false );
103103
}
104104
document.querySelector("button").addEventListener( "click", () => {
105-
setTimeout(function () {
105+
setTimeout(() => {
106106
changeCSS();
107107
}, 50);
108108
},
@@ -123,58 +123,55 @@
123123
sepia()
124124
);
125125
}
126-
/* blur()*/
126+
127127
function blur() {
128-
let blurValue = document.getElementsByName("blur")[0];
129-
return "blur(" + blurValue.value + "rem) ";
128+
const blurValue = document.getElementsByName("blur")[0];
129+
return `blur(${blurValue.value}rem) `;
130130
}
131-
/* brightness()*/
131+
132132
function brightness() {
133-
let brightnessValue = document.getElementsByName("brightness")[0];
134-
return "brightness(" + brightnessValue.value + ") ";
133+
const brightnessValue = document.getElementsByName("brightness")[0];
134+
return `brightness(${brightnessValue.value}) `;
135135
}
136-
/* contrast()*/
136+
137137
function contrast() {
138-
let contrastValue = document.getElementsByName("contrast")[0];
139-
return "contrast(" + contrastValue.value + ") ";
138+
const contrastValue = document.getElementsByName("contrast")[0];
139+
return `contrast(${contrastValue.value}) `;
140140
}
141-
/* drop-shadow()*/
141+
142142
function dropShadow() {
143-
let dropShadowValue = document.getElementsByName("dropShadow")[0];
144-
return (
145-
"drop-shadow(" + dropShadowValue.value +
146-
"rem " + dropShadowValue.value + "rem " + "0rem orange) "
147-
);
143+
const dropShadowValue = document.getElementsByName("dropShadow")[0];
144+
return `drop-shadow(${dropShadowValue.value}rem ${dropShadowValue.value}rem 0rem orange) `;
148145
}
149-
/* grayscale()*/
146+
150147
function grayscale() {
151-
let grayscaleValue = document.getElementsByName("grayscale")[0];
152-
return "grayscale(" + grayscaleValue.value + ") ";
148+
const grayscaleValue = document.getElementsByName("grayscale")[0];
149+
return `grayscale(${grayscaleValue.value}) `;
153150
}
154-
/* hue-rotate()*/
151+
155152
function hueRotate() {
156-
let hueRotateValue = document.getElementsByName("hueRotate")[0];
157-
return "hue-rotate(" + hueRotateValue.value + "turn) ";
153+
const hueRotateValue = document.getElementsByName("hueRotate")[0];
154+
return `hue-rotate(${hueRotateValue.value}turn) `;
158155
}
159-
/* invert()*/
156+
160157
function invert() {
161-
let invertValue = document.getElementsByName("invert")[0];
162-
return "invert(" + invertValue.value + ") ";
158+
const invertValue = document.getElementsByName("invert")[0];
159+
return `invert(${invertValue.value) `;
163160
}
164-
/* opacity()*/
161+
165162
function opacity() {
166-
let opacityValue = document.getElementsByName("opacity")[0];
167-
return "opacity(" + opacityValue.value + ") ";
163+
const opacityValue = document.getElementsByName("opacity")[0];
164+
return `opacity(${opacityValue.value}) `;
168165
}
169-
/* saturate()*/
166+
170167
function saturate() {
171-
let saturateValue = document.getElementsByName("saturate")[0];
172-
return "saturate(" + saturateValue.value + ") ";
168+
const saturateValue = document.getElementsByName("saturate")[0];
169+
return `saturate(${saturateValue.value}) `;
173170
}
174-
/* sepia()*/
171+
175172
function sepia() {
176-
let sepiaValue = document.getElementsByName("sepia")[0];
177-
return "sepia(" + sepiaValue.value + ") ";
173+
const sepiaValue = document.getElementsByName("sepia")[0];
174+
return `sepia(${sepiaValue.value}) `;
178175
}
179176
</script>
180177
<p>Image by <cite>DigitalNomad</cite></p>

0 commit comments

Comments
 (0)