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

Experience Brand Kit 1.0 #1948

Merged
merged 62 commits into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
fe99fcf
Static version of Menu us looking good
aaronmgdr Nov 12, 2019
b321b42
Brand kit general layout
aaronmgdr Nov 13, 2019
37529c6
Add base pages and other fun stuff
aaronmgdr Nov 13, 2019
62077b3
Wip
aaronmgdr Nov 13, 2019
3fd7a2f
Merge branch 'master' into aaronmgdr/brandkit
aaronmgdr Nov 14, 2019
a26f20a
Section nav
aaronmgdr Nov 14, 2019
9a99011
Redo pages
aaronmgdr Nov 14, 2019
e51f2a3
Steal this from other branch
aaronmgdr Oct 11, 2019
befe193
Sane scroll behavior
aaronmgdr Nov 15, 2019
d2e1cbe
Use constants for all paths
aaronmgdr Nov 15, 2019
5101634
Mobile
aaronmgdr Nov 15, 2019
f1e1bbe
WIP fetching from air table
aaronmgdr Nov 15, 2019
643b941
Logo page basic content first pass
aaronmgdr Nov 18, 2019
fe7b814
Add in words (WIP)
aaronmgdr Nov 19, 2019
691f537
Better white spacing
aaronmgdr Nov 19, 2019
2bf0af7
Move some files around and other things
aaronmgdr Nov 19, 2019
69d6ef9
Ensure long menu would be scrollable
aaronmgdr Nov 19, 2019
1b3f3db
Colors true
aaronmgdr Nov 20, 2019
47d06d3
no message
aaronmgdr Nov 20, 2019
2780a14
Typeography Page A
aaronmgdr Nov 20, 2019
ffca805
Fetching icons from airtbale and and displaying on page nice
aaronmgdr Nov 22, 2019
b887d24
Usage Example
aaronmgdr Nov 22, 2019
4f79668
Fix ilocal keys
aaronmgdr Nov 22, 2019
f77cd33
Right on
aaronmgdr Nov 22, 2019
cbd6d37
Type overhaul w han
aaronmgdr Nov 22, 2019
6016522
Judement
aaronmgdr Nov 22, 2019
77716c4
Improve Logo page on mobile
aaronmgdr Nov 22, 2019
bee2b22
LOGOGOSOGOOGOS
aaronmgdr Nov 23, 2019
5f45780
Change URI to be /experience/brand/*
aaronmgdr Nov 23, 2019
a60907f
LINT this and add brand redirect
aaronmgdr Nov 25, 2019
0d3181f
Icons view change and fix
aaronmgdr Nov 26, 2019
6d4c0a0
Create download button, fix up nav and make font page great
aaronmgdr Nov 26, 2019
5d567d6
Remove board and left alignment on colors
aaronmgdr Nov 26, 2019
8cd198e
Better gap
aaronmgdr Nov 26, 2019
5b3e4a6
Alignment of top
aaronmgdr Nov 27, 2019
a11b19e
Color Page Content
aaronmgdr Nov 27, 2019
ce3be5a
Create Inline Anchor for using inline button in the trans
aaronmgdr Nov 27, 2019
b56a709
Brand home page is a ok
aaronmgdr Nov 27, 2019
d74cb0e
Logo page content and better fit on tablet
aaronmgdr Nov 27, 2019
543c0a5
Logo page content
aaronmgdr Nov 27, 2019
692e279
Add web deps
cmcewen Nov 27, 2019
e43e109
Tyopgraphy page
aaronmgdr Nov 27, 2019
da7103e
ICONS text
aaronmgdr Nov 27, 2019
7420929
Beautiful icons
aaronmgdr Nov 27, 2019
3a60f8a
Sweet Jesus its downloading season
aaronmgdr Nov 27, 2019
d45ab55
Merge branch 'master' into aaronmgdr/brandkit
aaronmgdr Nov 27, 2019
1751676
Self review
aaronmgdr Nov 27, 2019
aa95970
Merge branch 'cmcewen/web-fix' into aaronmgdr/brandkit
cmcewen Nov 27, 2019
26df8c7
Fix import
cmcewen Nov 28, 2019
71fffe9
Merge branch 'master' into aaronmgdr/brandkit
cmcewen Dec 2, 2019
900b7ce
Dont show border on last type example
aaronmgdr Dec 2, 2019
55445f8
Glphs on backgrounds should be square on mobile
aaronmgdr Dec 3, 2019
17b5ced
Lint
aaronmgdr Dec 3, 2019
9fc9623
Lint
aaronmgdr Dec 3, 2019
9ccbb51
Cleanup from PR
aaronmgdr Dec 3, 2019
961cdf6
Ensure the sidebar is not ever covered by the footer
aaronmgdr Dec 3, 2019
b8195a0
Add License
aaronmgdr Dec 3, 2019
18a3760
Super duper with Laurance
aaronmgdr Dec 3, 2019
b964de9
Lint
aaronmgdr Dec 4, 2019
2ee84b4
Merge branch 'master' into aaronmgdr/brandkit
aaronmgdr Dec 4, 2019
a1d37ab
Merge branch 'master' into aaronmgdr/brandkit
aaronmgdr Dec 4, 2019
1cd2092
Merge branch 'master' into aaronmgdr/brandkit
aaronmgdr Dec 5, 2019
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
5 changes: 4 additions & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"apollo-boost": "^0.3.1",
"big-integer": "^1.6.31",
"body-parser": "^1.18.3",
"colortranslator": "^1.1.1",
"compression": "^1.7.4",
"connect-slashes": "^1.4.0",
"cross-fetch": "^3.0.2",
Expand Down Expand Up @@ -74,12 +75,14 @@
"shuffle-seed": "^1.1.6",
"stickyfilljs": "^2.0.5",
"svgs": "^4.1.0",
"tls": "^0.0.1"
"tls": "^0.0.1",
"yiq": "^3.0.1"
},
"devDependencies": {
"@firebase/app-types": "^0.4.6",
"@sentry/types": "^5.6.1",
"@types/airtable": "^0.5.6",
"@types/hex-rgba": "^1.0.0",
"@types/i18next": "^12.1.0",
"@types/mailgun-js": "^0.16.3",
"@types/next": "^8.0.3",
Expand Down
12 changes: 8 additions & 4 deletions packages/web/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ class MyApp extends App {
}
}

// there are a few pages we dont want the header on for artistic reasons
// currently this is just the animation demo pages
// there are a few pages we dont want the header on
// currently this is just the animation demo pages and brand kit
skipHeader() {
return this.props.router.asPath.startsWith('/animation')
return this.props.router.asPath.startsWith('/animation') || this.isBrand()
}

isBrand = () => {
return this.props.router.asPath.startsWith('/experience')
}

componentDidCatch = (error: Error, info: object) => {
Expand Down Expand Up @@ -76,5 +80,5 @@ function checkH1Count() {
function hashScroller(id: string) {
const element = document.getElementById(id.replace('#', ''))

scrollIntoView(element, { time: 200, align: { top: 0.2, topOffset: HEADER_HEIGHT } })
scrollIntoView(element, { time: 100, align: { top: 0, topOffset: HEADER_HEIGHT + 100 } })
}
11 changes: 9 additions & 2 deletions packages/web/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,15 @@ export default class MyDocument extends Document {
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href={'/static/normalize.css'} />

<link rel="preconnect" href="https://use.typekit.net" />
<link rel="stylesheet" href="https://use.typekit.net/dki6jkb.css" />
<link
rel="stylesheet"
href="https://indestructibletype.com/fonts/Jost.css"
type="text/css"
/>
<link
href="https://fonts.googleapis.com/css?family=EB+Garamond:400,500,500i,700&display=swap"
rel="stylesheet"
/>

<link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico" />
</Head>
Expand Down
3 changes: 3 additions & 0 deletions packages/web/pages/experience/brand/color.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Color from 'src/brandkit/Color'

export default Color
3 changes: 3 additions & 0 deletions packages/web/pages/experience/brand/icons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import IconsPage from 'src/brandkit/IconsPage'

export default IconsPage
3 changes: 3 additions & 0 deletions packages/web/pages/experience/brand/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Intro from 'src/brandkit/Intro'

export default Intro
2 changes: 2 additions & 0 deletions packages/web/pages/experience/brand/key-imagery.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import KeyImagery from 'src/brandkit/KeyImagery'
export default KeyImagery
3 changes: 3 additions & 0 deletions packages/web/pages/experience/brand/logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Logo from 'src/brandkit/Logo'

export default Logo
3 changes: 3 additions & 0 deletions packages/web/pages/experience/brand/typography.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Typography from 'src/brandkit/Typography'

export default Typography
Binary file modified packages/web/server-env-config.js.enc
Binary file not shown.
67 changes: 67 additions & 0 deletions packages/web/server/AssetBase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { Attachment, FieldSet, Table } from 'airtable'
import getConfig from 'next/config'
import airtableInit from './airtable'

const ASSSET_FIELD_LIGHT = 'Assets (on light bg)'
const ASSSET_FIELD_DARK = 'Assets (on dark bg)'

interface Fields extends FieldSet {
Name: string
Description: string
[ASSSET_FIELD_LIGHT]: Attachment[]
[ASSSET_FIELD_DARK]: Attachment[]
Zip: Attachment[]
Terms: boolean
Tags: string[]
}

enum AssetSheet {
Icons = 'Icons',
Illustrations = 'Illustrations',
AbstractGraphics = 'Abstract Graphics',
}

export default function getAssets(sheet: AssetSheet) {
return getAirtable(sheet)
.select({
filterByFormula: `AND(${IS_APROVED}, ${TERMS_SIGNED})`,
sort: [{ field: 'Name', direction: 'desc' }],
})
.all()
.then((records) => {
return records.map((r) => normalize(r.fields))
})
}

function getAirtable(sheet: AssetSheet): Table<Fields> {
return airtableInit(getConfig().serverRuntimeConfig.AIRTABLE_BRANDKIT_ID)(sheet)
}

const IS_APROVED = 'Approved=1'
const TERMS_SIGNED = 'Terms=1'

function normalize(asset: Fields) {
console.warn(asset)
return {
name: asset.Name,
description: asset.Description,
preview: getPreview(asset),
uri: getURI(asset),
}
}

function getPreview(asset: Fields) {
const previewField = asset[ASSSET_FIELD_LIGHT]

return (
(previewField &&
previewField[0] &&
previewField[0].thumbnails &&
previewField[0].thumbnails.large.url) ||
''
)
}

function getURI(asset: Fields) {
return (asset.Zip && asset.Zip[0] && asset.Zip[0].url) || ''
}
15 changes: 15 additions & 0 deletions packages/web/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ecoFundSubmission from '../server/EcoFundApp'
import { RequestType } from '../src/fauceting/FaucetInterfaces'
import nextI18next from '../src/i18n'
import latestAnnouncements from './Announcement'
import getAssets from './AssetBase'
import { faucetOrInviteController } from './controllers'
import getFormattedEvents from './EventHelpers'
import { submitFellowApp } from './FellowshipApp'
Expand Down Expand Up @@ -74,9 +75,14 @@ function wwwRedirect(req, res, nextAction) {
})
})

server.get('/brand', (_, res) => {
res.redirect('/experience/brand')
})

server.get('/connect', (_, res) => {
res.redirect('/community')
})

server.get('/tos', (_, res) => {
res.redirect('/user-agreement')
})
Expand Down Expand Up @@ -141,6 +147,15 @@ function wwwRedirect(req, res, nextAction) {
}
})

server.get('/brand/api/assets/:asset', async (req, res) => {
try {
const assets = await getAssets(req.params.asset)
res.json(assets)
} catch (e) {
res.status(e.statusCode || 500).json({ message: e.message || 'unknownError' })
}
})

server.post('/partnerships-email', async (req, res) => {
const { email } = req.body
await mailer({
Expand Down
150 changes: 150 additions & 0 deletions packages/web/src/brandkit/Color.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import * as React from 'react'
import { withNamespaces } from 'react-i18next'
import { ImageBackground, ImageRequireSource, StyleSheet, Text, View } from 'react-native'
import Palette from 'src/brandkit/color/Palette'
import { brandStyles } from 'src/brandkit/common/constants'
import {
ACCENT_PALETTE,
BACKGROUND_PALETTE,
GRAY_PALETTE,
PRIMARY_PALETTE,
} from 'src/brandkit/common/data'
import Page from 'src/brandkit/common/Page'
import PageHeadline from 'src/brandkit/common/PageHeadline'
import SectionTitle from 'src/brandkit/common/SectionTitle'
import Judgement, { Value } from 'src/brandkit/logo/Judgement'
import { I18nProps, NameSpaces } from 'src/i18n'
import { ScreenProps, ScreenSizes, withScreenSize } from 'src/layout/ScreenSize'
import { hashNav } from 'src/shared/menu-items'
import { colors, fonts, standardStyles } from 'src/styles'
const { brandColor } = hashNav

export default React.memo(function Color() {
return (
<Page
sections={[
{ id: brandColor.overview, children: <Overview /> },
{ id: brandColor.backgrounds, children: <Backgrounds /> },
]}
/>
)
})

const Overview = withNamespaces(NameSpaces.brand)(function _Overview({ t }: I18nProps) {
return (
<View>
<PageHeadline title={t('color.title')} style={standardStyles.blockMarginBottom} />
<Palette
title={t('color.primaries')}
text={t('color.primariesText')}
colors={PRIMARY_PALETTE}
/>
<Palette title={t('color.accents')} text={t('color.accentsText')} colors={ACCENT_PALETTE} />
<Palette title={t('color.grays')} text={t('color.graysText')} colors={GRAY_PALETTE} />
</View>
)
})

const Backgrounds = withNamespaces(NameSpaces.brand)(
withScreenSize<I18nProps>(function _Backgrounds({ t, screen }: I18nProps & ScreenProps) {
const stylesForJudgemnt = screen === ScreenSizes.DESKTOP ? styles.column : [standardStyles.row]

return (
<View>
<SectionTitle containerStyle={brandStyles.gap}>{t('color.backgroundTitle')}</SectionTitle>
<Palette text={t('color.backgroundText')} colors={BACKGROUND_PALETTE} />
<Text style={[brandStyles.gap, fonts.h5a, standardStyles.elementalMarginBottom]}>
{t('color.contrast')}
</Text>
<Text style={[brandStyles.gap, fonts.p]}>{t('color.contrastText')}</Text>
<View style={[standardStyles.elementalMargin, standardStyles.row]}>
<Lorem
color={colors.dark}
backgroundColor={colors.white}
withGap={true}
hasBorder={true}
/>
<Lorem color={colors.white} backgroundColor={colors.dark} withGap={true} />
</View>
<Text style={[brandStyles.gap, fonts.p]}>{t('color.contrastText2')}</Text>
<View style={screen === ScreenSizes.DESKTOP ? brandStyles.tiling : { width: '100%' }}>
<View style={stylesForJudgemnt}>
<Judgement is={Value.Bad}>
<Lorem color={colors.gold} backgroundColor={colors.faintGold} />
</Judgement>
<Judgement is={Value.Good}>
<Lorem color={colors.dark} backgroundColor={colors.faintGold} />
</Judgement>
</View>
<View style={stylesForJudgemnt}>
<Judgement is={Value.Bad}>
<Lorem
color={colors.white}
backgroundColor={colors.gray}
image={require('src/brandkit/images/lilah.jpg')}
/>
</Judgement>
<Judgement is={Value.Good}>
<Lorem
color={colors.white}
backgroundColor={colors.dark}
image={require('src/brandkit/images/lilahOverlay.jpg')}
/>
</Judgement>
</View>
<View style={stylesForJudgemnt}>
<Judgement is={Value.Bad}>
<Lorem color={colors.primary} backgroundColor={colors.deepBlue} />
</Judgement>
<Judgement is={Value.Good}>
<Lorem color={colors.white} backgroundColor={colors.deepBlue} />
</Judgement>
</View>
</View>
</View>
)
})
)

interface LoremProps {
backgroundColor: colors
color: colors
withGap?: boolean
hasBorder?: boolean
image?: ImageRequireSource
}

function Lorem({ backgroundColor, color, withGap, hasBorder, image }: LoremProps) {
const Component = image ? ImageBackground : View

return (
// @ts-ignore
<Component
source={image}
style={[
standardStyles.centered,
styles.lorem,
hasBorder && brandStyles.fullBorder,
withGap && brandStyles.gap,
{ backgroundColor },
]}
>
<Text style={[fonts.p, { color }]}>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ac dignissim purus.
</Text>
</Component>
)
}

const styles = StyleSheet.create({
container: { padding: 10 },
lorem: {
flex: 1,
paddingVertical: 20,
paddingHorizontal: 20,
minHeight: 150,
},
column: {
flex: 1,
},
})
Loading