Skip to content

Commit

Permalink
Adds 3d color graphs to top of page
Browse files Browse the repository at this point in the history
Adds an all colors view. TODO: Add swatches
  • Loading branch information
mrmrs committed Sep 18, 2023
1 parent 83a9c89 commit 4f50bd8
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions src/pages/stats.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @jsx jsx */
import { jsx } from 'theme-ui'
import { useEffect, useState } from 'react'
import uniq from 'lodash.uniq'
import getQueryParam from 'get-query-param'
import isUrl from 'is-url'
import { IconButton } from 'theme-ui'
Expand Down Expand Up @@ -109,6 +110,7 @@ export default () => {
const borderRadii = properties['border-radius'] || []
const borders = properties['border'] || []
const colors = properties.color || []
const palette = uniq(colors.concat(borderColors, backgroundColors))

return (
<Layout initialUrl={url} onUrlChange={(url) => setUrl(url)}>
Expand Down Expand Up @@ -424,6 +426,24 @@ export default () => {
Color
</h2>
</header>
<div style={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'center' }}>
<Colors3D
title="All colors"
colors={palette}
colorspace={colorSpace}
/>
<Colors3D
title="Background Colors"
colors={backgroundColors}
colorspace={colorSpace}
/>
<Colors3D title="Colors" colors={colors} colorspace={colorSpace} />
<Colors3D
title="Border Colors"
colors={borderColors}
colorspace={colorSpace}
/>
</div>
<BackgroundColors backgroundColors={backgroundColors} />
<Colors colors={colors} />
<div style={{ display: 'flex', gap: '1rem', justifyContent: 'center' }}>
Expand All @@ -446,19 +466,7 @@ export default () => {
LAB
</label>
</div>
<div style={{ display: 'flex', justifyContent: 'center' }}>
<Colors3D title="Colors" colors={colors} colorspace={colorSpace} />
<Colors3D
title="Background Colors"
colors={backgroundColors}
colorspace={colorSpace}
/>
<Colors3D
title="Border Colors"
colors={borderColors}
colorspace={colorSpace}
/>
</div>

<BorderColors borderColors={borderColors} />
<BackgroundImages url={url} backgroundImages={backgroundImages} />
<BoxShadows boxShadows={boxShadows} />
Expand Down

1 comment on commit 4f50bd8

@vercel
Copy link

@vercel vercel bot commented on 4f50bd8 Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cssstats – ./

cssstats-git-main-cssstats.vercel.app
www.cssstats.com
cssstats.com
cssstats-cssstats.vercel.app

Please sign in to comment.