Skip to content

Commit

Permalink
fix: prod should now run
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Dec 16, 2024
1 parent a2e9841 commit 7bc6bc4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"packageManager": "[email protected]",
"dependencies": {
"node-vibrant": "4.0.0-alpha.1",
"node-vibrant": "4.0.0-alpha.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
36 changes: 18 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/VibrantColors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {useEffect, useState, useCallback} from 'react';
import styles from './VibrantColors.module.css';
import Vibrant from 'node-vibrant/browser';

function getLightOrDark(color: string) {
function getLightOrDark(color: string | null) {
if (!color) return 'black';
const _color = color.substring(4, color.length - 1)
.replace(/ /g, '')
Expand Down Expand Up @@ -47,12 +47,12 @@ const VibrantColors = ({img}: VibrantColorsProps) => {

return (
<div className={styles.colors}>
<p className={styles.swatch} style={{"--bg-color": colors.Vibrant ?? "", "--color": getLightOrDark(colors.Vibrant)}}>Vibrant</p>
<p className={styles.swatch} style={{"--bg-color": colors.DarkVibrant ?? "", "--color": getLightOrDark(colors.DarkVibrant)}}>Dark Vibrant</p>
<p className={styles.swatch} style={{"--bg-color": colors.LightVibrant ?? "", "--color": getLightOrDark(colors.LightVibrant)}}>Light Vibrant</p>
<p className={styles.swatch} style={{"--bg-color": colors.Muted ?? "", "--color": getLightOrDark(colors.Muted)}}>Muted</p>
<p className={styles.swatch} style={{"--bg-color": colors.DarkMuted ?? "", "--color": getLightOrDark(colors.DarkMuted)}}>Dark Muted</p>
<p className={styles.swatch} style={{"--bg-color": colors.LightMuted ?? "", "--color": getLightOrDark(colors.LightMuted)}}>Light Muted</p>
<p className={styles.swatch} style={{"--bg-color": colors.Vibrant ?? "", "--color": getLightOrDark(colors.Vibrant)} as React.CSSProperties}>Vibrant</p>
<p className={styles.swatch} style={{"--bg-color": colors.DarkVibrant ?? "", "--color": getLightOrDark(colors.DarkVibrant)} as React.CSSProperties}>Dark Vibrant</p>
<p className={styles.swatch} style={{"--bg-color": colors.LightVibrant ?? "", "--color": getLightOrDark(colors.LightVibrant)} as React.CSSProperties}>Light Vibrant</p>
<p className={styles.swatch} style={{"--bg-color": colors.Muted ?? "", "--color": getLightOrDark(colors.Muted)} as React.CSSProperties}>Muted</p>
<p className={styles.swatch} style={{"--bg-color": colors.DarkMuted ?? "", "--color": getLightOrDark(colors.DarkMuted)} as React.CSSProperties}>Dark Muted</p>
<p className={styles.swatch} style={{"--bg-color": colors.LightMuted ?? "", "--color": getLightOrDark(colors.LightMuted)} as React.CSSProperties}>Light Muted</p>
</div>
)
}
Expand Down
5 changes: 2 additions & 3 deletions src/examples-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ExamplesTitle = ({ title }: ExamplesTitleProps) => {
style={{
position: "absolute",
top: "calc(50% - calc(0.375rem / 2))",
zIndex: -1,
zIndex: -1,
left: "50%",
transform: "translate(-50%, -50%)",
borderTop: "0.375rem dotted #CF9D13",
Expand All @@ -31,7 +31,6 @@ export const ExamplesTitle = ({ title }: ExamplesTitleProps) => {
/>
<h2
style={{
margin: 0,
width: "fit-content",
margin: "0 auto",
background: "#fff",
Expand All @@ -43,7 +42,7 @@ export const ExamplesTitle = ({ title }: ExamplesTitleProps) => {
textAlign: "center",
}}
>
Examples
{title}
</h2>
</div>
</div>
Expand Down

0 comments on commit 7bc6bc4

Please sign in to comment.