diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 3dafe85..2dfdff8 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -55,12 +55,7 @@ export default defineComponent({ diff --git a/frontend/src/components/Home.vue b/frontend/src/components/Home.vue index d5cf97a..be3f3fb 100644 --- a/frontend/src/components/Home.vue +++ b/frontend/src/components/Home.vue @@ -22,7 +22,6 @@ export default defineComponent({ data() { return { imageSelectedId: -1, - timer: null as ReturnType | null, editor: false, filter: undefined as Filter | undefined, } @@ -47,35 +46,29 @@ export default defineComponent({ this.imageSelectedId = id; else this.imageSelectedId = this.images.keys().next().value; - }, - startTimer() { - if (this.timer !== null) - clearTimeout(this.timer); - this.timer = setTimeout(() => { - this.editor = !this.editor; - }, 1900); - }, - clearTimer() { - if (this.timer !== null) { - clearTimeout(this.timer); - this.timer = null; - } } } }) diff --git a/frontend/src/components/HomeEditor.vue b/frontend/src/components/HomeEditor.vue index a5b8275..473625f 100644 --- a/frontend/src/components/HomeEditor.vue +++ b/frontend/src/components/HomeEditor.vue @@ -17,7 +17,7 @@ export default defineComponent({ filterSelectId: 0, open: false, filters: [] as Filter[], - error: false, + error: "", } }, created() { @@ -27,6 +27,8 @@ export default defineComponent({ }, methods: { applyFilter() { + if (this.error !== "") + return; if (this.filterSelectId === 0) { this.$emit("applyFilter", undefined); return; @@ -34,11 +36,37 @@ export default defineComponent({ const filter = clone(this.filters[this.filterSelectId - 1]); for (const arg of filter.parameters) { if (arg.value === undefined) { - this.error = true; + this.error = ""; return; } } this.$emit("applyFilter", filter); + }, + areInputValid() { + if (this.filterSelectId === 0) + return ""; + for (const p of this.filters[this.filterSelectId - 1].parameters) { + const input = document.getElementById(p.name) as HTMLInputElement; + if (input === null) + return ""; + if (!input.checkValidity()) + return "Paramètre(s) du filtre invalide(s)"; + } + return ""; + } + }, + watch: { + filters: { + handler() { + for (const f of this.filters) { + for (const p of f.parameters) { + if (p.value === undefined) + p.value = Math.round((p.max - Math.abs(p.min)) / 2); + } + } + this.error = this.areInputValid(); + }, + deep: true } } }) @@ -62,12 +90,17 @@ export default defineComponent({
- +
+ + +
- + @@ -90,7 +123,7 @@ label { gap: 10px; } -.erreurClass { +.errorClass { background-color: red; color: white; } diff --git a/frontend/src/navi.css b/frontend/src/navi.css new file mode 100644 index 0000000..35e037f --- /dev/null +++ b/frontend/src/navi.css @@ -0,0 +1,43 @@ +.navi { + /* reduce size of children */ + display: flex; + flex-direction: row-reverse; + pointer-events: none; + gap: 3vw; +} + +.navi ul>li { + position: relative; + display: flex; + align-items: center; + justify-content: center; +} + +.navi h3, +.navi a { + min-width: 90px; + padding: 5px 15px; + border-radius: 60px; + color: rgb(172, 165, 154); + text-decoration: none; + font-family: "Aeonik", sans-serif; +} + +.navi nav { + display: flex; + justify-content: center; + padding-left: 20px; + height: 60px; + padding-right: 20px; + border-radius: 60px; + background-color: rgb(24, 26, 27); + margin-right: 20px; + pointer-events: auto; +} + + +.navi ul { + display: flex; + list-style: none; + padding-inline-start: 0; +} \ No newline at end of file