Compare commits
No commits in common. "main" and "1.0.0" have entirely different histories.
2
.gitignore
vendored
|
@ -1,5 +1,3 @@
|
||||||
output
|
output
|
||||||
tmp
|
|
||||||
build
|
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
66
CHANGELOG.md
|
@ -1,66 +0,0 @@
|
||||||
# Changelog
|
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
||||||
|
|
||||||
## [Unreleased]
|
|
||||||
|
|
||||||
## [1.1.1] - 2025-02-16
|
|
||||||
|
|
||||||
Small bugfixes and improvement release
|
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- Improved alt texts by describing the flags
|
|
||||||
- The alt is now also available in english via localizedAlt
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Generate a zip archive with all buttons
|
|
||||||
- Add blank versions of the flags
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Use gif format for buttons
|
|
||||||
|
|
||||||
## [1.1.0] - 2025-02-13
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fixed french name for intersex
|
|
||||||
- Fixed names by removing accents and other weird things
|
|
||||||
- Used replaceAll everywhere
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Added demisexual and demiromantic flags
|
|
||||||
- Added "LGBTQ+ rights" texts
|
|
||||||
- Added "now!" variants
|
|
||||||
- Added aro-ace flags
|
|
||||||
- Added genderfluid flags
|
|
||||||
- Added demigenders flags
|
|
||||||
- Added polyamours flags
|
|
||||||
- Added "& proud" texts
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- The script show now the time generation
|
|
||||||
- Count the number of flags and buttons generated
|
|
||||||
- The script uses now functions and should be more readable
|
|
||||||
|
|
||||||
## [1.0.0] - 2025-02-02
|
|
||||||
|
|
||||||
Initial release of the project, containing the following things :
|
|
||||||
|
|
||||||
- Present flags : Pride, Asexual, Agender, Aromantic, Bisexual, Demiboy, Demigirl, Gay, Lesbian, Intersex, Non-binary, Pansexual, Transgender
|
|
||||||
- Texts in french and english
|
|
||||||
- Anti-terf, anti-transphobia texts.
|
|
||||||
- Protect trans kids texts
|
|
||||||
- Trans rights texts
|
|
||||||
|
|
||||||
[unreleased]: https://git.kobold.cafe/kazhnuz/pride-buttons/compare/1.1.1...main
|
|
||||||
[1.1.1]: https://git.kobold.cafe/kazhnuz/pride-buttons/compare/1.1.0...1.1.1
|
|
||||||
[1.1.0]: https://git.kobold.cafe/kazhnuz/pride-buttons/compare/1.0.0...1.1.0
|
|
||||||
[1.0.0]: https://git.kobold.cafe/kazhnuz/pride-buttons/releases/tag/1.0.0
|
|
326
data.json
|
@ -2,364 +2,66 @@
|
||||||
{
|
{
|
||||||
"source": "./sources/pride.gif",
|
"source": "./sources/pride.gif",
|
||||||
"name": {"en":"Pride", "fr":"Pride"},
|
"name": {"en":"Pride", "fr":"Pride"},
|
||||||
"alt": {
|
"texts": ["LGBTQ+", "proud", "fier⋅e", "fier", "fière", "queer"]
|
||||||
"en":"rainbow with yellow (with a violet circle), white, pink, skyblue, brown and black triangles",
|
|
||||||
"fr":"arc en ciel vertical, avec des triangles jaune (avec un cercle violet), blanc, rose, bleu ciel, marron et noir."
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"LGBTQ+", "proud", "fier⋅e", "fier", "fière", "queer",
|
|
||||||
"LGBTQ+\n& proud", "queer\n& proud",
|
|
||||||
"LGBTQ+\n& fier", "queer\n& fier",
|
|
||||||
"LGBTQ+\n& fière", "queer\n& fière",
|
|
||||||
"LGBTQ+\n& fier⋅e", "queer\n& fier⋅e",
|
|
||||||
"LGBTQ+\nrights", "LGBTQ+\nunited!", "LGBTQ+\nunite!", "LGBTQ+\nunis!",
|
|
||||||
"queer\nrights", "queer\nunited!", "queer\nunite!", "queer\nunis!",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": [
|
|
||||||
"LGBTQ+\nrights", "LGBTQ+\nunited!", "LGBTQ+\nunite!", "LGBTQ+\nunis!",
|
|
||||||
"queer\nrights", "queer\nunited!", "queer\nunite!", "queer\nunis!",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/ace.gif",
|
"source": "./sources/ace.gif",
|
||||||
"alt": {
|
|
||||||
"en":"with black, gray, white and purple horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales noires, grises, blanches et violetes"
|
|
||||||
},
|
|
||||||
"name": {"en":"Asexual", "fr":"Asexuel"},
|
"name": {"en":"Asexual", "fr":"Asexuel"},
|
||||||
"texts": [
|
"texts": ["ace", "asexual", "asexuel", "asexuelle", "asexuel⋅le"]
|
||||||
"ace", "asexual", "asexuel", "asexuelle", "asexuel⋅le",
|
|
||||||
"ace\n& proud", "asexual\n& proud",
|
|
||||||
"asexuel\n& fier", "ace\n& fier",
|
|
||||||
"asexuelle\n& fière", "ace\n& fière",
|
|
||||||
"asexuel⋅le\n& fier⋅e", "ace\n& fier⋅e",
|
|
||||||
"Be ace\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be ace\ndo crime"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "./sources/aroace.gif",
|
|
||||||
"name": {"en":"Aro&ace", "fr":"Aro&ace"},
|
|
||||||
"alt": {
|
|
||||||
"en":"with black, gray, white and purple horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales noires, grises, blanches et violetes"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"aroace", "aro & ace",
|
|
||||||
"aroace\n& proud", "aro & ace\n& proud",
|
|
||||||
"aroace\n& fier", "aro & ace\n& fier",
|
|
||||||
"aroace\n& fière", "aro & ace\n& fière",
|
|
||||||
"aroace\n& fier⋅e", "aro & ace\n& fier⋅e",
|
|
||||||
"Be aroace\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be aroace\ndo crime"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "./sources/aroace-2.gif",
|
|
||||||
"name": {"en":"Aroace", "fr":"Aroace"},
|
|
||||||
"alt": {
|
|
||||||
"en":"with light and dark yellow, white, light and dark blue horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales jaunes claires et foncée, blanche, bleu clair et foncé"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"aroace", "aro & ace",
|
|
||||||
"aroace\n& proud", "aro & ace\n& proud",
|
|
||||||
"aroace\n& fier", "aro & ace\n& fier",
|
|
||||||
"aroace\n& fière", "aro & ace\n& fière",
|
|
||||||
"aroace\n& fier⋅e", "aro & ace\n& fier⋅e",
|
|
||||||
"Be aroace\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be aroace\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/agender.gif",
|
"source": "./sources/agender.gif",
|
||||||
"name": {"en":"Agender", "fr":"Agenre"},
|
"name": {"en":"Agender", "fr":"Agenre"},
|
||||||
"alt": {
|
"texts": ["agender", "agenre"]
|
||||||
"en":"with black, grey, white, grey, green, grey, white and black horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales noire, grises, blanches, vertes, blanches, grises et noires"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"agender", "agenre",
|
|
||||||
"agender\n& proud",
|
|
||||||
"agenre\n& fier",
|
|
||||||
"agenre\n& fière",
|
|
||||||
"agenre\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/aromantic.gif",
|
"source": "./sources/aromantic.gif",
|
||||||
"name": {"en":"Aromantic", "fr":"Aromantique"},
|
"name": {"en":"Aromantic", "fr":"Aromantique"},
|
||||||
"alt": {
|
"texts": ["aromantic", "aromantique", "aro"]
|
||||||
"en":"with dark and light green, white, grey, black horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales vertes foncé puis clair, blanches, grises et noires"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"aromantic", "aromantique", "aro",
|
|
||||||
"aromantic\n& proud", "aro\n& proud",
|
|
||||||
"aromantique\n& fier", "aro\n& fier",
|
|
||||||
"aromantique\n& fière", "aro\n& fière",
|
|
||||||
"aromantique\n& fier⋅e", "aro\n& fier⋅e",
|
|
||||||
"Be aro\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be aro\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/bisexual.gif",
|
"source": "./sources/bisexual.gif",
|
||||||
"alt": {
|
|
||||||
"en":"with magenta (big), violet (small) and blue (big) horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales magenta (grande), violet (petite) et bleu (grande)"
|
|
||||||
},
|
|
||||||
"name": {"en":"Bisexual", "fr":"Bisexuel"},
|
"name": {"en":"Bisexual", "fr":"Bisexuel"},
|
||||||
"texts": [
|
"texts": ["bisexual", "bisexuel", "bisexuelle", "bisexuel⋅le", "bi"]
|
||||||
"bisexual", "bisexuel", "bisexuelle", "bisexuel⋅le", "bi",
|
|
||||||
"bisexual\n& proud", "bi\n& proud",
|
|
||||||
"bisexuel\n& fier", "bi\n& fier",
|
|
||||||
"bisexuelle\n& fière", "bi\n& fière",
|
|
||||||
"bisexuel⋅le\n& fier⋅e", "bi\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime", "Be bi\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime", "Be bi\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/demiboy.gif",
|
"source": "./sources/demiboy.gif",
|
||||||
"name": {"en":"Demiboy", "fr":"Demigars"},
|
"name": {"en":"Demiboy", "fr":"Demigars"},
|
||||||
"alt": {
|
"texts": ["demiboy", "demiman", "demigars", "demihomme", "demimec"]
|
||||||
"en":"with dark and light grey, light blue, white, light blue, light and dark grey horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales grises foncé et claires, bleu clair, blanc, bleu clair, grises claire et foncé"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"demiboy", "demiman", "demigars", "demihomme", "demimec",
|
|
||||||
"demiboy\n& proud", "demiman\n& proud",
|
|
||||||
"demigars\n& fier", "demihomme\n& fier", "demimec\n& fier", "demiboy\n& fier",
|
|
||||||
"demigars\n& fier⋅e", "demihomme\n& fier⋅e", "demimec\n& fier⋅e", "demiboy\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/demigirl.gif",
|
"source": "./sources/demigirl.gif",
|
||||||
"name": {"en":"Demigirl", "fr":"Demifille"},
|
"name": {"en":"Demigirl", "fr":"Demifille"},
|
||||||
"alt": {
|
"texts": ["demigirl", "demiwoman", "demifemme", "demifille", "demimeuf"]
|
||||||
"en":"with dark and light grey, light pink, white, light pink, light and dark grey horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales grises foncé et claires, rose clair, blanc, rose clair, grises claire et foncé"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"demigirl", "demiwoman", "demifemme", "demifille", "demimeuf",
|
|
||||||
"demigirl\n& proud", "demiwoman\n& proud",
|
|
||||||
"demifille\n& fière", "demifemme\n& fière", "demimeuf\n& fière",
|
|
||||||
"demifille\n& fier⋅e", "demifemme\n& fier⋅e", "demimeuf\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "./sources/demigender.gif",
|
|
||||||
"name": {"en":"Demigender", "fr":"Demigenre"},
|
|
||||||
"alt": {
|
|
||||||
"en":"with dark and light grey, light yellow, white, light yellow, light and dark grey horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales grises foncé et claires, jaune clair, blanc, jaune clair, grises claire et foncé"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"demigender", "demigenre",
|
|
||||||
"demigender\n& proud",
|
|
||||||
"demigenre\n& fier",
|
|
||||||
"demigenre\n& fière",
|
|
||||||
"demigenre\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "./sources/demiromantic.gif",
|
|
||||||
"name": {"en":"Demiromantic", "fr":"Demiromantique"},
|
|
||||||
"alt": {
|
|
||||||
"en":"with white and grey horizontal stripes, with a green in between and a black triangle on the left",
|
|
||||||
"fr":"avec des bandes horizontales grises blanche et grise avec du vert au milieu, et un triangle noir sur la gauche"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"demiromantic", "demiromantique", "demirom", "demiaro",
|
|
||||||
"demiromantic\n& proud", "demirom\n& proud", "demiaro\n& proud",
|
|
||||||
"demiromantique\n& fier", "demirom\n& fier", "demiaro\n& fier",
|
|
||||||
"demiromantique\n& fière", "demirom\n& fière", "demiaro\n& fière",
|
|
||||||
"demiromantique\n& fier⋅e", "demirom\n& fier⋅e", "demiaro\n& fier⋅e",
|
|
||||||
"Be demi\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be demi\ndo crime"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "./sources/demisexual.gif",
|
|
||||||
"name": {"en":"Demisexual", "fr":"Demisexuel"},
|
|
||||||
"alt": {
|
|
||||||
"en":"with white and grey horizontal stripes, with a purple in between and a black triangle on the left",
|
|
||||||
"fr":"avec des bandes horizontales grises blanche et grise avec du violet au milieu, et un triangle noir sur la gauche"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"demisexual", "demisexuel", "demisexuelle", "demisexuel⋅le", "demiace",
|
|
||||||
"demisexual\n& proud", "demiace\n& proud",
|
|
||||||
"demisexuel\n& fier", "demiace\n& fier",
|
|
||||||
"demisexuelle\n& fière", "demiace\n& fière",
|
|
||||||
"demisexuel⋅le\n& fier⋅e", "demiace\n& fier⋅e",
|
|
||||||
"Be demi\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be demi\ndo crime"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "./sources/genderfluid.gif",
|
|
||||||
"name": {"en":"Genderfluid", "fr":"Genderfluide"},
|
|
||||||
"alt": {
|
|
||||||
"en":"with pink, white, magenta, dark and light violet horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales rose, blanches, magenta, violet foncé puis clair"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"genderfluid", "genderfluide",
|
|
||||||
"genderfluid\n& proud",
|
|
||||||
"genderfluide\n& fier",
|
|
||||||
"genderfluide\n& fière",
|
|
||||||
"genderfluide\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "./sources/genderflux.gif",
|
|
||||||
"name": {"en":"Genderflux", "fr":"Genderflux"},
|
|
||||||
"alt": {
|
|
||||||
"en":"with a gradient of pink to blue horizontal stripes, with a yellow one under",
|
|
||||||
"fr":"avec des bandes horizontales en degradés rose à bleu, avec une jaune en dessous"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"genderflux",
|
|
||||||
"genderflux\n& proud",
|
|
||||||
"genderflux\n& fier",
|
|
||||||
"genderflux\n& fière",
|
|
||||||
"genderflux\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/gay.gif",
|
"source": "./sources/gay.gif",
|
||||||
"name": {"en":"Gay", "fr":"Gay"},
|
"name": {"en":"Gay", "fr":"Gay"},
|
||||||
"alt": {
|
"texts": ["gay", "homosexuel", "homosexuel⋅le"]
|
||||||
"en":"with a gradient of green to white horizontal stripes, then under a white to dark blue one ",
|
|
||||||
"fr":"avec des bandes horizontales en degradés de vert à blanc, puis de blanc à bleu foncé"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"gay", "homosexuel", "homosexuel⋅le",
|
|
||||||
"gay\n& proud",
|
|
||||||
"homosexuel\n& fier", "gay\n& fier",
|
|
||||||
"homosexuel⋅le\n& fier⋅e", "gay\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/intersex-1.gif",
|
"source": "./sources/intersex-1.gif",
|
||||||
"alt": {
|
"name": {"en":"Intersex", "fr":"Intersexué"},
|
||||||
"en":"yellow with a violet circle",
|
"texts": ["Intersex", "Intersexué", "Intersexuée", "Intersexué⋅e"]
|
||||||
"fr":"jaune avec un cercle violet"
|
|
||||||
},
|
|
||||||
"name": {"en":"Intersex", "fr":"Intersexe"},
|
|
||||||
"texts": [
|
|
||||||
"Intersex", "Intersexe",
|
|
||||||
"Intersex\n& proud",
|
|
||||||
"Intersexe\n& fier",
|
|
||||||
"Intersexe\n& fière",
|
|
||||||
"Intersexe\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/lesbian.gif",
|
"source": "./sources/lesbian.gif",
|
||||||
"name": {"en":"Lesbian", "fr":"Lesbienne"},
|
"name": {"en":"Lesbian", "fr":"Lesbienne"},
|
||||||
"alt": {
|
"texts": ["lesbienne", "lesbian", "homosexuelle", "homosexuel⋅le"]
|
||||||
"en":"with a gradient of orange to white horizontal stripes, then under a white to dark pink one ",
|
|
||||||
"fr":"avec des bandes horizontales en degradés de orange à blanc, puis de blanc à rose foncé"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"lesbienne", "lesbian", "homosexuelle", "homosexuel⋅le",
|
|
||||||
"lesbian\n& proud",
|
|
||||||
"lesbienne\n& fière", "homosexuelle\n& fière",
|
|
||||||
"lesbienne\n& fier⋅e", "homosexuel⋅le\n& fier⋅e",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/nonbinary.gif",
|
"source": "./sources/nonbinary.gif",
|
||||||
"name": {"en":"Non-Binary", "fr":"Non-binaire"},
|
"name": {"en":"Non-Binary", "fr":"Non-binaire"},
|
||||||
"alt": {
|
"texts": ["non-binary", "non-binaire", "enby", "nb"]
|
||||||
"en":"with a yellow, white, violet, dark grey horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales jaune, blanche, violete, grise foncé"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"non-binary", "non-binaire", "enby", "nb",
|
|
||||||
"nb\n& proud", "enby\n& proud", "non-binary\n& proud",
|
|
||||||
"nb\n& fier", "enby\n& fier", "non-binaire\n& fier",
|
|
||||||
"nb\n& fier⋅e", "enby\n& fier⋅e", "non-binaire\n& fier⋅e",
|
|
||||||
"nb\n& fière", "enby\n& fière", "non-binaire\n& fière",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime"]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/pansexual.gif",
|
"source": "./sources/pansexual.gif",
|
||||||
"name": {"en":"Pansexual", "fr":"Pansexuel"},
|
"name": {"en":"Pansexual", "fr":"Pansexuel"},
|
||||||
"alt": {
|
"texts": ["pansexual", "pan", "pansexuel", "pansexuelle", "pansexuel⋅le"]
|
||||||
"en":"with a pink, yellow, blue horizontal stripes",
|
|
||||||
"fr":"avec des bandes horizontales rose, jaune et bleu"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"pansexual", "pan", "pansexuel", "pansexuelle", "pansexuel⋅le",
|
|
||||||
"pansexual\n& proud", "pan\n& proud",
|
|
||||||
"pansexuel\n& fier", "pan\n& fier",
|
|
||||||
"pansexuel⋅le\n& fier⋅e", "pan\n& fier⋅e",
|
|
||||||
"pansexuelle\n& fière", "pan\n& fière",
|
|
||||||
"Be gay\ndo crime", "Be pan\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": ["Be gay\ndo crime", "Be pan\ndo crime"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "./sources/polyamour-2.gif",
|
|
||||||
"alt": {
|
|
||||||
"en":"with a bleu, red, black horizontal stripes with a pi",
|
|
||||||
"fr":"avec des bandes horizontales bleu, rouge, noire avec un pi"
|
|
||||||
},
|
|
||||||
"name": {"en":"Polyamourous", "fr":"Polyamour"},
|
|
||||||
"texts": [
|
|
||||||
"Polyamourous", "Polyamour", "poly",
|
|
||||||
"Polyamourous\n& proud", "poly\n& proud",
|
|
||||||
"poly\n& fier",
|
|
||||||
"poly\n& fier⋅e",
|
|
||||||
"poly\n& fière"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"source": "./sources/trans.gif",
|
"source": "./sources/trans.gif",
|
||||||
"name": {"en":"Transgender", "fr":"Transgenre"},
|
"name": {"en":"Transgender", "fr":"Transgenre"},
|
||||||
"alt": {
|
"texts": ["transgender", "transgenre", "trans", "fuck\ntransphobes", "trans\nrights", "fuck\nterfs", "no to\nterfs", "Non aux\nterfs", "stop\ntransphobia", "stop à la\ntransphobie", "protect\ntrans kids", "droits\ntrans"]
|
||||||
"en":"with a skyblue, light pink, white, light pink and skyblue stripes",
|
|
||||||
"fr":"avec des bandes horizontales bleu ciel, rose clair, blanc, rose clair et bleu ciel"
|
|
||||||
},
|
|
||||||
"texts": [
|
|
||||||
"transgender", "transgenre", "trans",
|
|
||||||
"transgender\n& proud", "trans\n& proud",
|
|
||||||
"transgenre\n& fier", "trans\n& fier",
|
|
||||||
"transgenre\n& fier⋅e", "trans\n& fier⋅e",
|
|
||||||
"transgenre\n& fière", "trans\n& fier⋅e",
|
|
||||||
"fuck\ntransphobes", "fuck\nterfs", "no to\nterfs", "Non aux\nterfs", "stop\ntransphobia", "stop à la\ntransphobie",
|
|
||||||
"trans\nrights", "protect\ntrans kids", "droits\ntrans",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
],
|
|
||||||
"textsNow": [
|
|
||||||
"stop\ntransphobia", "stop à la\ntransphobie",
|
|
||||||
"trans\nrights", "protect\ntrans kids", "droits\ntrans",
|
|
||||||
"Be gay\ndo crime"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
193
main.js
|
@ -1,194 +1,51 @@
|
||||||
import data from './data.json' with { type: "json" };
|
import data from './data.json' with { type: "json" };
|
||||||
import gm from "gm";
|
import gm from "gm";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import archiver from 'archiver';
|
|
||||||
import * as path from "path";
|
|
||||||
import { fileURLToPath } from 'url';
|
|
||||||
|
|
||||||
const myGm = gm.subClass({imageMagick: true});
|
const myGm = gm.subClass({imageMagick: true});
|
||||||
|
|
||||||
const VERSION = process.env.npm_package_version;
|
|
||||||
const zipname = `pride-button-${VERSION}.zip`;
|
|
||||||
|
|
||||||
const position = {x: 4, y: 2, gravity: "NorthEast"}
|
const position = {x: 4, y: 2, gravity: "NorthEast"}
|
||||||
const metadatas = []
|
const metadatas = []
|
||||||
|
|
||||||
function capitalizeFirstLetter(val) {
|
|
||||||
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createFilename(prideflag, text, now = false) {
|
|
||||||
let filename = `${prideflag.name.en.toLowerCase()}.gif`
|
|
||||||
if (text !== "") {
|
|
||||||
const adaptedText = text
|
|
||||||
.replaceAll("⋅", "_")
|
|
||||||
.replaceAll(" ", "_")
|
|
||||||
.replaceAll("\n", '-')
|
|
||||||
.normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "")
|
|
||||||
.replaceAll("&", "and")
|
|
||||||
.replaceAll("+", "")
|
|
||||||
.toLowerCase();
|
|
||||||
filename = `${prideflag.name.en.toLowerCase()}-${adaptedText}${now?'-now':''}.gif`;
|
|
||||||
}
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createButton(source, x, y, text, gravity) {
|
|
||||||
const turnedText = text
|
|
||||||
.replaceAll("⋅", "-")
|
|
||||||
.toUpperCase();
|
|
||||||
|
|
||||||
return myGm(source)
|
|
||||||
.font('./NFPixels-Regular.ttf', 10)
|
|
||||||
.drawText(x-1, y, turnedText, gravity)
|
|
||||||
.drawText(x+1, y, turnedText, gravity)
|
|
||||||
.drawText(x, y+1, turnedText, gravity)
|
|
||||||
.drawText(x, y-1, turnedText, gravity)
|
|
||||||
.drawText(x-1, y-1, turnedText, gravity)
|
|
||||||
.drawText(x+1, y+1, turnedText, gravity)
|
|
||||||
.drawText(x-1, y+1, turnedText, gravity)
|
|
||||||
.drawText(x+1, y-1, turnedText, gravity)
|
|
||||||
.fill("#FFFFFF")
|
|
||||||
.drawText(x, y, turnedText, gravity);
|
|
||||||
};
|
|
||||||
|
|
||||||
function createMetadatas(prideflag, text, now = false) {
|
|
||||||
const filename = createFilename(prideflag, text, now);
|
|
||||||
let textForAlt = ""
|
|
||||||
let alt = ""
|
|
||||||
let alten = ""
|
|
||||||
if (text === "") {
|
|
||||||
alt = `Drapeau ${prideflag.name.fr.toLowerCase()} (${prideflag.alt.fr})`
|
|
||||||
alten = `${capitalizeFirstLetter(prideflag.name.en)} flag (${prideflag.alt.en})`
|
|
||||||
} else {
|
|
||||||
textForAlt = text.replaceAll("\n", " ").toLowerCase();
|
|
||||||
alt = `Drapeau ${prideflag.name.fr.toLowerCase()} (${prideflag.alt.fr}) avec écrit "${textForAlt}${now?", now!": ""}"`
|
|
||||||
alten = `${capitalizeFirstLetter(prideflag.name.en)} flag (${prideflag.alt.en}) with written "${textForAlt}${now?", now!": ""}"`
|
|
||||||
}
|
|
||||||
return {file:filename, alt:alt, localizedAlt:{en: alten, fr: alt}, text:textForAlt};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare folders
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = path.dirname(__filename);
|
|
||||||
|
|
||||||
fs.mkdirSync(path.join(__dirname, 'build'),
|
|
||||||
{ recursive: true });
|
|
||||||
fs.mkdirSync(path.join(__dirname, 'output'),
|
|
||||||
{ recursive: true });
|
|
||||||
fs.mkdirSync(path.join(__dirname, 'tmp'),
|
|
||||||
{ recursive: true });
|
|
||||||
|
|
||||||
|
|
||||||
// Start generating
|
|
||||||
|
|
||||||
let count = 0;
|
|
||||||
let flagCount = 0;
|
|
||||||
const start = Date.now();
|
|
||||||
|
|
||||||
data.forEach(prideflag => {
|
data.forEach(prideflag => {
|
||||||
console.log(`- Creating flags for ${prideflag.name.en}`);
|
console.log(`== Creating flags for ${prideflag.name.en}`);
|
||||||
const imageMetadata = {title:`Drapeau ${prideflag.name.fr.toLowerCase()} :`, list:[]};
|
const imageMetadata = {title:`Drapeau ${prideflag.name.fr.toLowerCase()} :`, list:[]};
|
||||||
|
|
||||||
const metadata = createMetadatas(prideflag, "", false)
|
|
||||||
imageMetadata.list.push(metadata);
|
|
||||||
createButton(prideflag.source, position.x, position.y, "", position.gravity)
|
|
||||||
.write(`./output/${metadata.file}`, function (err) {
|
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
count++;
|
|
||||||
|
|
||||||
prideflag.texts.forEach(text => {
|
prideflag.texts.forEach(text => {
|
||||||
const metadatas = createMetadatas(prideflag, text, false)
|
const outputfile = `${prideflag.name.en.toLowerCase()}-${text.replace("⋅", "_").replace(" ", "_").replace("\n", '-').toLowerCase()}.png`
|
||||||
imageMetadata.list.push(metadatas);
|
console.log(`Creating button for text ${text} (${outputfile})`);
|
||||||
|
const data = {file: outputfile, alt:`Drapeau ${prideflag.name.fr.toLowerCase()} avec écrit "${text.replace("\n", " ").toLowerCase()}"`};
|
||||||
//console.log(`Creating button for text "${metadatas.text}" (${metadatas.file})`);
|
imageMetadata.list.push(data);
|
||||||
createButton(prideflag.source, position.x, position.y, text, position.gravity)
|
const turnedText = text
|
||||||
.write(`./output/${metadatas.file}`, function (err) {
|
.replace("⋅", "-")
|
||||||
|
.toUpperCase();
|
||||||
|
myGm(prideflag.source)
|
||||||
|
.font('./NFPixels-Regular.ttf', 10)
|
||||||
|
.drawText(position.x-1, position.y, turnedText, position.gravity)
|
||||||
|
.drawText(position.x+1, position.y, turnedText, position.gravity)
|
||||||
|
.drawText(position.x, position.y+1, turnedText, position.gravity)
|
||||||
|
.drawText(position.x, position.y-1, turnedText, position.gravity)
|
||||||
|
.drawText(position.x-1, position.y-1, turnedText, position.gravity)
|
||||||
|
.drawText(position.x+1, position.y+1, turnedText, position.gravity)
|
||||||
|
.drawText(position.x-1, position.y+1, turnedText, position.gravity)
|
||||||
|
.drawText(position.x+1, position.y-1, turnedText, position.gravity)
|
||||||
|
.fill("#FFFFFF")
|
||||||
|
.drawText(position.x, position.y, turnedText, position.gravity)
|
||||||
|
.write(`./output/${outputfile}`, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
throw err;
|
throw err;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
count++;
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (prideflag.textsNow) {
|
|
||||||
prideflag.textsNow.forEach(text => {
|
|
||||||
const metadatas = createMetadatas(prideflag, text, true)
|
|
||||||
imageMetadata.list.push(metadatas);
|
|
||||||
|
|
||||||
//console.log(`Creating button for text "${metadatas.text}" (${metadatas.file})`);
|
|
||||||
createButton(prideflag.source, position.x+12, position.y, text, position.gravity)
|
|
||||||
.write(`./tmp/${metadatas.file}`, function (err) {
|
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
myGm(`./tmp/${metadatas.file}`)
|
|
||||||
.composite("./sources/now.gif")
|
|
||||||
.write(`./output/${metadatas.file}`, function (err) {
|
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}, 100);
|
|
||||||
|
|
||||||
count++;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
flagCount++;
|
|
||||||
metadatas.push(imageMetadata);
|
metadatas.push(imageMetadata);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(metadatas);
|
||||||
|
|
||||||
fs.writeFile("./output/pridebuttons.json", JSON.stringify(metadatas), (err) => {
|
fs.writeFile("./output/pridebuttons.json", JSON.stringify(metadatas), (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Zip the folder
|
|
||||||
|
|
||||||
var output = fs.createWriteStream(`build/${zipname}`);
|
|
||||||
var archive = archiver('zip');
|
|
||||||
var size = 0;
|
|
||||||
|
|
||||||
output.on('close', function () {
|
|
||||||
size = archive.pointer();
|
|
||||||
console.log('archiver has been finalized and the output file descriptor has closed.');
|
|
||||||
});
|
|
||||||
|
|
||||||
archive.on('error', function(err){
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
|
|
||||||
archive.pipe(output);
|
|
||||||
|
|
||||||
// append files from a sub-directory, putting its contents at the root of archive
|
|
||||||
archive.directory('output/', false);
|
|
||||||
|
|
||||||
await archive.finalize();
|
|
||||||
|
|
||||||
// Show final result
|
|
||||||
|
|
||||||
const millis = Date.now() - start;
|
|
||||||
setTimeout(() => {
|
|
||||||
console.log("");
|
|
||||||
console.log("-----------------------");
|
|
||||||
console.log("");
|
|
||||||
console.log(`Pride Button version ${VERSION}`);
|
|
||||||
console.log(`Generation finished in ${millis / 1000}s`);
|
|
||||||
console.log(`${flagCount} flags processed`);
|
|
||||||
console.log(`${count} files generated`);
|
|
||||||
console.log(`Archive name : ${zipname}`);
|
|
||||||
console.log(`Archive size : ${size/1000} kB`);
|
|
||||||
}, 500);
|
|
|
@ -1,13 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "pride-button",
|
"name": "pride-button",
|
||||||
"version": "1.1.1",
|
"version": "1.0.0",
|
||||||
"description": "A set of pride buttons",
|
"description": "A set of pride buttons",
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node main.js"
|
"build": "node main.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"archiver": "^7.0.1",
|
|
||||||
"gm": "^1.25.0"
|
"gm": "^1.25.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 293 B |
Before Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 332 B |
Before Width: | Height: | Size: 335 B |
BIN
sources/now.gif
Before Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 272 B |