From 718482cdddf5d8b44a4a769695bd50ee69de7cb0 Mon Sep 17 00:00:00 2001 From: RemiSaurel Date: Fri, 26 Aug 2022 12:43:32 +0200 Subject: [PATCH] full refactoring + improve responsive --- src/App.vue | 51 +++----- src/components/Infos.vue | 38 +++--- src/components/Pomodoro.vue | 86 ++++++------- src/components/Settings.vue | 23 ++-- src/components/Socials.vue | 6 +- src/components/ToDoList.vue | 237 +++++++++++++++++------------------ src/components/YtbPlayer.vue | 2 +- src/store/index.js | 3 +- 8 files changed, 214 insertions(+), 232 deletions(-) diff --git a/src/App.vue b/src/App.vue index 8e72fac..356042a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -64,16 +64,6 @@ button:disabled { cursor: not-allowed; } -footer { - display: flex; - justify-content: center; - margin-top: 24px; -} - -footer > div { - margin-right: 16px; -} - #nav-bar { margin-top: 8px; margin-left: 16px; @@ -90,10 +80,6 @@ footer > div { box-shadow: rgba(0, 0, 0) 0px 4px 10px; } -#pomodoro { - width: 100%; -} - #container { display: flex; flex-direction: row; @@ -112,28 +98,27 @@ footer > div { margin-left: 32px; } +/* ********** */ +/* RESPONSIVE */ +/* ********** */ + +@media (max-width: 835px) { + #container{ + flex-direction: column; + } + #todo-container { + width: 100%; + } + #right-side { + margin-right: 32px; + margin-left: 32px; + width: auto; + } +} + @media (max-width: 330px) { #right-side { display: none; } } - -@media (max-width: 675px) { - #todo-container { - width: 100%; - } - #right-side { - width: auto; - margin-top: 16px; - } - - #container { - display: block; - } - #ytb-player { - display: none; - } - -} - diff --git a/src/components/Infos.vue b/src/components/Infos.vue index aaaa43e..e7a9dda 100644 --- a/src/components/Infos.vue +++ b/src/components/Infos.vue @@ -16,7 +16,7 @@
{{ this.word.definition }}
-
+
@@ -26,7 +26,7 @@
@@ -35,7 +35,7 @@ Total sessions: {{this.$store.getters.nbSessions}}
@@ -148,7 +148,6 @@ export default { position: relative; background: #504746; width: 100%; - height: 300px; border-radius: 16px; padding: 16px 24px 18px 24px; color: white; @@ -162,7 +161,6 @@ export default { font-size: 36px; } - #word-definition { margin-top: 16px; } @@ -179,17 +177,14 @@ export default { font-weight: lighter; } -#btn { +#btn-newword { text-align: center; - margin-top: 24px; + margin-top: 16px; } .btn { font-size: 20px; padding: 8px; -} - -#fetch { margin-bottom: 8px; } @@ -205,12 +200,9 @@ export default { #see-words { margin-top: 16px; } - -@media (max-width: 835px) { - #container-infos { - display: none; - } -} +/* ********** */ +/* RESPONSIVE */ +/* ********** */ @media (max-width: 1400px) { #time { @@ -218,4 +210,18 @@ export default { } } +@media (max-width: 835px) { + #container-infos { + width: 50%; + margin-left: 8px; + } +} + + +@media (max-width: 550px) { + #container-infos { + display: none; + } +} + \ No newline at end of file diff --git a/src/components/Pomodoro.vue b/src/components/Pomodoro.vue index d09afbf..82e9f5b 100644 --- a/src/components/Pomodoro.vue +++ b/src/components/Pomodoro.vue @@ -135,7 +135,7 @@ export default { } else { alert("SESSION TERMINÉE 👏"); this.nbSessionsFinished++; - this.$store.commit("setNbSessions"); + this.$store.commit("updateNbSessionsFinished"); if (this.nbSessionsFinished === 4) { this.setupPauseTimer(LONG_PAUSE); this.nbSessionsFinished = 0; @@ -199,9 +199,9 @@ export default { this.seconds = "0" + this.seconds; } if (this.isRestingTime) { - document.title = "PAUSE 👏 " + this.minutes + ":" + this.seconds; + document.title = "🏖 " + this.minutes + ":" + this.seconds; } else { - document.title = "WORKING 🍅 " + this.minutes + ":" + this.seconds; + document.title = "🍅 " + this.minutes + ":" + this.seconds; } } }, @@ -305,27 +305,41 @@ export default { -webkit-transform: rotate(45deg); } -@media (min-width: 635px) { +#message { + font-size: 1.6rem; +} + +.dot { + height: 25px; + width: 25px; + background-color: lightslategrey; + border-radius: 50%; + margin: 12px 4px 12px 4px; + display: inline-block; +} + +.active { + height: 25px; + width: 25px; + background-color: mediumseagreen; + border-radius: 50%; + margin: 12px 4px 12px 4px; + display: inline-block; +} +/* ********** */ +/* RESPONSIVE */ +/* ********** */ + +@media (max-width: 835px) { + #container { + margin-top: 16px; + } #message { font-size: 1.6rem; } - - .dot { - height: 25px; - width: 25px; - background-color: lightslategrey; - border-radius: 50%; - margin: 12px 4px 12px 4px; - display: inline-block; - } - - .active { - height: 25px; - width: 25px; - background-color: mediumseagreen; - border-radius: 50%; - margin: 12px 4px 12px 4px; - display: inline-block; + .pomodoro { + margin-right: 8px; + width: 50%; } } @@ -337,38 +351,12 @@ export default { margin-right: 8px; margin-left: 8px; } - #container { - margin-left: 16px; - margin-right: 16px; - } } -@media (max-width: 835px) { +@media (max-width: 550px) { .pomodoro { - margin-right: 0px; width: 100%; - } - - #message { - font-size: 1.6rem; - } - - .dot { - height: 25px; - width: 25px; - background-color: lightslategrey; - border-radius: 50%; - margin: 12px 4px 12px 4px; - display: inline-block; - } - - .active { - height: 25px; - width: 25px; - background-color: mediumseagreen; - border-radius: 50%; - margin: 12px 4px 12px 4px; - display: inline-block; + margin-right: 0; } } diff --git a/src/components/Settings.vue b/src/components/Settings.vue index f7dca1f..fbae9bd 100644 --- a/src/components/Settings.vue +++ b/src/components/Settings.vue @@ -1,8 +1,8 @@ diff --git a/src/store/index.js b/src/store/index.js index 7795e76..bcf28cb 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,6 +1,5 @@ // store/index.js - import Vue from "vue"; import Vuex from "vuex"; @@ -29,7 +28,7 @@ export default new Vuex.Store({ setColorSelected(state, color) { state.colorSelected = color; }, - setNbSessions(state) { + updateNbSessionsFinished(state) { state.nbSessions++; } },