Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial styles #36

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20,313 changes: 20,282 additions & 31 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/App.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.App {
isolation: isolate;
}
4 changes: 4 additions & 0 deletions src/components/Character/Character.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.character {
/* Fill the available container height */
height: 100%;
min-height: 500px;
position: fixed;
top: 150px;
right: -30px;
}
112 changes: 55 additions & 57 deletions src/components/CharacterEditor/CharacterEditor.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React from 'react';

import {
defaultSkinColor,
defaultClothesColor,
} from '../../constants';
import { defaultSkinColor, defaultClothesColor } from '../../constants';
import Character from '../Character';
import MaxWidthWrapper from '../MaxWidthWrapper';
import ControlPane from '../ControlPane';
Expand All @@ -24,70 +21,71 @@ function App() {
const [face, setFace] = React.useState(0);
const [accessory, setAccessory] = React.useState(0);
const [skinColor, setSkinColor] = React.useState(defaultSkinColor);
const [clothesColor, setClothesColor] = React.useState(
defaultClothesColor
);
const [clothesColor, setClothesColor] = React.useState(defaultClothesColor);

return (
<main className={styles.characterEditor}>
<div class={styles.perspective}></div>
<MaxWidthWrapper className={styles.maxWidthWrapper}>
<header className={styles.header}>
<h1 className={styles.title}>Create your Character</h1>
<p className={styles.description}>
Customize your character's look and style using the
controls below. What sort of adventure will you embark on?{' '}
Customize your character's look and style using the controls below.
What sort of adventure will you embark on?{' '}
</p>
</header>
<div className={styles.controlColumn}>
<ControlPane
title="Bodies"
options={bodyOptions}
currentOption={body}
handleSelectOption={setBody}
/>
<ControlPane
title="Heads"
options={headOptions}
currentOption={head}
handleSelectOption={setHead}
/>
<ControlPane
title="Faces"
options={faceOptions}
currentOption={face}
handleSelectOption={setFace}
/>
<ControlPane
title="Accessories"
options={accessoryOptions}
currentOption={accessory}
handleSelectOption={setAccessory}
/>
<ControlPane
title="Skin Color"
options={skinColorOptions}
currentOption={skinColor}
handleSelectOption={setSkinColor}
/>
<ControlPane
title="Clothing Color"
options={clothesColorOptions}
currentOption={clothesColor}
handleSelectOption={setClothesColor}
/>
<div>
<div className={styles.controlColumn}>
<ControlPane
title="Bodies"
options={bodyOptions}
currentOption={body}
handleSelectOption={setBody}
/>
<ControlPane
title="Heads"
options={headOptions}
currentOption={head}
handleSelectOption={setHead}
/>
<ControlPane
title="Faces"
options={faceOptions}
currentOption={face}
handleSelectOption={setFace}
/>
<ControlPane
title="Accessories"
options={accessoryOptions}
currentOption={accessory}
handleSelectOption={setAccessory}
/>
<ControlPane
title="Skin Color"
options={skinColorOptions}
currentOption={skinColor}
handleSelectOption={setSkinColor}
/>
<ControlPane
title="Clothing Color"
options={clothesColorOptions}
currentOption={clothesColor}
handleSelectOption={setClothesColor}
/>
</div>

<div className={styles.characterWrapper}>
<Character
body={body}
head={head}
face={face}
accessory={accessory}
skinColor={skinColor}
clothesColor={clothesColor}
/>
</div>
</div>
</MaxWidthWrapper>

<div className={styles.characterWrapper}>
<Character
body={body}
head={head}
face={face}
accessory={accessory}
skinColor={skinColor}
clothesColor={clothesColor}
/>
</div>
</main>
);
}
Expand Down
20 changes: 20 additions & 0 deletions src/components/CharacterEditor/CharacterEditor.module.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
.characterEditor {
position: relative;
padding-top: 128px;
padding-bottom: 64px;
height: 100vh;
overflow: auto;
margin-left: 0;
margin-right: 0;
}

.maxWidthWrapper {
}

.header {
padding-bottom: 64px;
width: 65%;
}

.title {
Expand All @@ -24,7 +30,21 @@
}

.characterWrapper {
display: inline-block;
width: 50%;
}

.controlColumn {
display: inline-block;
width: 50%;
}

/*This gives some perspective look behind the
control panel and the character */
.perspective {
position: fixed;
background-color: hsl(195deg, 20%, 86%);
height: 43%;
width: 100%;
bottom: 0;
}
3 changes: 3 additions & 0 deletions src/components/ControlPane/ControlPane.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
to deal with it yet!
*/
margin-bottom: 32px;
overflow-y: auto;
white-space: nowrap;
position: relative;
}

.title {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Footer/Footer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
text-align: center;
}

.footer > a {
color: white;
}