Skip to content

Commit 46f86c4

Browse files
committed
Info block on popup
1 parent 6305818 commit 46f86c4

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

src/_locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@
131131
"pomodoroMode": {
132132
"message": "Pomodoro"
133133
},
134+
"pomodoroSettings": {
135+
"message": "Pomodoro Settings"
136+
},
134137
"pomodoro": {
135138
"message": "Pomodoro",
136139
"description": "The Pomodoro method is a time management technique based on alternating periods of focused work and rest. According to the classics of the Pomodoro method, the work period lasts 25 minutes, the rest period is 5 minutes."

src/assets/css/dark.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,10 @@
4242
}
4343
.dark .header span{
4444
color: rgb(255 255 255);
45+
}
46+
.dark .review-block p{
47+
color:#303030;
48+
}
49+
.dark .pomodoro-popup-block p{
50+
color:#303030;
4551
}

src/components/PomodoroInfo.vue

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<template>
2+
<div class="pomodoro-popup-block" v-if="isEnabled">
3+
<p>Pomodoro Mode is enabled</p>
4+
<span v-if="isWorkingTime">WORK</span>
5+
<span v-if="!isWorkingTime">REST</span>
6+
<input
7+
type="button"
8+
:value="t('pomodoroSettings.message')"
9+
@click="openPage(SettingsTab.Pomodoro)"
10+
/>
11+
</div>
12+
</template>
13+
14+
<script lang="ts">
15+
export default {
16+
name: 'PomodoroInfo',
17+
};
18+
</script>
19+
20+
<script lang="ts" setup>
21+
import { computed, onMounted, ref } from 'vue';
22+
import { StorageParams, IS_POMODORO_ENABLED_DEFAULT } from '../storage/storage-params';
23+
import { useI18n } from 'vue-i18n';
24+
import { injecStorage } from '../storage/inject-storage';
25+
import { openPage } from '../utils/open-page';
26+
import { SettingsTab } from '../utils/enums';
27+
import { checkPomodoro } from '../functions/pomodoro';
28+
29+
const { t } = useI18n();
30+
const settingsStorage = injecStorage();
31+
32+
const isEnabled = ref<boolean>();
33+
const isWorkingTime = ref<boolean>();
34+
35+
onMounted(async () => {
36+
isEnabled.value = await settingsStorage.getValue(
37+
StorageParams.IS_POMODORO_ENABLED,
38+
IS_POMODORO_ENABLED_DEFAULT,
39+
);
40+
41+
isWorkingTime.value = (await checkPomodoro())?.isWork;
42+
});
43+
</script>
44+
45+
<style scoped>
46+
.pomodoro-popup-block {
47+
width: -webkit-fill-available;
48+
position: fixed;
49+
bottom: 0;
50+
padding: 8px 20px;
51+
font-size: 14px;
52+
background-color: #efefef;
53+
}
54+
.pomodoro-popup-block p {
55+
display: inline-block;
56+
margin: 8px;
57+
font-size: 17px;
58+
font-weight: 500;
59+
}
60+
.pomodoro-popup-block span {
61+
padding: 5px;
62+
background-color: rgb(105, 202, 105);
63+
color: black;
64+
margin-left: 10px;
65+
border-radius: 5px;
66+
font-weight: 500;
67+
font-size: 13px;
68+
}
69+
.pomodoro-popup-block input[type='button'] {
70+
float: right;
71+
}
72+
</style>

src/components/Review.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ async function openStore() {
8282
display: inline-block;
8383
margin: 8px;
8484
font-size: 17px;
85+
font-weight: 500;
8586
}
8687
.review-block img {
8788
padding: 9px 0 0 0;

src/pages/Popup.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
</section>
8989
</div>
9090
</div>
91+
<PomodoroInfo />
9192
<Review />
9293
</template>
9394

@@ -97,6 +98,7 @@ import { useI18n } from 'vue-i18n';
9798
import TabList from '../components/TabList.vue';
9899
import ByDays from '../components/ByDays.vue';
99100
import Review from '../components/Review.vue';
101+
import PomodoroInfo from '../components/PomodoroInfo.vue';
100102
import { openPage } from '../utils/open-page';
101103
import { SettingsTab, TypeOfList } from '../utils/enums';
102104
import { injecStorage } from '../storage/inject-storage';

0 commit comments

Comments
 (0)