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

[FEATURE]: staging to production merge #70

Merged
merged 34 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7d61232
chore / replace-vitest-with-jest (#1)
slackermorris Apr 30, 2022
d643639
feature / initial-integration-of-notion-cms (#2)
slackermorris May 21, 2022
56e412d
feature / link to and implement render content of individual braindum…
slackermorris Dec 4, 2022
d573d3e
[FEATURE]: establish error boundaries for layout routes (#14)
slackermorris Dec 4, 2022
2ac186c
[FIX]: correct ci/cd pipeline (#17)
slackermorris Dec 11, 2022
fbe4358
[FIX]: limit typescript compiler to app directory to resolve conflict…
slackermorris Dec 22, 2022
d71d7c5
feature: updated arc file to include stack name and deployed to region
slackermorris Dec 23, 2022
e4ebd1f
chore: run CI/CD pipeline when pushing on this branch
slackermorris Dec 23, 2022
e7f7821
[FIX]: remove unused loader from braindump index--was causing issues …
slackermorris Jan 12, 2023
6c08163
feature: deploy to staging environment
slackermorris Jan 12, 2023
3bad39f
feature: deploy to staging environment with NOTION CRM env vars (#29)
slackermorris Jan 14, 2023
3866c05
[feature]: fallback page for mobile devices; customising tailwind sty…
slackermorris Feb 4, 2023
b193bdf
[fix]: css syntax error "text-xl" wrongly configured (#33)
slackermorris Feb 4, 2023
52b94d8
fix: layout was completely janked
slackermorris Feb 5, 2023
d4b9801
fix: eslint issues taken care of (#34)
slackermorris Feb 5, 2023
e767f7e
delete server directory
slackermorris Feb 5, 2023
0d2e2ed
[chore]: cleanup eslint warnings + remove `server` dir from source co…
slackermorris Feb 5, 2023
c404c1d
[feature]: write copy for website (#38)
slackermorris Feb 11, 2023
6fe6819
[fix]: repairing page navigation so we don't land on mobile only page…
slackermorris Feb 16, 2023
49ed07a
[fix]: late content fetching causes layout shifts (#42)
slackermorris Feb 18, 2023
b0c19c1
fix: some better styling choices; removed some content; page does not…
slackermorris Feb 21, 2023
bd4af12
feature: content page styling fixed, need to do something about the r…
slackermorris Mar 2, 2023
093226e
[FEATURE]: remove the "references" title from the content page... wil…
slackermorris Mar 2, 2023
3761c84
Merge branch 'master' of https://github.com/slackermorris/better-brai…
slackermorris Mar 3, 2023
a30a850
feature: deploy production off of master branch
slackermorris Mar 3, 2023
f9f4325
feature: actually specify cache control headers, especially for the b…
slackermorris Mar 5, 2023
7a53cdc
feature: preload fonts so we can avoid layout jankiness when they eve…
slackermorris Mar 7, 2023
b00cd71
[FEATURE]: add page transitions (#62)
slackermorris Mar 18, 2023
d00fa86
[FEATURE]: using sessionStorage only run content animation on FIRST p…
slackermorris Mar 18, 2023
bc5a5b3
[FEATURE]: improve user experience (slow 3G) with page transitions wh…
slackermorris Mar 19, 2023
2d42295
[FEATURE]: page transitions when first data fetching slow 3 g improve…
slackermorris Mar 23, 2023
9313442
chore: fixing merge conflicts up between this and master
slackermorris Mar 23, 2023
e580281
chore: fixing merge conflicts up between this and master
slackermorris Mar 23, 2023
4da9bd5
fix: linting issues redeclarations
slackermorris Mar 23, 2023
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
1 change: 1 addition & 0 deletions app/components/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import classNames from "classnames";
import type { PropsWithChildren } from "react";

Expand Down
30 changes: 23 additions & 7 deletions app/components/pageTransition/FlowerBlobTransition.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect, useState } from "react";
import classNames from "classnames";
import anime from "animejs";

import type { PropsWithChildren } from "react";
Expand Down Expand Up @@ -53,11 +52,32 @@ const DOM_NODES = Object.freeze({

const FlowerBlobTransition = ({
children,
styleProps,
}: PropsWithChildren<{ styleProps?: Array<string> }>) => {
animationKey,
classNamesProp,
}: PropsWithChildren<{
animationKey: string;
classNamesProp?: Array<string>;
}>) => {
const [showAnimationContent, setShowAnimationContent] = useState(true);

useEffect(() => {
/* 1. only play the animation if this if the first time the page has loaded */
if (typeof window !== "undefined") {
const animationHasPlayed = window.sessionStorage.getItem(
`flowerBlobTransition-${animationKey}`
);

if (animationHasPlayed === "true") {
setShowAnimationContent(false);
} else {
window.sessionStorage.setItem(
`flowerBlobTransition-${animationKey}`,
"true"
);
}
}

/* 2. instantiate the animation */
const domNodes = {};

domNodes["svg"] = document.querySelector("svg");
Expand All @@ -82,10 +102,8 @@ const FlowerBlobTransition = ({
easing: "easeInOutQuad",
});

// todo: have a delay and then state update to remove the stuff from the DOM
setTimeout(() => {
// todo: determine a more accurate animation delay time (should be a composite)
// todo: think about running the state update after removing the bindings

/* 1. remove animejs bindings */
anime.remove(domNodes["path"]);
Expand All @@ -94,8 +112,6 @@ const FlowerBlobTransition = ({
/* 2. through a conditional render, don't show the animation content */
setShowAnimationContent(false);
}, 5000);

// todo: cleanup function to remove the binding to animejs
}, []);

return (
Expand Down
23 changes: 23 additions & 0 deletions app/components/pageTransition/GradientMapTransition.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from "react";
import type { PropsWithChildren } from "react";
import { useTransition } from "@remix-run/react";
import classNames from "classnames";

const GradientMapTransition = ({
children,
classNameProps,
}: PropsWithChildren<{ classNameProps?: Array<string> }>) => {
const transition = useTransition();

if (transition.state === "loading") {
return (
<div className={classNames(classNameProps?.join(" "))}>
<div className="h-full w-full animate-ping bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-rose-100 to-teal-100" />
</div>
);
}

return <>{children}</>;
};

export default GradientMapTransition;
12 changes: 9 additions & 3 deletions app/components/pageTransition/MorphingTransition.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React, { useEffect } from "react";
import classNames from "classnames";
import anime from "animejs";

import type { PropsWithChildren } from "react";

const MorphingTransition = ({
children,
styleProps,
}: PropsWithChildren<{ styleProps?: Array<string> }>) => {
classNameProps,
}: PropsWithChildren<{ classNameProps?: Array<string> }>) => {
useEffect(() => {
const domNodes = {};

Expand All @@ -33,6 +32,13 @@ const MorphingTransition = ({
easing: "easeOutQuad",
d: domNodes["path"].getAttribute("pathdata:id"),
});

return () => {
/* 1. remove animejs bindings */
anime.remove(domNodes["introduction"]);
anime.remove(domNodes["shape"]);
anime.remove(domNodes["path"]);
};
}, []);

return (
Expand Down
7 changes: 6 additions & 1 deletion app/components/pageTransition/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import MorphingTransition from "./MorphingTransition";
import FlowerBlobTransition from "./FlowerBlobTransition";
import GradientMapTransition from "./GradientMapTransition";

export { MorphingTransition, FlowerBlobTransition };
export default {
MorphingTransition,
FlowerBlobTransition,
GradientMapTransition,
};
17 changes: 10 additions & 7 deletions app/routes/braindumps.list.$braindumpId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import { useLoaderData } from "@remix-run/react";
import notionClient from "~/integrations/notion";

//? COMPONENTS
import ImageContainer from "~/components/ImageContainer";
import Paragraph from "~/components/Paragraph";
import A from "~/components/A";
import Title from "~/components/Title";
import CodeBlock from "~/components/CodeBlock";
import A from "~/components/A";
import { FlowerBlobTransition } from "~/components/pageTransition";
import Paragraph from "~/components/Paragraph";
import { PillButton } from "~/components/button";
import ImageContainer from "~/components/ImageContainer";
import PageTransition from "~/components/pageTransition";

//? TYPES
import type { PropsWithChildren } from "react";
import type { GetBlockResponse } from "@notionhq/client/build/src/api-endpoints";

//? STYLES
import styles from "highlight.js/styles/base16/zenburn.css";
import { PillButton } from "~/components/button";

export const loader = async ({
params,
Expand Down Expand Up @@ -193,7 +193,10 @@ export default function BraindumpIndex() {

return (
<div className="relative">
<FlowerBlobTransition>
<PageTransition.FlowerBlobTransition
key={braindumpMeta["id"]}
animationKey={braindumpMeta["id"]}
>
<div className="bg-pink pt-24">
<InnerLayout>
{Header}
Expand All @@ -203,7 +206,7 @@ export default function BraindumpIndex() {
</div>
</InnerLayout>
</div>
</FlowerBlobTransition>
</PageTransition.FlowerBlobTransition>
</div>
);
}
Expand Down
21 changes: 15 additions & 6 deletions app/routes/braindumps/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React from "react";
import { Link } from "@remix-run/react";

//? components
import Title from "~/components/Title";
import Layout from "~/components/Layout";
import { AnimatedButton } from "~/components/button";
import { Link } from "@remix-run/react";
import PageTransition from "~/components/pageTransition";

const Introduction = () => {
//! NB: h-[calc(100vh-4rem)] needed to explicitly set the height otherwise we get scrollbars
//! https://github.com/slackermorris/better-brain-blogging/issues/10#issuecomment-1437429507
return (
<div className="flex h-[calc(100vh-4rem)] w-2/3">
<Layout.FullHeight classNameProp={["w-2/3"]}>
<div className="flex flex-col space-y-32 p-16">
<Title.H3>
Inside is a collection of braindumps. These are things I have tried to
Expand All @@ -25,10 +28,16 @@ const Introduction = () => {
</Link>
</div>
</div>
</div>
</Layout.FullHeight>
);
};

export default function BraindumpsIndex() {
return <Introduction />;
return (
<PageTransition.GradientMapTransition
classNameProps={["h-[calc(100vh-4rem)]", "w-2/3", "overflow-hidden"]}
>
<Introduction />
</PageTransition.GradientMapTransition>
);
}
125 changes: 63 additions & 62 deletions app/routes/braindumps/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import notionClient from "~/integrations/notion";
import { retrieveBraindumpsFromNotionDatabase } from "./notion-crm";

//? COMPONENTS
import { Link } from "@remix-run/react";
import P from "~/components/P";
import Title from "~/components/Title";
import { MorphingTransition } from "~/components/pageTransition";

// @ts-ignore
// ! EXPORT PROPER TYPE DEFINITONS
import { Link } from "@remix-run/react";
import Layout from "~/components/Layout";
import PageTransition from "~/components/pageTransition";
import FuzzyScrawl from "fuzzy-scrawl";

//? TYPES
Expand All @@ -28,7 +26,6 @@ import type { NotionDatabaseAPIMapperResponse } from "./notion-crm";
// @ts-ignore
// ! EXPORT PROPER TYPE DEFINITONS
import fuzzyScrawlStyles from "fuzzy-scrawl-styles";
import Layout from "../../components/Layout";

type ThrownResponses = ThrownResponse<404, string>;

Expand Down Expand Up @@ -94,59 +91,63 @@ export default function BraindumpsList() {
if (!braindumps) return null;

return (
<Layout.FullHeight classNameProp={["w-2/3"]}>
<MorphingTransition>
<div className="p-24">
{Object.entries(braindumps).map(
(
[category, relatedBraindumps]: [
category: string,
relatedBraindumps: NotionDatabaseAPIMapperResponse
],
keyOfCategories: number
) => {
return (
<div key={keyOfCategories} className="w-full pb-8">
<Title.H3
styleProps={[
"py-3.5",
"text-4xl",
"font-extrabold",
"uppercase",
"tracking-tight",
]}
>
{category}
</Title.H3>

<div className="bg-white pl-3.5">
{relatedBraindumps.map(
(
braindump: NotionDatabaseAPIMapperResponse[0],
index: number,
braindumps: NotionDatabaseAPIMapperResponse
) => {
const showFuzzyScrawl =
index ===
Math.floor(Math.random() * braindumps.length);

return (
<BraindumpDetails
key={index}
braindump={braindump}
showFuzzyScrawl={showFuzzyScrawl}
/>
);
}
)}
<PageTransition.GradientMapTransition
classNameProps={["h-[calc(100vh-4rem)]", "w-2/3", "overflow-hidden"]}
>
<Layout.FullHeight classNameProp={["w-2/3"]}>
<PageTransition.MorphingTransition>
<div className="p-24">
{Object.entries(braindumps).map(
(
[category, relatedBraindumps]: [
category: string,
relatedBraindumps: NotionDatabaseAPIMapperResponse
],
keyOfCategories: number
) => {
return (
<div key={keyOfCategories} className="w-full pb-8">
<Title.H3
styleProps={[
"py-3.5",
"text-4xl",
"font-extrabold",
"uppercase",
"tracking-tight",
]}
>
{category}
</Title.H3>

<div className="bg-white pl-3.5">
{relatedBraindumps.map(
(
braindump: NotionDatabaseAPIMapperResponse[0],
index: number,
braindumps: NotionDatabaseAPIMapperResponse
) => {
const showFuzzyScrawl =
index ===
Math.floor(Math.random() * braindumps.length);

return (
<BraindumpDetails
key={index}
braindump={braindump}
showFuzzyScrawl={showFuzzyScrawl}
/>
);
}
)}
</div>
</div>
</div>
);
}
)}
</div>
</MorphingTransition>
</Layout.FullHeight>
);
}
)}
</div>
</PageTransition.MorphingTransition>
</Layout.FullHeight>
</PageTransition.GradientMapTransition>
);
}

Expand Down Expand Up @@ -181,14 +182,14 @@ function BraindumpDetails({
braindump["Markdown"] ? (
<FuzzyScrawl.ScrawlComponent
content={<LinkToBraindump />}
svgFxFilterIndex={3}
filterType="circle"
svgFxFilterIndex={Math.floor(Math.random() * 7)}
filterType={Math.floor(Math.random() * 2) ? "circle" : "line"}
/>
) : (
<FuzzyScrawl.ScrawlComponent
content={<BraindumpName />}
svgFxFilterIndex={0}
filterType="line"
svgFxFilterIndex={Math.floor(Math.random() * 7)}
filterType={Math.floor(Math.random() * 2) ? "circle" : "line"}
/>
)
) : braindump["Markdown"] ? (
Expand Down
Loading