From 9365e7533b599dbee851166102aa8f9ed89fd460 Mon Sep 17 00:00:00 2001 From: Saakshi Raut Date: Fri, 18 Aug 2023 22:31:39 +0530 Subject: [PATCH] Add triggerEmptyAnimation when input is not provided. --- index.html | 8 +++++--- src/pages/gradient-background.ts | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 158ccd05..4eaac4c1 100644 --- a/index.html +++ b/index.html @@ -587,7 +587,6 @@

placeholder="Tap to pick a color" id="gradient-background-color1" class="gradient-background-inputs" - required /> @@ -598,7 +597,6 @@

placeholder="Tap to pick a color" id="gradient-background-color2" class="gradient-background-inputs" - required /> @@ -641,7 +639,11 @@

Reset
-
+
Get Result
diff --git a/src/pages/gradient-background.ts b/src/pages/gradient-background.ts index 89259556..2139d7ed 100644 --- a/src/pages/gradient-background.ts +++ b/src/pages/gradient-background.ts @@ -12,9 +12,9 @@ import { getCssOrTailwindDropdown, getTailwindButton, getCssOrTailwindButton, - getInputText, } from '../lib/getElements'; import { + triggerEmptyAnimation, copyCSSCodeToClipboard, showPopup, whatColorButtonShouldShow, @@ -25,7 +25,6 @@ import { getColorsValue, closeDropdown, copyTailwindCodeToClipboard, - triggerEmptyAnimation, } from '../lib/packages/utils'; type Values = { @@ -48,10 +47,12 @@ export function gradientBackgroundGenerator( type: 'newResults' | 'oldResults' | null ) { if (type === null) return; - var element = gradientBackgroundInputs[0]; var value = element.value; // Get the value of the input field if (value.length < 3) { + gradientBackgroundInputs.forEach((ele) => { + triggerEmptyAnimation(ele); + }); return; }