From a1cd268044a8065d72e7132c648d78dd5ee1d26b Mon Sep 17 00:00:00 2001 From: Leo-Nicolle Date: Tue, 13 Jun 2023 22:56:19 +0200 Subject: [PATCH 01/53] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3a5027..49adf0b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MotsFLex -![MotsFlex logo](./client/public/icon.svg | width=100) +![MotsFlex logo](./client/public/icon.svg) **Generateur de mots fléchés. Crosswords generator. Generator de Crucigramas.** From 2838ab4791441401ac51b2b8a7ed6c6256bd2dda Mon Sep 17 00:00:00 2001 From: Leo-Nicolle Date: Tue, 13 Jun 2023 22:57:45 +0200 Subject: [PATCH 02/53] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49adf0b..db0cb44 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MotsFLex -![MotsFlex logo](./client/public/icon.svg) +Logo **Generateur de mots fléchés. Crosswords generator. Generator de Crucigramas.** From ce86edbf2a376a99f4d5a3681bde75a1a126e25b Mon Sep 17 00:00:00 2001 From: Leo-Nicolle Date: Tue, 13 Jun 2023 23:00:52 +0200 Subject: [PATCH 03/53] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index db0cb44..17f1f22 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # MotsFLex -Logo + + Logo + **Generateur de mots fléchés. Crosswords generator. Generator de Crucigramas.** From 77e48b9cea19635bd1dcc5b3010590a48d2d253d Mon Sep 17 00:00:00 2001 From: Leo-Nicolle Date: Tue, 13 Jun 2023 23:01:12 +0200 Subject: [PATCH 04/53] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17f1f22..69e95a5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MotsFLex +# MotsFlex Logo From 2dabd96a66a1f4787efdd37debab5fd5a807940a Mon Sep 17 00:00:00 2001 From: Leo Nicolle Date: Thu, 15 Jun 2023 19:19:05 +0200 Subject: [PATCH 05/53] added pagination --- client/src/components/Book.vue | 12 ++-- client/src/components/GridPaper.vue | 10 +++- client/src/components/Paper.vue | 46 ++++++++++++++- client/src/components/Solutions.vue | 17 +++++- client/src/components/WordsIndex.vue | 17 +++++- client/src/components/forms/Options.vue | 2 +- .../src/components/forms/PaginationStyle.vue | 59 +++++++++++++++++++ client/src/components/forms/SolutionsForm.vue | 5 +- client/src/i18n/index.ts | 4 +- client/src/i18n/languages/en-en.ts | 3 +- client/src/i18n/languages/es-es.ts | 4 +- client/src/i18n/languages/fr-fr.ts | 3 +- client/src/layouts/Main.vue | 4 +- client/src/types.ts | 2 + client/src/views/editors/SolutionsEditor.vue | 4 +- 15 files changed, 169 insertions(+), 23 deletions(-) create mode 100644 client/src/components/forms/PaginationStyle.vue diff --git a/client/src/components/Book.vue b/client/src/components/Book.vue index 0d6e181..19aa562 100644 --- a/client/src/components/Book.vue +++ b/client/src/components/Book.vue @@ -6,27 +6,30 @@ :grid="grid" :options="options" :exportOptions="gridExport" + :page="solutionOptions.pagination.startIdx + i" /> diff --git a/client/src/components/Solutions.vue b/client/src/components/Solutions.vue index bcd0871..ced6f6f 100644 --- a/client/src/components/Solutions.vue +++ b/client/src/components/Solutions.vue @@ -5,6 +5,9 @@ :key="i" :format="solutionOptions.paper" :showMargins="exportOptions.margins" + :page-number="page" + :showPagination="exportOptions.pagination" + :pagination="solutionOptions.pagination" >
@@ -23,12 +26,18 @@ diff --git a/client/src/components/forms/Options.vue b/client/src/components/forms/Options.vue index 2bec919..1a37deb 100644 --- a/client/src/components/forms/Options.vue +++ b/client/src/components/forms/Options.vue @@ -74,7 +74,7 @@ diff --git a/client/src/components/forms/SolutionsForm.vue b/client/src/components/forms/SolutionsForm.vue index bf9d639..543e417 100644 --- a/client/src/components/forms/SolutionsForm.vue +++ b/client/src/components/forms/SolutionsForm.vue @@ -6,6 +6,8 @@ +

