Skip to content

Commit

Permalink
Merge pull request #11 from hmallen99/compact-mode-css
Browse files Browse the repository at this point in the history
Compact mode css
  • Loading branch information
hmallen99 authored Aug 4, 2023
2 parents f12333b + 2d4bc67 commit d4eea23
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 54 deletions.
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

0 comments on commit d4eea23

Please sign in to comment.