-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(site): add landing and learn to contentful (#3073)
- Loading branch information
Showing
15 changed files
with
1,442 additions
and
1,205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 18 additions & 6 deletions
24
site/src/components/sections/landing/ConsensusSection.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
--- | ||
import { Image } from "astro:assets" | ||
import H1 from "../../typography/h1.astro" | ||
import ButtonA from "../../ButtonA.astro" | ||
import QuoteSubTitle from "../../typography/QuoteSubTitle.astro" | ||
import ContainedSection from "../../ContainedSection.astro" | ||
import Spline from "../../Spline.astro" | ||
import { renderRichText, renderTitle } from "../../../lib/contentful/render.ts" | ||
interface Props { | ||
title: any | ||
text: any | ||
} | ||
const { title, text } = Astro.props | ||
const titleHtml = renderTitle(title) | ||
const textHtml = renderRichText(text) | ||
--- | ||
|
||
<ContainedSection> | ||
<div class="flex flex-col-reverse lg:flex-row gap-12 py-12"> | ||
<div class="flex flex-col justify-center gap-6 flex-1"> | ||
<H1>Consensus <br> verification <br> for security <br> and <span class="text-accent-500">stability</span></H1> | ||
<H1> | ||
<Fragment set:html={titleHtml}/> | ||
</H1> | ||
<div class="max-w-[438px]"> | ||
<QuoteSubTitle>Union eliminates intermediaries and connects blockchains directly. With Union light clients, you | ||
get secure, censorship-resistant connections to any ecosystem. | ||
<QuoteSubTitle> | ||
<Fragment set:html={textHtml}/> | ||
</QuoteSubTitle> | ||
</div> | ||
<ButtonA>Learn More</ButtonA> | ||
</div> | ||
<video class="bg-black flex-1" src="https://pub-32dd1494f0fa423cb1013941269ecce9.r2.dev/radial-glass-union.webm" autoplay muted loop/> | ||
<video class="bg-black flex-1" src="https://pub-32dd1494f0fa423cb1013941269ecce9.r2.dev/radial-glass-union.webm" | ||
autoplay muted loop/> | ||
</div> | ||
</ContainedSection> |
24 changes: 16 additions & 8 deletions
24
site/src/components/sections/landing/ExecutionSection.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<div class="-mb-2 text-4xl sm:text-5xl md:text-6xl text-white font-display uppercase font-supermolot font-bold"> | ||
<div class="-mb-2 text-4xl sm:text-5xl md:text-6xl text-white font-display uppercase font-supermolot font-bold py-0"> | ||
<slot/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<p class="text-sm md:text-base lg:text-xl font-bold text-neutral-200 font-mono"> | ||
<div class="text-sm md:text-base lg:text-xl font-bold text-neutral-200 font-mono"> | ||
<slot/> | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { BLOCKS, MARKS } from "@contentful/rich-text-types" | ||
import { documentToHtmlString } from "@contentful/rich-text-html-renderer" | ||
|
||
const defaultOptions = { | ||
renderMark: { | ||
[MARKS.BOLD]: (text: string) => `<span class="text-accent-500">${text}</span>` | ||
}, | ||
renderNode: { | ||
[BLOCKS.PARAGRAPH]: (node: any, next: any) => `<p>${next(node.content)}</p>`, | ||
[BLOCKS.DOCUMENT]: (node: any, next: any) => next(node.content).join("") | ||
} | ||
} | ||
|
||
export const renderRichText = (content: any, customOptions: any = {}) => { | ||
const options = { ...defaultOptions, ...customOptions } | ||
return documentToHtmlString(content, options) | ||
} | ||
|
||
export const renderTitle = (title: any) => { | ||
return title.content | ||
.map((block: any) => { | ||
if (block.nodeType === BLOCKS.PARAGRAPH) { | ||
return block.content | ||
.map((node: any) => { | ||
if (node.marks.some((mark: any) => mark.type === MARKS.BOLD)) { | ||
return `<span class="text-accent-500">${node.value}</span>` | ||
} | ||
return node.value | ||
}) | ||
.join("") | ||
} | ||
return "" | ||
}) | ||
.join("<br>") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { EntryFields, EntrySkeletonType } from "contentful" | ||
|
||
export interface LandingPageFields { | ||
firstTitle: EntryFields.RichText | ||
firstText: EntryFields.RichText | ||
secondTitle: EntryFields.RichText | ||
secondText: EntryFields.RichText | ||
thirdTitle: EntryFields.RichText | ||
thirdText: EntryFields.RichText | ||
fourthTitle: EntryFields.RichText | ||
fourthText: EntryFields.RichText | ||
} | ||
|
||
export interface LearningPageFields { | ||
coverTitle: EntryFields.RichText | ||
coverText: EntryFields.RichText | ||
firstTitle: EntryFields.RichText | ||
firstText: EntryFields.RichText | ||
secondTitle: EntryFields.RichText | ||
secondText: EntryFields.RichText | ||
thirdTitle: EntryFields.RichText | ||
thirdText: EntryFields.RichText | ||
fourthTitle: EntryFields.RichText | ||
fourthText: EntryFields.RichText | ||
fifthTitle: EntryFields.RichText | ||
fifthText: EntryFields.RichText | ||
sixthTitle: EntryFields.RichText | ||
sixthText: EntryFields.RichText | ||
seventhTitle: EntryFields.RichText | ||
seventhText: EntryFields.RichText | ||
eightTitle: EntryFields.RichText | ||
eightText: EntryFields.RichText | ||
nineTitle: EntryFields.RichText | ||
nineText: EntryFields.RichText | ||
} | ||
|
||
export interface LandingPageSkeleton extends EntrySkeletonType<LandingPageFields, "landing"> {} | ||
|
||
export interface LearningPageFields extends EntrySkeletonType<LearningPageFields, "learn"> {} | ||
|
||
export type FetchError = string | null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.