diff --git a/web/e.cash/components/button/index.js b/web/e.cash/components/button/index.js new file mode 100644 --- /dev/null +++ b/web/e.cash/components/button/index.js @@ -0,0 +1,48 @@ +import Link from 'next/link'; +import { ButtonCtn } from './styles.js'; + +// Button accepts color prop values of 'accent', 'white'. It defaults to the primary theme color +// The corner prop will clip the corner of the button. Starting from top left, 1,2,3, or 4 are accepted props + +export default function Button({ + text = 'Button', + link = '/', + corner = null, + color = null, + glow = false, +}) { + const corners = { + 1: { + outer: 'polygon(20px 0, 100% 0, 100% 100%, 0 100%, 0 20px)', + inner: 'polygon(19px 0, 100% 0, 100% 100%, 0 100%, 0 19px)', + }, + 2: { + outer: 'polygon(0 0, calc(100% - 20px) 0%, 100% calc(0% + 20px), 100% 100%, 0 100%)', + inner: 'polygon(0 0, calc(100% - 19px) 0%, 100% calc(0% + 19px), 100% 100%, 0 100%)', + }, + 3: { + outer: 'polygon(100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 0', + inner: 'polygon(100% 0, 100% calc(100% - 19px), calc(100% - 19px) 100%, 0 100%, 0 0', + }, + 4: { + outer: 'polygon(100% 0, 100% 100%, 20px 100%, 0 calc(100% - 20px), 0 0', + inner: 'polygon(100% 0, 100% 100%, 19px 100%, 0 calc(100% - 19px), 0 0', + }, + }; + return ( + + +
+ {text} +
+ +
+ ); +} diff --git a/web/e.cash/components/button/styles.js b/web/e.cash/components/button/styles.js new file mode 100644 --- /dev/null +++ b/web/e.cash/components/button/styles.js @@ -0,0 +1,82 @@ +import styled from 'styled-components'; +import { stealth } from '/styles/theme'; + +export const ButtonCtn = styled.div` + ${props => + props.glow && + `filter: drop-shadow(0px 0px 10px ${ + props.color === 'accent' + ? props.theme.colors.accent + '90' + : props.color === 'white' + ? props.theme.colors.contrast + '90' + : props.theme.colors.primaryLight + '90' + });`} + + .button { + display: inline-flex; + padding: 2px; + align-items: center; + transition: all 300ms ease-in-out; + color: ${props => + props.color === 'accent' + ? props.theme.colors.accent + : props.color === 'white' + ? props.theme.colors.contrast + : props.theme.colors.primaryLight}; + font-size: 15px; + line-height: 1.5; + font-weight: 400; + letter-spacing: 1px; + background-color: ${props => + props.color === 'accent' + ? props.theme.colors.accent + : props.color === 'white' + ? props.theme.colors.contrast + : props.theme.colors.primaryLight}; + ${props => + props.theme === stealth + ? 'background-color: #fff !important; color: #fff !important; ' + : null}; + } + + .buttoninner { + background-color: ${props => props.theme.colors.darkBlue}; + padding: 16px 40px; + font-size: 15px; + line-height: 1.5; + font-weight: 500; + letter-spacing: 1px; + transition: all ease-in-out 150ms; + } + + .buttoninner:hover { + box-shadow: inset 0 0 13px 2px + ${props => + props.color === 'accent' + ? props.theme.colors.accent + '90' + : props.color === 'white' + ? props.theme.colors.contrast + '90' + : props.theme.colors.primaryLight + '90'}; + animation: hoverbutton 150ms ease-in-out 1; + } + + @keyframes hoverbutton { + 0% { + background-color: ${props => + props.color === 'accent' + ? props.theme.colors.accent + : props.color === 'white' + ? props.theme.colors.contrast + : props.theme.colors.primaryLight} !important; + } + 100% { + background-color: unset; + } + } + ${props => props.theme.breakpoint.medium} { + .buttoninner { + padding: 14px 30px; + font-size: 14px; + } + } +`; diff --git a/web/e.cash/pages/index.js b/web/e.cash/pages/index.js --- a/web/e.cash/pages/index.js +++ b/web/e.cash/pages/index.js @@ -5,6 +5,7 @@ import GlitchText from '/components/glitch-text'; import { socials } from '/data/socials'; import { Hero } from '/styles/pages/homepage'; +import Button from '/components/button'; export default function Home() { return ( @@ -22,6 +23,14 @@ Experience the revolutionary new money powered by Avalanche.

+
+
{socials.map(social => (