From a72c04ae60f62922b5052bb94d59e42e92dbacbe Mon Sep 17 00:00:00 2001 From: saml33 Date: Fri, 30 Apr 2021 16:16:02 +1000 Subject: [PATCH] gradient border once submitted --- components/ConnectWalletButton.tsx | 2 +- components/ContributionModal.tsx | 290 ++++++++++++++++------------- tailwind.config.js | 22 ++- 3 files changed, 175 insertions(+), 139 deletions(-) diff --git a/components/ConnectWalletButton.tsx b/components/ConnectWalletButton.tsx index 28419d9..bcefb45 100644 --- a/components/ConnectWalletButton.tsx +++ b/components/ConnectWalletButton.tsx @@ -53,6 +53,6 @@ export const ConnectWalletButtonSmall = ({ children, onClick }) => ( >
{children}
-
+
) diff --git a/components/ContributionModal.tsx b/components/ContributionModal.tsx index 949ef30..d9a1ca7 100644 --- a/components/ContributionModal.tsx +++ b/components/ContributionModal.tsx @@ -13,8 +13,29 @@ import Loading from './Loading' import WalletIcon from './WalletIcon' const StyledModalWrapper = styled.div` - height: 414px; - ${tw`bg-bkg-2 border border-bkg-3 flex flex-col items-center rounded-lg shadow-lg p-7 w-96`} + height: 414px; + ${tw`bg-bkg-2 flex flex-col items-center relative rounded-lg shadow-lg p-7 w-96`} +` +type StyledModalBorderProps = { + animate: boolean +} + +const StyledModalBorder = styled.div` + height: 416px; + width: 386px; + top: -1px; + left: -1px; + z-index: -1; + position: absolute; + + :after { + content: ''; + background-size: 300% 300%; + ${tw`bg-bkg-3 absolute top-0 left-0 right-0 bottom-0 rounded-lg`} + + ${({ animate }) => + animate && + tw`animate-gradient opacity-60 bg-gradient-to-br from-secondary-1-light via-secondary-3-light to-primary-light`} } ` @@ -33,8 +54,6 @@ const ContributionModal = () => { const handleConnectDisconnect = () => { if (connected) { - // setContributionAmount(0) - // setSliderPercentage(0) setSubmitted(false) setEditContribution(false) wallet.disconnect() @@ -95,155 +114,158 @@ const ContributionModal = () => { const disableFormInputs = submitted || !connected || loading return ( - -
- {!submitted && !submitting && !editContribution ? ( - <> -

Plant your seed

-

This is the start of something big.

- - ) : null} +
+ +
+ {!submitted && !submitting && !editContribution ? ( + <> +

Plant your seed

+

This is the start of something big.

+ + ) : null} - {!submitted && submitting ? ( - <> -

Approve the transaction

-

Almost there...

- - ) : null} + {!submitted && submitting ? ( + <> +

Approve the transaction

+

Almost there...

+ + ) : null} - {submitted && !submitting ? ( - <> -

Your contribution amount

-

A new seed planted...

- - ) : null} + {submitted && !submitting ? ( + <> +

Your contribution amount

+

A new seed planted...

+ + ) : null} - {editContribution && !submitting ? ( - <> -

Funds unlocked

-

Increase or reduce your contribution...

- - ) : null} -
- {submitting ? ( -
- + {editContribution && !submitting ? ( + <> +

Funds unlocked

+

Increase or reduce your contribution...

+ + ) : null}
- ) : ( - <> -
-
-
- - {connected ? ( - loading ? ( -
+ {submitting ? ( +
+ +
+ ) : ( + <> +
+
+
+ + {connected ? ( + loading ? ( +
+ ) : ( + + {usdcBalance} + + ) ) : ( - - {usdcBalance} - - ) - ) : ( - '----' - )} - -
-
- {submitted ? ( + '----' + )} + +
+
+ {submitted ? ( + + ) : null} +
+
+
+ {submitted ? ( + ) : null} -
+
+
+ onChangeSlider(v)} + step={1} + maxButtonTransition={maxButtonTransition} + /> +
+
-
- {submitted ? ( - - ) : null} - {editContribution ? ( - - ) : null} - onChangeAmountInput(e.target.value)} - value={loading ? '' : contributionAmount} - suffix="USDC" - /> -
-
-
- onChangeSlider(v)} - step={1} - maxButtonTransition={maxButtonTransition} - /> -
+ {connected ? ( -
-
- {connected ? ( - - ) : ( - -
- - Connect Wallet -
-
- )} - - )} - + ) : ( + +
+ + Connect Wallet +
+
+ )} + + )} + + +
) } diff --git a/tailwind.config.js b/tailwind.config.js index 8e7146b..8facae2 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -19,6 +19,7 @@ module.exports = { primary: { light: '#F2C94C', dark: '#EEB91B' }, 'secondary-1': { light: '#AFD803', dark: '#6CBF00' }, 'secondary-2': { light: '#E54033', dark: '#C7251A' }, + 'secondary-3': { light: '#026DF7', dark: '#0259CA' }, 'bkg-1': '#141125', 'bkg-2': '#242132', 'bkg-3': '#393549', @@ -29,13 +30,26 @@ module.exports = { 'fgd-4': '#706C81', }, animation: { - 'ping-small': 'ping-small 1.5s cubic-bezier(0, 0, 0.2, 1) infinite', + 'connect-wallet-ping': + 'connect-wallet-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite', + gradient: 'gradient 4s ease-in-out infinite', }, keyframes: { - 'ping-small': { + 'connect-wallet-ping': { '75%, 100%': { - transform: 'scale(1.06, 1.25)', - opacity: 0, + transform: 'scale(1.06, 1.3)', + opacity: '10%', + }, + }, + gradient: { + '0%': { + 'background-position': '15% 0%', + }, + '50%': { + 'background-position': '85% 100%', + }, + '100%': { + 'background-position': '15% 0%', }, }, },