Skip to content
Snippets Groups Projects
Commit 4ebc81f1 authored by Gabriel Clark's avatar Gabriel Clark
Browse files

Added a card class. Finished basic css.

parent 2f66dcb7
No related branches found
No related tags found
No related merge requests found
...@@ -2,16 +2,25 @@ import { Route } from 'react-router-dom'; ...@@ -2,16 +2,25 @@ import { Route } from 'react-router-dom';
import { EndingNumberOutput } from './features/ending-number-output/endingNumberOutput.js'; import { EndingNumberOutput } from './features/ending-number-output/endingNumberOutput.js';
import { NumberInputField } from './features/number-input-field/numberInputField.js'; import { NumberInputField } from './features/number-input-field/numberInputField.js';
import { UnitSelector } from './features/unit-selector/unitSelector.js'; import { UnitSelector } from './features/unit-selector/unitSelector.js';
import { Card } from './features/card/card.js';
export function App() { export function App() {
return ( return (
<> <>
<Route exact path={'/'}> <Route exact path={'/'}>
</Route> </Route>
<Card title="Input Unit Selector">
<UnitSelector type="Input"/> <UnitSelector type="Input"/>
</Card>
<Card title="Number Input">
<NumberInputField /> <NumberInputField />
</Card>
<Card title="Output Unit Selector">
<UnitSelector type="Output"/> <UnitSelector type="Output"/>
</Card>
<Card title="Number Output">
<EndingNumberOutput /> <EndingNumberOutput />
</Card>
</> </>
); );
} }
.card {
display: flex;
justify-content: space-around;
align-items: center;
margin: 20px;
min-height: 20%;
border-radius: 10px;
background-color: rgba(255 255 255 / 90%);
box-shadow:
0 2.8px 2.2px rgba(0 0 0 / 3.4%),
0 6.7px 5.3px rgba(0 0 0 / 4.8%),
0 12.5px 10px rgba(0 0 0 / 6%),
0 22.3px 17.9px rgba(0 0 0 / 7.2%),
0 41.8px 33.4px rgba(0 0 0 / 8.6%),
0 100px 80px rgba(0 0 0 / 12%);
}
.inputField {
max-width: 75%;
}
import PropTypes from 'prop-types';
import './card.css';
export function Card(props) {
Card.propTypes = {
title: PropTypes.string.isRequired,
};
return (
<div className="card">
<h1>{props.title}</h1>
<div>
{props.children}
</div>
</div>
);
}
...@@ -12,16 +12,9 @@ export function NumberInputField() { ...@@ -12,16 +12,9 @@ export function NumberInputField() {
dispatch(setNumberOfUnits(currentNumber)); dispatch(setNumberOfUnits(currentNumber));
} }
function handleSubmit(e) {
e.preventDefault();
}
return ( return (
<div> <div>
<form onSubmit={handleSubmit}> <input className="inputField" type="text" placeholder={ placeHolderString } onChange={handleChange}/>
<h1>Number Input Field</h1>
<input type="text" placeholder={ placeHolderString } onChange={handleChange}/>
</form>
</div> </div>
); );
} }
...@@ -59,7 +59,6 @@ export function UnitSelector(props) { ...@@ -59,7 +59,6 @@ export function UnitSelector(props) {
return ( return (
<div> <div>
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
<h1>{props.type} Unit Selector</h1>
<div className="select-container"> <div className="select-container">
<select name="units" onChange={handleChange}> <select name="units" onChange={handleChange}>
{unitSelectorOptions.map((option) => {unitSelectorOptions.map((option) =>
......
:root { :root {
/* Colors */ /* Colors */
--letterbox-color: rgba(0 0 0 / 100%); --letterbox-color: rgba(255 255 255 / 100%);
--app-background-color: rgba(239 239 239 / 100%); --app-background-color: rgba(101 142 156 / 100%);
--font-color: rgba(0 0 0 / 100%); --font-color: rgba(0 0 0 / 100%);
/* Sizes */ /* Sizes */
--minimum-app-size: 300px; --minimum-app-size: 300px;
} }
* {
font-size: 1.05em;
}
body { body {
margin: 0; margin: 0;
font-family: sans-serif; font-family: sans-serif;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment