From 0b629eb14ba47614fb3ea0a9069f6edf64354d64 Mon Sep 17 00:00:00 2001 From: Mentor Palokaj Date: Sat, 27 Nov 2021 17:26:13 +0100 Subject: [PATCH] Basic outfit styling without css dependencies --- minter/src/components/atoms/Avatar.js | 8 +++++ minter/src/components/atoms/Container.js | 3 +- minter/src/components/atoms/Section.js | 12 +++++++ minter/src/components/atoms/Text.js | 2 +- minter/src/components/atoms/Theme.js | 4 +-- minter/src/components/molecules/Hero.js | 20 +++++++++++ minter/src/components/organisms/Outfits.js | 39 +++++++++++++--------- 7 files changed, 69 insertions(+), 19 deletions(-) create mode 100644 minter/src/components/atoms/Avatar.js create mode 100644 minter/src/components/atoms/Section.js create mode 100644 minter/src/components/molecules/Hero.js diff --git a/minter/src/components/atoms/Avatar.js b/minter/src/components/atoms/Avatar.js new file mode 100644 index 0000000..724cf8d --- /dev/null +++ b/minter/src/components/atoms/Avatar.js @@ -0,0 +1,8 @@ +import styled from 'styled-components' + +export default styled.img` + border-radius: 50%; + height: 200px; + width: 200px; + padding: 1rem; +` \ No newline at end of file diff --git a/minter/src/components/atoms/Container.js b/minter/src/components/atoms/Container.js index 321ad87..e3b4862 100644 --- a/minter/src/components/atoms/Container.js +++ b/minter/src/components/atoms/Container.js @@ -3,7 +3,7 @@ import styled from 'styled-components' // Image that behaves like a background image import LaunchBackground from '../../assets/undraw_launch_day_4e04.svg' const BackgroundImage = styled.img.attrs( props => ( { - src: LaunchBackground + // src: LaunchBackground } ) )` position: absolute; z-index: -1; @@ -25,6 +25,7 @@ const Wrapper = styled.div` min-height: 100vh; width: 100%; padding: 0 max( 1rem, calc( 25vw - 4rem ) ); + margin-bottom: 10rem; box-sizing: border-box; & * { box-sizing: border-box; diff --git a/minter/src/components/atoms/Section.js b/minter/src/components/atoms/Section.js new file mode 100644 index 0000000..1d7dea6 --- /dev/null +++ b/minter/src/components/atoms/Section.js @@ -0,0 +1,12 @@ +import styled from 'styled-components' + +export default styled.section` + padding: 1rem 0; + display: flex; + flex-direction: ${ ( { direction } ) => direction || 'column' }; + width: ${ ( { width } ) => width || '100%' }; + max-width: 100%; + flex-wrap: wrap; + align-items: ${ ( { align } ) => align || 'center' }; + justify-content: ${ ( { justify } ) => justify || 'center' }; +` \ No newline at end of file diff --git a/minter/src/components/atoms/Text.js b/minter/src/components/atoms/Text.js index 080e890..9c8218c 100644 --- a/minter/src/components/atoms/Text.js +++ b/minter/src/components/atoms/Text.js @@ -23,7 +23,7 @@ export const H2 = styled.h2` line-height: 1.2; font-weight: 400; text-align: ${ ( { align } ) => align || 'left' }; - color: ${ ( { theme } ) => theme.colors.accent }; + color: ${ ( { theme } ) => theme.colors.primary }; ` export const Sidenote = styled.p` diff --git a/minter/src/components/atoms/Theme.js b/minter/src/components/atoms/Theme.js index b0df7b0..7c8980d 100644 --- a/minter/src/components/atoms/Theme.js +++ b/minter/src/components/atoms/Theme.js @@ -3,8 +3,8 @@ import { ThemeProvider } from 'styled-components' const theme = { colors: { - primary: 'teal', - text: 'rgb(77, 86, 128)', + primary: 'black', + text: 'rgb( 0, 0, 0, .8 )', accent: 'orange', hint: 'rgba( 0, 0, 0, .4 )', backdrop: 'rgba( 0, 0, 0, .05 )' diff --git a/minter/src/components/molecules/Hero.js b/minter/src/components/molecules/Hero.js new file mode 100644 index 0000000..a9a2004 --- /dev/null +++ b/minter/src/components/molecules/Hero.js @@ -0,0 +1,20 @@ +import styled from 'styled-components' +import Section from '../atoms/Section' + +export default styled( Section )` + width: 100%; + min-height: 500px; + align-items: flex-start; + border-bottom: 2px solid ${ ( { theme } ) => theme.colors.primary }; + margin-bottom: 5rem; + & h1 { + margin-bottom: .5rem; + text-align: left; + } + & * { + max-width: 700px; + } + & p { + margin: 0 0 4rem; + } +` \ No newline at end of file diff --git a/minter/src/components/organisms/Outfits.js b/minter/src/components/organisms/Outfits.js index f2dfdf6..16b180b 100644 --- a/minter/src/components/organisms/Outfits.js +++ b/minter/src/components/organisms/Outfits.js @@ -5,10 +5,15 @@ import { useChainId, useAddress, sign } from '../../modules/web3' import { log } from '../../modules/helpers' import { useParams, useNavigate } from 'react-router' -import { H1, Text } from '../atoms/Text' -import Button from '../atoms/Button' -import Loading from '../molecules/Loading' import Container from '../atoms/Container' +import Section from '../atoms/Section' +import { H1, H2, Text } from '../atoms/Text' +import Button from '../atoms/Button' +import Avatar from '../atoms/Avatar' + + +import Loading from '../molecules/Loading' +import Hero from '../molecules/Hero' export default function Verifier() { @@ -159,41 +164,45 @@ export default function Verifier() {

