|
203 | 203 | } |
204 | 204 | function blur() { |
205 | 205 | let blurValue = document.getElementsByName("blur")[0].value; |
206 | | - return blurValue == "0" ? "" : "blur(" + blurValue + "rem) "; |
| 206 | + return blurValue == "0" ? "" : `blur(${blurValue}rem) `; |
207 | 207 | } |
208 | 208 | function brightness() { |
209 | 209 | let brightnessValue = document.getElementsByName("brightness")[0].value; |
210 | 210 | return brightnessValue.toString() === "1" |
211 | 211 | ? "" |
212 | | - : "brightness(" + brightnessValue + ") "; |
| 212 | + : `brightness(${brightnessValue}) `; |
213 | 213 | } |
214 | 214 | function contrast() { |
215 | 215 | let contrastValue = document.getElementsByName("contrast")[0].value; |
216 | | - return contrastValue == 1 ? "" : "contrast(" + contrastValue + ") "; |
| 216 | + return contrastValue == 1 ? "" : `contrast(${contrastValue}) `; |
217 | 217 | } |
218 | 218 | function dropShadow() { |
219 | 219 | let dropShadowValue = document.getElementsByName("dropShadow")[0].value; |
220 | 220 | return dropShadowValue == 0 |
221 | 221 | ? "" |
222 | | - : "drop-shadow(" + |
223 | | - dropShadowValue + |
224 | | - "rem " + |
225 | | - dropShadowValue + |
226 | | - "rem " + |
227 | | - "0rem orange) "; |
| 222 | + : `drop-shadow(${dropShadowValue}rem ${dropShadowValue}rem 0rem orange) `; |
228 | 223 | } |
229 | 224 | function grayscale() { |
230 | 225 | let grayscaleValue = document.getElementsByName("grayscale")[0].value; |
231 | | - return grayscaleValue == 0 ? "" : "grayscale(" + grayscaleValue + ") "; |
| 226 | + return grayscaleValue == 0 ? "" : `grayscale(${grayscaleValue}) `; |
232 | 227 | } |
233 | 228 | function hueRotate() { |
234 | 229 | let hueRotateValue = document.getElementsByName("hueRotate")[0].value; |
235 | 230 | return hueRotateValue == 0 |
236 | 231 | ? "" |
237 | | - : "hue-rotate(" + hueRotateValue + "turn) "; |
| 232 | + : `hue-rotate(${hueRotateValue}turn) `; |
238 | 233 | } |
239 | 234 | function invert() { |
240 | 235 | let invertValue = document.getElementsByName("invert")[0].value; |
241 | | - return invertValue == 0 ? "" : "invert(" + invertValue + ") "; |
| 236 | + return invertValue == 0 ? "" : `invert(${invertValue}) `; |
242 | 237 | } |
243 | 238 | function opacity() { |
244 | 239 | let opacityValue = document.getElementsByName("opacity")[0].value; |
245 | | - return opacityValue == 1 ? "" : "opacity(" + opacityValue + ") "; |
| 240 | + return opacityValue == 1 ? "" : `opacity(${opacityValue}) `; |
246 | 241 | } |
247 | 242 | function saturate() { |
248 | 243 | let saturateValue = document.getElementsByName("saturate")[0].value; |
249 | | - return saturateValue == 1 ? "" : "saturate(" + saturateValue + ") "; |
| 244 | + return saturateValue == 1 ? "" : `saturate(${saturateValue}) `; |
250 | 245 | } |
251 | 246 | function sepia() { |
252 | 247 | let sepiaValue = document.getElementsByName("sepia")[0].value; |
253 | | - return sepiaValue == 0 ? "" : "sepia(" + sepiaValue + ") "; |
| 248 | + return sepiaValue == 0 ? "" : `sepia(${sepiaValue})`; |
254 | 249 | } |
255 | 250 | </script> |
256 | 251 | </body> |
|
0 commit comments