{{ $t("forms.pagination") }}

+

{{ $t("forms.gridNum") }}

{{ $t("forms.wordIndex") }}

@@ -15,8 +17,9 @@ @@ -119,6 +108,7 @@ body { @page { margin: 0; padding: 0; + size: v-bind(formatStyle); } @media print { button { @@ -132,15 +122,30 @@ body { position: relative; break-inside: avoid; box-sizing: border-box; - display: flex; - flex-direction: column; - .body { + .content { display: flex; flex-direction: column; - align-items: center; - justify-content: space-around; height: 100%; - width: 100%; + justify-content: space-between; + .body { + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-around; + height: 100%; + width: 100%; + } + .footer { + .pagination { + width: 100%; + display: flex; + flex-direction: row; + // margin-top: auto; + font: v-bind(paginationFont); + color: v-bind(paginationColor); + justify-content: v-bind(paginationJustify); + } + } } .borders { .border { @@ -170,14 +175,5 @@ body { height: 0; } } - .pageNumber { - width: 100%; - display: flex; - flex-direction: row; - margin-top: auto; - font: v-bind(paginationFont); - color: v-bind(paginationColor); - justify-content: v-bind(paginationJustify); - } } diff --git a/client/src/components/Solutions.vue b/client/src/components/Solutions.vue index ced6f6f..68af25b 100644 --- a/client/src/components/Solutions.vue +++ b/client/src/components/Solutions.vue @@ -11,7 +11,7 @@ >
- {{ j + 1 }} + {{ j + solutionOptions.pagination.startIdx }} @@ -158,6 +165,7 @@ const layout = computed(() => { align-items: center; page-break-inside: auto; gap: 10px; + flex: 2; } .words > span { page-break-after: auto; diff --git a/client/src/components/forms/GridForm.vue b/client/src/components/forms/GridForm.vue index d6bfdfe..5ff4a2e 100644 --- a/client/src/components/forms/GridForm.vue +++ b/client/src/components/forms/GridForm.vue @@ -1,6 +1,6 @@ @@ -120,5 +120,8 @@ async function localMode() { color: #000; text-decoration: underline; } +.hidden{ + display: none; +} From de97dc8b8d20332ae73d32d96c57addbeea79ab3 Mon Sep 17 00:00:00 2001 From: Leo Nicolle Date: Sun, 2 Jul 2023 20:09:59 +0200 Subject: [PATCH 12/53] make it responssive --- client/src/js/useResponsive.ts | 20 +++++ client/src/layouts/Main.vue | 62 +++++++++++++- client/src/layouts/NotLoggedin.vue | 23 +++-- client/src/views/Home.vue | 130 ++++++++++++++++------------- 4 files changed, 166 insertions(+), 69 deletions(-) create mode 100644 client/src/js/useResponsive.ts diff --git a/client/src/js/useResponsive.ts b/client/src/js/useResponsive.ts new file mode 100644 index 0000000..e1f23a9 --- /dev/null +++ b/client/src/js/useResponsive.ts @@ -0,0 +1,20 @@ +import { ref } from "vue"; + +export type ScreenSize = 'phone' | 'tablet' | 'desktop'; + +export const useResponsive = () => { + const screenSize = ref('desktop'); + const onResize = () => { + screenSize.value = window.innerWidth < 768 ? 'phone' : window.innerWidth < 1024 ? 'tablet' : 'desktop'; + }; + const cleanupUseResponsive = () => { + window.removeEventListener("resize", onResize); + }; + window.addEventListener("resize", onResize); + onResize(); + return { + screenSize, + onResize, + cleanupUseResponsive + } +}; diff --git a/client/src/layouts/Main.vue b/client/src/layouts/Main.vue index 1fa968f..4b75237 100644 --- a/client/src/layouts/Main.vue +++ b/client/src/layouts/Main.vue @@ -4,7 +4,7 @@ - Motsflex + Motsflex - {{ selected?.label }} + {{ screenSize === "phone" ? "" : selected?.label }} - {{ $t(isSignedIn ? "buttons.exit" : "buttons.login") }} + {{ screenSize === "phone" ? '' : $t(isSignedIn ? "buttons.exit" : "buttons.login") }} \ No newline at end of file diff --git a/client/src/components/ExportSVG.vue b/client/src/components/ExportSVG.vue index 7c30da1..4772a2d 100644 --- a/client/src/components/ExportSVG.vue +++ b/client/src/components/ExportSVG.vue @@ -1,19 +1,20 @@ @@ -36,7 +37,7 @@ const style = ref(); const exporter = ref(); watchEffect(() => { - api.db.getStyle(props.grid.styleId).then(opts => { + api.db.getStyle(props.grid.styleId).then((opts) => { style.value = opts; }); }); @@ -62,4 +63,12 @@ function print() { position: fixed; top: 100%; } + +.modalbody { + display: flex; + justify-content: center; + align-items: center; + height: 100%; + width: 100%; +} \ No newline at end of file diff --git a/client/src/components/forms/ExportOptions.vue b/client/src/components/forms/ExportOptions.vue new file mode 100644 index 0000000..571a596 --- /dev/null +++ b/client/src/components/forms/ExportOptions.vue @@ -0,0 +1,53 @@ + + + + + + \ No newline at end of file diff --git a/client/src/components/forms/ModalOptions.vue b/client/src/components/forms/ModalOptions.vue index 31cb77d..7b26958 100644 --- a/client/src/components/forms/ModalOptions.vue +++ b/client/src/components/forms/ModalOptions.vue @@ -46,7 +46,7 @@ {{ $t("forms.randomize") }} @@ -70,10 +70,10 @@ v-model:show="randomConfirmVisible" > @@ -111,6 +111,7 @@ const props = defineProps<{ const opts = ref<{ label: string; value: string }[]>([]); const randomConfirmVisible = ref(false); const visible = ref(false); +const generating = ref(false); const emit = defineEmits<{ /** * v-model event @@ -134,10 +135,14 @@ function onUpdate(path: string, newvalue: string | number) { }); } function onRandomize() { - workerController.getDistribution().then((distribution) => { + generating.value = true; + nextTick() + .then(() => workerController.getDistribution()) + .then((distribution) => { generate({ grid: value.value, distribution }); emit("update-size", value.value); randomConfirmVisible.value = false; + generating.value = false; }); } watchEffect(() => { diff --git a/client/src/components/forms/Words.vue b/client/src/components/forms/Words.vue index 83801e7..9d9437f 100644 --- a/client/src/components/forms/Words.vue +++ b/client/src/components/forms/Words.vue @@ -2,12 +2,8 @@
- diff --git a/client/src/i18n/languages/en-en.ts b/client/src/i18n/languages/en-en.ts index a5ba28d..4f2d821 100644 --- a/client/src/i18n/languages/en-en.ts +++ b/client/src/i18n/languages/en-en.ts @@ -19,7 +19,7 @@ export const lang = { newGrid: "New grid", newStyle: "New style", print: "Print", - export: "Export", + exportsvg: "Export SVG", support: "Support MotsFlex", }, suggestions: { @@ -28,6 +28,8 @@ export const lang = { forms: { title: "Title", options: "Options", + default: 'Default', + solutions: "Solutions", gridSize: "Grid size", comment: "Comment", rows: "Rows", @@ -36,6 +38,13 @@ export const lang = { cellSize: "Cell size", borderSize: "Line size", borderColor: "Line color", + outerBorders: "Outer borders", + borders: "Borders", + texts: "Texts", + highlight: "Highlight", + splits: "Splits", + spaces: 'Spaces', + fills: "Fills", outBorderSize: "Border size", outBorderColor: "Border color", spaceWidth: "Space size", diff --git a/client/src/i18n/languages/es-es.ts b/client/src/i18n/languages/es-es.ts index 66b6e8e..4db6f95 100644 --- a/client/src/i18n/languages/es-es.ts +++ b/client/src/i18n/languages/es-es.ts @@ -19,7 +19,7 @@ export const lang = { newGrid: "Nueva cuadrícula", newStyle: "Nuevo estilo", print: "Imprimir", - export: "Exportar", + exportsvg: "Exportar SVG", support: "Support MotsFlex", }, @@ -29,6 +29,8 @@ export const lang = { forms: { title: "Título", options: "Opciones", + default: 'Por defecto', + solutions: "Soluciones", gridSize: "Tamaño de la cuadrícula", comment: "Comentario", rows: "Filas", @@ -37,6 +39,13 @@ export const lang = { cellSize: "Tamaño de las celdas", borderSize: "Tamaño de las líneas", borderColor: "Color de las líneas", + outerBorders: "Bordes exteriores", + borders: "Bordes internos", + texts: "Textos", + highlight: "Resaltado", + splits: "Divisiones", + spaces: 'Espacios', + fills: "Rellenos", outBorderSize: "Tamaño de los bordes", outBorderColor: "Color de los bordes", spaceWidth: "Tamaño de los espacios", diff --git a/client/src/i18n/languages/fr-fr.ts b/client/src/i18n/languages/fr-fr.ts index 5ce6ec7..492d3ff 100644 --- a/client/src/i18n/languages/fr-fr.ts +++ b/client/src/i18n/languages/fr-fr.ts @@ -11,6 +11,7 @@ export const lang = { buttons: { changeLanguage: "Traduire", delete: "Supprimer", + cancel: 'Annuler', create: "Créer", yes: "Oui", no: "Non", @@ -19,7 +20,7 @@ export const lang = { newGrid: "Nouvelle grille", newStyle: "Nouveau style", print: "Imprimer", - export: "Exporter", + exportsvg: "Export SVG", support: "Support MotsFlex", }, suggestions: { @@ -28,6 +29,8 @@ export const lang = { forms: { title: "Titre", options: "Options", + default: 'Défaut', + solutions: "Solutions", gridSize: "Taille de la grille", comment: "Commentaire", rows: "Lignes", @@ -36,6 +39,13 @@ export const lang = { cellSize: "Taille des cellules", borderSize: "Taille des lignes", borderColor: "Couleur des lignes", + outerBorders: "Bordures extérieures", + borders: "Bordures intérieures", + texts: "Textes", + highlight: "Surlignage", + splits: "Séparations", + spaces: 'Espaces', + fills: "Remplissages", outBorderSize: "Taille des bordures", outBorderColor: "Couleur des bordures", spaceWidth: "Taille des espaces", @@ -75,6 +85,9 @@ export const lang = { noarrow: "n'a pas de flèche", add: "Ajouter {word} au dictionnaire", }, + modals: { + exportTitle: "Export", + }, alert: { wrongpassword: "Mot de passe ou email incorrect.", passwordsdontmatch: "Les mots de passe ne correspondent pas.", diff --git a/client/src/router/index.ts b/client/src/router/index.ts index aeb5f8b..1b8d3e9 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -1,4 +1,4 @@ -import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'; +import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'; import { api } from '../api'; const routes: Array = [ @@ -97,7 +97,7 @@ const routes: Array = [ ]; const router = createRouter({ - history: createWebHistory(), + history: createWebHashHistory(''), routes }); @@ -107,7 +107,7 @@ router.beforeEach(async (to, from) => { !isSignedin && to.meta.requiresAuth !== false ) { - return { name: 'login' }; + return { name: 'login', query: {redirect: to.name} }; } }); diff --git a/client/src/views/Grids.vue b/client/src/views/Grids.vue index 646b75c..b09ca63 100644 --- a/client/src/views/Grids.vue +++ b/client/src/views/Grids.vue @@ -1,6 +1,6 @@ diff --git a/client/src/components/forms/TextStyle.vue b/client/src/components/forms/TextStyle.vue index d08d76b..cc1a9b8 100644 --- a/client/src/components/forms/TextStyle.vue +++ b/client/src/components/forms/TextStyle.vue @@ -1,6 +1,5 @@ diff --git a/client/src/components/fonts/FontSelector.vue b/client/src/components/fonts/FontSelector.vue index 32e6fcb..88dfe62 100644 --- a/client/src/components/fonts/FontSelector.vue +++ b/client/src/components/fonts/FontSelector.vue @@ -1,6 +1,6 @@