Rocketeers

Click on a Rocketeer to manage it's outfits -
+
{ rocketeers.map( ( { id, image } ) => { - return navigate( `/outfits/${ id }` ) } key={ id } className='rocketeer' src={ image } alt={ `Rocketeer number ${ id }` } /> + return navigate( `/outfits/${ id }` ) } key={ id } src={ image } alt={ `Rocketeer number ${ id }` } /> } ) } Rocketeers owned by: { address }. -
+ // Changing room if( rocketeer ) return -

{ rocketeer.name }

+ +

{ rocketeer.name }

- { - { !rocketeer.new_outfit_available ? : New outfit available on { rocketeer.when_new_outfit.toString() } } + + { rocketeer.new_outfit_available ? : New outfit available on { rocketeer.when_new_outfit.toString() } } + +
+ + +

{ rocketeer.name.split( ' ' )[0] }'s outfits

This Rocketeer has { 1 + rocketeer.outfits } outfits. { rocketeer.outfits > 0 && 'Click any outfit to select it as primary.' } +
-
- - setPrimaryOutfit( 0 ) } className='rocketeer' src={ rocketeer.image.replace( /-\d\.jpg/, '.jpg' ) } alt={ `Rocketeer number ${ rocketeer.id }` } /> + setPrimaryOutfit( 0 ) } src={ rocketeer.image.replace( /-\d\.jpg/, '.jpg' ) } alt={ `Rocketeer number ${ rocketeer.id }` } /> { Array.from( Array( rocketeer.outfits ) ).map( ( val, i ) => { - return setPrimaryOutfit( i + 1 ) } key={ rocketeer.id + i } className='rocketeer' src={ rocketeer.image.replace( /-\d\.jpg/, `-${ i + 1 }.jpg` ) } alt={ `Rocketeer number ${ rocketeer.id }` } /> + return setPrimaryOutfit( i + 1 ) } key={ rocketeer.id + i } src={ rocketeer.image.replace( /-\d\.jpg/, `-${ i + 1 }.jpg` ) } alt={ `Rocketeer number ${ rocketeer.id }` } /> } ) } -
+
- Rocketeers owned by: { address }.