parent
cb66cff37a
commit
8a700a0442
@ -1,5 +1,5 @@ |
||||
module.exports = { |
||||
presets: [ |
||||
'@vue/cli-plugin-babel/preset' |
||||
] |
||||
'@vue/cli-plugin-babel/preset', |
||||
], |
||||
} |
||||
|
Before Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,74 @@ |
||||
export default function useRendering(context) { |
||||
return (settings) => { |
||||
if (!context.value) return |
||||
|
||||
const size = Math.sqrt(Math.pow(settings.width, 2) + Math.pow(settings.height, 2)) |
||||
const flagHeight = size / settings.flags.filter((flag) => flag.id !== '').length |
||||
|
||||
const tempCanvas = document.createElement('canvas') |
||||
tempCanvas.height = size |
||||
tempCanvas.width = size |
||||
|
||||
const tempContext = tempCanvas.getContext('2d') |
||||
|
||||
settings.flags.forEach((flag, flagIndex) => { |
||||
if (flag.id === 'bisexual') { |
||||
const barHeight = flagHeight / 5 |
||||
|
||||
tempContext.fillStyle = flag.bars[0] |
||||
tempContext.fillRect(0, flagHeight * flagIndex, size, barHeight * 2) |
||||
|
||||
tempContext.fillStyle = flag.bars[1] |
||||
tempContext.fillRect(0, (flagHeight * flagIndex) + (barHeight * 2), size, barHeight) |
||||
|
||||
tempContext.fillStyle = flag.bars[2] |
||||
tempContext.fillRect(0, (flagHeight * flagIndex) + (barHeight * 3), size, barHeight * 2) |
||||
} else if (flag.id === 'demisexual') { |
||||
const barHeight = flagHeight / 6 |
||||
|
||||
tempContext.fillStyle = flag.bars[1] |
||||
tempContext.fillRect(0, flagHeight * flagIndex, size, barHeight * 2.5) |
||||
|
||||
tempContext.fillStyle = flag.bars[2] |
||||
tempContext.fillRect(0, (flagHeight * flagIndex) + (barHeight * 2.5), size, barHeight) |
||||
|
||||
tempContext.fillStyle = flag.bars[3] |
||||
tempContext.fillRect(0, (flagHeight * flagIndex) + (barHeight * 3.5), size, barHeight * 2.5) |
||||
|
||||
tempContext.fillStyle = flag.bars[0] |
||||
tempContext.beginPath() |
||||
tempContext.moveTo(0, flagHeight * flagIndex) |
||||
tempContext.lineTo(flagHeight * 0.5, (flagHeight * flagIndex) + (barHeight * 3)) |
||||
tempContext.lineTo(0, (flagHeight * flagIndex) + flagHeight) |
||||
tempContext.fill() |
||||
} else if (flag.id === 'intersex') { |
||||
tempContext.fillStyle = flag.bars[0] |
||||
tempContext.fillRect(0, flagHeight * flagIndex, size, flagHeight) |
||||
|
||||
tempContext.save() |
||||
tempContext.strokeStyle = flag.bars[1] |
||||
tempContext.fillStyle = flag.bars[2] |
||||
tempContext.lineWidth = flagHeight * 0.1 |
||||
tempContext.arc(size / 2, (flagHeight * flagIndex) + (flagHeight / 2), flagHeight * 0.1875, 0, 2 * Math.PI) |
||||
tempContext.fill() |
||||
tempContext.stroke() |
||||
tempContext.restore() |
||||
} else { |
||||
const barHeight = flagHeight / flag.bars.length |
||||
flag.bars.forEach((bar, barIndex) => { |
||||
tempContext.fillStyle = bar |
||||
tempContext.fillRect(0, (flagHeight * flagIndex) + (barHeight * barIndex), size, barHeight) |
||||
}) |
||||
} |
||||
}) |
||||
|
||||
context.value.clearRect(0, 0, settings.width, settings.height) |
||||
|
||||
context.value.save() |
||||
context.value.translate(settings.width / 2, settings.height / 2) |
||||
context.value.rotate(-Math.PI / 4) |
||||
context.value.translate(-size / 2, -size / 2) |
||||
context.value.drawImage(tempCanvas, 0, 0) |
||||
context.value.restore() |
||||
} |
||||
} |
@ -0,0 +1,378 @@ |
||||
import { ref } from 'vue' |
||||
|
||||
export default function useFlagTypes() { |
||||
return ref([ |
||||
{ |
||||
id: 'abrosexual', |
||||
label: 'Abrosexual', |
||||
bars: [ |
||||
'#77CC94', |
||||
'#B5E5CC', |
||||
'#FCFEFF', |
||||
'#E997B5', |
||||
'#DC406C', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'aceflux', |
||||
label: 'Aceflux', |
||||
bars: [ |
||||
'#C82067', |
||||
'#BCC5C6', |
||||
'#EC6D87', |
||||
'#91479B', |
||||
'#800080', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'agender', |
||||
label: 'Agender', |
||||
bars: [ |
||||
'#000', |
||||
'#BCC5C6', |
||||
'#FFF', |
||||
'#B5F582', |
||||
'#FFF', |
||||
'#BCC5C6', |
||||
'#000', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'androgyne', |
||||
label: 'Androgyne', |
||||
bars: [ |
||||
'#FE007F', |
||||
'#9832FF', |
||||
'#00B8E7', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'aromantic', |
||||
label: 'Aromantic', |
||||
bars: [ |
||||
'#3AA740', |
||||
'#A8D47A', |
||||
'#FFF', |
||||
'#ABABAB', |
||||
'#000', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'asexual', |
||||
label: 'Asexual', |
||||
bars: [ |
||||
'#000', |
||||
'#A6A7A6', |
||||
'#FFF', |
||||
'#820082', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'bigender', |
||||
label: 'Bigender', |
||||
bars: [ |
||||
'#ED78AB', |
||||
'#FEF54D', |
||||
'#FFF', |
||||
'#AE6DBE', |
||||
'#719EE3', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'bisexual', |
||||
label: 'Bisexual', |
||||
bars: [ |
||||
'#D80071', |
||||
'#744E96', |
||||
'#0035A9', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'boyflux', |
||||
label: 'Boyflux', |
||||
bars: [ |
||||
'#D7E9F8', |
||||
'#6FACF5', |
||||
'#023670', |
||||
'#9EEDAC', |
||||
'#023670', |
||||
'#6FACF5', |
||||
'#D7E9F8', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'ceterosexual', |
||||
label: 'Ceterosexual', |
||||
bars: [ |
||||
'#FCF980', |
||||
'#169C47', |
||||
'#FFF', |
||||
'#000', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'demiboy', |
||||
label: 'Demiboy', |
||||
bars: [ |
||||
'#7F7F7F', |
||||
'#C4C4C4', |
||||
'#9AD9EB', |
||||
'#FFF', |
||||
'#9AD9EB', |
||||
'#C4C4C4', |
||||
'#7F7F7F', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'demiflux', |
||||
label: 'Demiflux', |
||||
bars: [ |
||||
'#7F7F7F', |
||||
'#DADADA', |
||||
'#FFB6B8', |
||||
'#F4F691', |
||||
'#9AD9EB', |
||||
'#DADADA', |
||||
'#7F7F7F', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'demigender', |
||||
label: 'Demigender', |
||||
bars: [ |
||||
'#7F7F7F', |
||||
'#C4C4C4', |
||||
'#FAFF72', |
||||
'#FFF', |
||||
'#FAFF72', |
||||
'#C4C4C4', |
||||
'#7F7F7F', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'demigirl', |
||||
label: 'Demigirl', |
||||
bars: [ |
||||
'#7F7F7F', |
||||
'#C4C4C4', |
||||
'#FFAEC9', |
||||
'#FFF', |
||||
'#FFAEC9', |
||||
'#C4C4C4', |
||||
'#7F7F7F', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'demigirlflux', |
||||
label: 'Demigirlflux', |
||||
bars: [ |
||||
'#7F7F7F', |
||||
'#C4C4C4', |
||||
'#A24AA3', |
||||
'#FEAFC9', |
||||
'#FFF', |
||||
'#FEAFC9', |
||||
'#A24AA3', |
||||
'#C4C4C4', |
||||
'#7F7F7F', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'demisexual', |
||||
label: 'Demisexual', |
||||
bars: [ |
||||
'#000', |
||||
'#FFF', |
||||
'#6f0071', |
||||
'#d3d3d3', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'fraysexual', |
||||
label: 'Fraysexual', |
||||
bars: [ |
||||
'#226CB5', |
||||
'#93E7DD', |
||||
'#FFF', |
||||
'#636363', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'mlm', |
||||
label: 'MLM', |
||||
bars: [ |
||||
'#008F72', |
||||
'#1BD0AD', |
||||
'#9BEAC4', |
||||
'#FFF', |
||||
'#7DB1E5', |
||||
'#4E45CD', |
||||
'#390B7A', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'genderfluid', |
||||
label: 'Genderfluid', |
||||
bars: [ |
||||
'#FF77A5', |
||||
'#F5F5F5', |
||||
'#C009D8', |
||||
'#232323', |
||||
'#2C39BF', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'genderqueer', |
||||
label: 'Genderqueer', |
||||
bars: [ |
||||
'#B880DE', |
||||
'#FFF', |
||||
'#478318', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'girlflux', |
||||
label: 'Girlflux', |
||||
bars: [ |
||||
'#F8E6D8', |
||||
'#F1526D', |
||||
'#BF0310', |
||||
'#E8C586', |
||||
'#BF0310', |
||||
'#F1526D', |
||||
'#F8E6D8', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'greysexual', |
||||
label: 'Greysexual', |
||||
bars: [ |
||||
'#740195', |
||||
'#AEB2AA', |
||||
'#FFF', |
||||
'#AEB2AA', |
||||
'#740195', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'intersex', |
||||
label: 'Intersex', |
||||
bars: [ |
||||
'#FFD900', |
||||
'#7A00AC', |
||||
'#FFD900', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'lesbian', |
||||
label: 'Lesbian', |
||||
bars: [ |
||||
'#D52800', |
||||
'#FD9954', |
||||
'#FFF', |
||||
'#D261A4', |
||||
'#A40061', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'nonbinary', |
||||
label: 'NonBinary', |
||||
bars: [ |
||||
'#FEF32A', |
||||
'#FEFEFE', |
||||
'#9D57D2', |
||||
'#000', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'omnisexual', |
||||
label: 'Omnisexual', |
||||
bars: [ |
||||
'#FF9DCF', |
||||
'#FF51C0', |
||||
'#1A0042', |
||||
'#675FFF', |
||||
'#8EA9FF', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'pangender', |
||||
label: 'Pangender', |
||||
bars: [ |
||||
'#FFF798', |
||||
'#FFDDCD', |
||||
'#FFEBFB', |
||||
'#FFF', |
||||
'#FFEBFB', |
||||
'#FFDDCD', |
||||
'#FFF798', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'pansexual', |
||||
label: 'Pansexual', |
||||
bars: [ |
||||
'#FF148E', |
||||
'#FFDA00', |
||||
'#14B5FF', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'polysexual', |
||||
label: 'Polysexual', |
||||
bars: [ |
||||
'#F614BA', |
||||
'#00D769', |
||||
'#1593F5', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'philadelphia-pride', |
||||
label: 'Philadelphia Pride', |
||||
bars: [ |
||||
'#000', |
||||
'#794E10', |
||||
'#E60000', |
||||
'#FF8E00', |
||||
'#FFEF00', |
||||
'#00821B', |
||||
'#004BFF', |
||||
'#770089', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'pride', |
||||
label: 'Pride', |
||||
bars: [ |
||||
'#E60000', |
||||
'#FF8E00', |
||||
'#FFEF00', |
||||
'#00821B', |
||||
'#004BFF', |
||||
'#770089', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'transgender', |
||||
label: 'Transgender', |
||||
bars: [ |
||||
'#5CCFFA', |
||||
'#F4ABB8', |
||||
'#FFF', |
||||
'#F4ABB8', |
||||
'#5CCFFA', |
||||
], |
||||
}, |
||||
{ |
||||
id: 'trigender', |
||||
label: 'Trigender', |
||||
bars: [ |
||||
'#FF95C4', |
||||
'#9580FF', |
||||
'#6AD969', |
||||
'#9580FF', |
||||
'#FF95C4', |
||||
], |
||||
}, |
||||
]) |
||||
} |
@ -1,4 +1,4 @@ |
||||
const { defineConfig } = require('@vue/cli-service') |
||||
module.exports = defineConfig({ |
||||
transpileDependencies: true |
||||
transpileDependencies: true, |
||||
}) |
||||
|
Loading…
Reference in new issue