1
0
Fork 0
freesewing/packages/freesewing.shared/components/logos/freesewing.js

94 lines
3.5 KiB
JavaScript
Raw Normal View History

import React from 'react'
import { path } from '../icons/freesewing.js'
import colors from 'tailwindcss/colors'
2021-12-26 16:43:35 +01:00
const strokes = {
light: colors.neutral[300],
dark: colors.neutral[800],
hax0r: colors.lime[700],
lgbtq: colors.neutral[500],
trans: colors.neutral[500],
}
let step = 0
const fill = {
light: (
<linearGradient id="light" x1="0%" y1="0%" x2="50%" y2="100%">
<stop offset={`10%`} stopColor={colors.yellow[500]} stopOpacity="1.0" />
<stop offset={`40%`} stopColor={colors.pink[500]} stopOpacity="1.0" />
<stop offset={`75%`} stopColor={colors.violet[500]} stopOpacity="1.0" />
<stop offset={`90%`} stopColor={colors.yellow[500]} stopOpacity="1.0" />
</linearGradient>
),
dark: (
<linearGradient id="dark" x1="50%" y1="0%" x2="0%" y2="100%">
<stop offset={`0%`} stopColor={colors.sky[500]} stopOpacity="1.0" />
<stop offset={`20%`} stopColor={colors.violet[500]} stopOpacity="1.0" />
<stop offset={`55%`} stopColor={colors.yellow[500]} stopOpacity="1.0" />
<stop offset={`85%`} stopColor={colors.pink[500]} stopOpacity="1.0" />
</linearGradient>
),
hax0r: (
<linearGradient id="hax0r" x1="0%" y1="0%" x2="50%" y2="100%">
{[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20].map( i => (
2022-01-20 09:07:38 +01:00
<React.Fragment key={i}>
<stop key={i} offset={`${i*5}%`} stopColor={colors.lime[900]} stopOpacity="1.0" />
<stop key={i} offset={`${i*5+1}%`} stopColor={colors.lime[800]} stopOpacity="1.0" />
<stop key={i} offset={`${i*5+2}%`} stopColor={colors.lime[900]} stopOpacity="1.0" />
2022-01-20 09:07:38 +01:00
</React.Fragment>
))}
</linearGradient>
),
lgbtq: (
<linearGradient id="lgbtq" x1="0%" y1="0%" x2="0%" y2="100%">
{['red', 'orange', 'yellow', 'green', 'blue', 'violet'].map(c => {
let next = step + 100/6
2022-01-20 09:07:38 +01:00
const stop = <React.Fragment key={c}>
<stop offset={`${step}%`} stopColor={colors[c][500]} stopOpacity="1.0" />
<stop offset={`${next}%`} stopColor={colors[c][500]} stopOpacity="1.0" />
2022-01-20 09:07:38 +01:00
</React.Fragment>
step = next
return stop
})}
</linearGradient>
),
trans: (
<linearGradient id="trans" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stopColor="#77cbf9" stopOpacity="1.0" />
<stop offset="20%" stopColor="#77cbf9" stopOpacity="1.0" />
<stop offset="20%" stopColor="#ecadb9" stopOpacity="1.0" />
<stop offset="40%" stopColor="#ecadb9" stopOpacity="1.0" />
<stop offset="40%" stopColor="#ffffff" stopOpacity="1.0" />
<stop offset="60%" stopColor="#ffffff" stopOpacity="1.0" />
<stop offset="60%" stopColor="#ecadb9" stopOpacity="1.0" />
<stop offset="80%" stopColor="#ecadb9" stopOpacity="1.0" />
<stop offset="80%" stopColor="#77cbf9" stopOpacity="1.0" />
<stop offset="100%" stopColor="#77cbf9" stopOpacity="1.0" />
</linearGradient>
),
}
2021-12-26 16:43:35 +01:00
const Logo = ({ size=false, className='stroke-0', theme='light', fill=false, stroke=false }) => {
const svgProps = {
xmlns: 'http://www.w3.org/2000/svg',
2021-12-27 14:42:01 +01:00
viewBox: '-1 0 25 25',
className: className
}
if (size) {
svgProps.width = size
svgProps.height = size
}
return (
<svg {...svgProps}>
<defs>
2022-01-20 09:07:38 +01:00
{fill && fill[theme]}
2021-12-27 17:33:31 +01:00
<path id="react-logo" d={path} />
</defs>
2021-12-27 17:33:31 +01:00
<use xlinkHref="#react-logo" fill="none" stroke={stroke || strokes[theme]} strokeWidth="0.5"/>
<use xlinkHref="#react-logo" fill={fill || `url(#${theme})`} stroke="none"/>
</svg>
)
}
export default Logo