Skip to content

Commit

Permalink
About page
Browse files Browse the repository at this point in the history
  • Loading branch information
printerscanner committed Mar 26, 2024
1 parent b3f9f81 commit a8b57c6
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/components/ColorPicker.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import "../css/components/ColorPicker.css";

function ColorPicker({ onColorChange }) {
function ColorPicker({ onColorChange, text }) {
const handleColorClick = (color) => {
onColorChange(color);
};

return (
<div>
<h4>Color</h4>
<h4>{text}</h4>
<div className="ColorPicker">
<div className="ColorPicker__option" style={{ backgroundColor: '#00D03B' }} onClick={() => handleColorClick('#00D03B')}></div>
<div className="ColorPicker__option" style={{ backgroundColor: '#FF4141' }} onClick={() => handleColorClick('#FF4141')}></div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/FontDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function FontDemo(props) {
onChange={setKerning}
step={1}
/>
<ColorPicker onColorChange={handleColorChange} />
<ColorPicker onColorChange={handleColorChange} text={"Color"} />
<br />
{props.showDownload && <a className="button corner-button" href={`/fonts/${props.link}`}>Download ➬</a>}
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/css/elements/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

.button:hover {
background-color: var(--button-hover);
border-bottom-left-radius: 15px;
border-color: transparent;
}


Expand Down
22 changes: 14 additions & 8 deletions src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ a,u {
font-style: italic;
}

p {
font-size: 1.1rem;
}

.logo {
margin: 0;
text-transform: uppercase;
Expand All @@ -75,6 +79,16 @@ a,u {
flex-basis: 50%;
}

.main {
display: flex;
flex-direction: column;
align-items: center;
max-width: 900px;
margin: auto;
margin-top: 2rem;
}


/* Misc Pages CSS */

.Detail {
Expand All @@ -84,13 +98,6 @@ a,u {
padding: 1rem;
}

.FourOhFour__main {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 2rem;
}


.FourOhFour__emoji {
font-size: 18rem;
Expand All @@ -109,4 +116,3 @@ a,u {
transform: rotate(360deg);
}
}

5 changes: 5 additions & 0 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
RouterProvider,
} from "react-router-dom";
import Home from './pages/Home.jsx'
import About from './pages/About.jsx'
import Footer from './layouts/Footer.jsx'
import Header from './layouts/Header.jsx'
import FontDetail from './pages/Detail.jsx'
Expand All @@ -16,6 +17,10 @@ const router = createBrowserRouter([
path: "/",
element: <Home />,
},
{
path: "/about",
element: <About />,
},
{
path: "fonts/:id",
element: <FontDetail />,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/404.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function FourOhFour() {
return (
<article>
<div className="FourOhFour__main">
<div className="main">
<h1>404</h1>
<p>It seems like the page you’re looking for doesn’t exist.</p>
<a href="/" className="button">Head Home</a>
Expand Down
26 changes: 26 additions & 0 deletions src/pages/About.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import ColorPicker from '../components/ColorPicker.jsx';
import { useState } from 'react';



function About() {
const [textColor, setTextColor] = useState('#000000');

const handleColorChange = (color) => {
setTextColor(color);
};

return (
<div className="main About">
<ColorPicker onColorChange={handleColorChange} />
<h1
style={{
color: textColor,
}}>About</h1>
<p>Mother Type is an open source type foundry.</p>
</div>

);
}

export default About;
4 changes: 2 additions & 2 deletions src/pages/Detail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Font({ fontData }) {
writing_systems = "N/A",
license = "N/A",
published = "N/A",
project_url,
repository_url,
} = typeface_family || {};

return (
Expand All @@ -81,7 +81,7 @@ function Font({ fontData }) {
<a className="button" href={`https://github.com/mother-type/${name}/raw/main/fonts/${name}.zip`} download>
<u>Download Specimen ➬</u>
</a>
<a className={project_url ? "button" : "hidden"} href={project_url || "#"}>
<a className={repository_url ? "button" : "hidden"} href={repository_url || "#"}>
<u>Source Files</u>
</a>
</div>
Expand Down

0 comments on commit a8b57c6

Please sign in to comment.