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

Compact mode css #11

Merged
merged 2 commits into from
Aug 4, 2023
Merged
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
9 changes: 2 additions & 7 deletions src/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import * as React from "react";
import PlainLink from "./PlainLink";
import PlatformContext, { FormFactor } from "./Platform/PlatformContext";

export default function Home() {
const platformInfo = React.useContext(PlatformContext)

const buttonStyle = platformInfo.formFactor === FormFactor.Wide ? "button" : "button-compact"

return (
<>
<div className="container">
<div className="title">henry.allen</div>
<div className="navigator">
<div className="columns">
<PlainLink to="/pages/projects">
<div className={buttonStyle}>Projects</div>
<div className="button">Projects</div>
</PlainLink>
<PlainLink to="/pages/resume">
<div className={buttonStyle}>Resume</div>
<div className="button">Resume</div>
</PlainLink>
</div>
</div>
Expand Down
39 changes: 19 additions & 20 deletions src/TopBarContainer.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,23 @@
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
padding-top: 10px;
padding-left: 10px;
padding-bottom: 10px;
gap: 20px;
padding-top: 1em;
padding-left: 1em;
padding-bottom: 1em;
gap: 1em;
width: 100%;
}

.top-bar-compact {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding-top: 10px;
padding-left: 10px;
padding-bottom: 10px;
gap: 20px;
width: 100%;
@media (max-width: 50em) {
.top-bar {
justify-content: center;
align-items: center;
}
}

.top-bar-title {
display: flex;
flex-direction: column;
max-width: 574px;
color: rgb(94, 161, 255);
font-size: 32px;
letter-spacing: 0%;
Expand All @@ -44,15 +38,14 @@
.top-bar-button {
display: flex;
flex-direction: row;
max-width: 80px;
justify-content: center;
align-items: center;
border-radius: 12px;
box-shadow: 1px 4px 6px 0px rgba(0, 0, 0, 0.20000000298023224);
padding-top: 5px;
padding-right: 20px;
padding-bottom: 5px;
padding-left: 20px;
padding-top: 0.25em;
padding-right: 1em;
padding-bottom: 0.25em;
padding-left: 1em;
border-color: rgba(255, 255, 255, 1);
border-width: 1px;
border-style: solid;
Expand All @@ -67,4 +60,10 @@
.top-bar-button:hover {
background-color: rgb(183, 213, 255);
border-color: rgb(183, 213, 255);
}

.more-posts {
font-size: 18px;
color: rgba(111, 111, 111, 1);
font-family: "Roboto", sans-serif;
}
3 changes: 1 addition & 2 deletions src/TopBarContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ export default function TopBarContainer() {
const platformInfo = React.useContext(PlatformContext)

const isWideMode = platformInfo.formFactor === FormFactor.Wide
const topBarContainerStyle = isWideMode ? "top-bar" : "top-bar-compact"

return (
<>
<div className="top-bar-container">
<div className={topBarContainerStyle}>
<div className="top-bar">
{
isWideMode ?
<PlainLink to="/">
Expand Down
33 changes: 8 additions & 25 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,14 @@ body {
font-family: "Roboto", sans-serif;
}

.button-compact {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
border-radius: 25px;
box-shadow: 1px 4px 6px 0px rgba(0, 0, 0, 0.20000000298023224);
padding-top: 1em;
padding-right: 5em;
padding-bottom: 1em;
padding-left: 5em;
border-color: rgba(255, 255, 255, 1);
border-width: 1px;
border-style: solid;
background-color: rgba(255, 255, 255, 1);
color: rgba(111, 111, 111, 1);
font-size: 1.5em;
letter-spacing: 0%;
text-align: left;
font-family: "Roboto", sans-serif;
}

.button-compact:hover {
background-color: rgb(183, 213, 255);
border-color: rgb(183, 213, 255);
@media (max-width: 50em) {
.button {
padding-top: 1em;
padding-right: 5em;
padding-bottom: 1em;
padding-left: 5em;
font-size: 1.5em;
}
}

input[type="text"] {
Expand Down