-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.vue
167 lines (152 loc) · 3.73 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<template>
<div class="body">
<Header @login="show" id="top" />
<Warning
v-if="jwtStore.jwt && showWarning"
@closeWarning="showWarning = false"
/>
<p class="presentation">
Cette page est là pour vous permettre de suivre les activités de l'Union
des Rôlistes, plus particulièrement l'avancée de ses missions relatives au
jeu UnityStation, qu'il s'agisse d'une participation au développement du
jeu, d'activités liées ou d'évènements de streaming.
</p>
<ProgressBar v-if="tasks" />
<div class="btns" v-if="jwtStore.role === 'ADMIN' && jwtStore.jwt">
<button class="add-task-btn" @click="showAddTask = true">
<span class="material-symbols-outlined"> note_add </span> Ajouter une
tâche
</button>
<button class="add-person-btn" @click="showAddUser = true">
<span class="material-symbols-outlined" @click="showAddUser = true">
person_add</span
>
Ajouter un utilisateur
</button>
</div>
<LoginForm :show-form="showForm" @close="closeForm" />
<TaskList />
<UserList v-if="jwtStore.jwt && jwtStore.role === 'ADMIN'" />
<AddTaskForm
v-if="showAddTask && jwtStore.role === 'ADMIN' && jwtStore.jwt"
@close="showAddTask = false"
/>
<AddUserForm
v-if="showAddUser && jwtStore.role === 'ADMIN' && jwtStore.jwt"
@close="showAddUser = false"
/>
<a href="" v-if="showScrollToTop" @click.prevent="scrollToTop"
><img
class="scroll-to-top"
src="./assets/img/arrow_up.png"
alt="scroll-to-top"
/></a>
<Footer />
</div>
</template>
<script setup>
import { useJwtStore } from "./stores/jwt";
import { useTaskStore } from "./stores/task";
const jwtStore = useJwtStore();
const taskStore = useTaskStore();
const tasks = await taskStore.setTasks();
const showForm = ref(false);
const showAddTask = ref(false);
const showAddUser = ref(false);
const showScrollToTop = ref(false);
const showWarning = ref(true);
const show = () => {
showForm.value = true;
};
const closeForm = () => {
showForm.value = false;
};
if (typeof window !== "undefined")
window.onscroll = () => {
if (window.scrollY > 100) {
showScrollToTop.value = true;
} else {
showScrollToTop.value = false;
}
};
const scrollToTop = () => {
window.scrollTo({
top: 0,
behavior: "smooth",
});
};
</script>
<style scoped>
* {
font-family: "Ubuntu", sans-serif;
color: white;
}
html {
scroll-behavior: smooth;
}
.body {
background-color: #171e27;
position: absolute;
top: 0;
left: 0;
right: 0;
display: column;
}
.presentation {
text-align: justify;
margin-top: 5rem;
margin-bottom: 5rem;
font-size: 1.2em;
width: 75vw;
margin-left: auto;
margin-right: auto;
}
.btns {
display: flex;
margin-top: 5rem;
justify-content: center;
height: 64px;
}
button {
display: block;
background-color: #8c9cff;
color: white;
font-weight: 600;
border: 1px solid #8c9cff;
border-radius: 5px;
padding: 5px;
margin: 10px;
cursor: pointer;
padding: 0.4em;
}
button:hover {
background-color: #6c7cff;
border: 1px solid #6c7cff;
}
.material-symbols-outlined {
font-family: "Material Symbols Outlined";
font-weight: normal;
font-style: normal;
font-size: 1.5em;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
vertical-align: middle;
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
}
.scroll-to-top {
position: fixed;
bottom: 20px;
right: 20px;
width: 50px;
height: 50px;
}
</style>