forked from FreeTubeApp/FreeTube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft-profile-edit.vue
108 lines (107 loc) · 2.85 KB
/
ft-profile-edit.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
<template>
<div>
<ft-card
big
class="card"
>
<h2>{{ $t("Profile.Edit Profile") }}</h2>
<ft-flex-box>
<ft-input
class="profileName"
placeholder="Profile Name"
:value="profileName"
:show-action-button="false"
@input="e => profileName = e"
/>
</ft-flex-box>
<h3>{{ $t("Profile.Color Picker") }}</h3>
<ft-flex-box
class="bottomMargin colorOptions"
>
<div
v-for="(color, index) in colorValues"
:key="index"
class="colorOption"
:title="color + ' ' + $t('Profile.Custom Color')"
:style="{ background: color }"
tabindex="0"
@click="profileBgColor = color"
@keydown.space.prevent="profileBgColor = color"
@keydown.enter.prevent="profileBgColor = color"
/>
</ft-flex-box>
<ft-flex-box
class="bottomMargin"
>
<div>
<label for="colorPicker">{{ $t("Profile.Custom Color") }}</label>
<input
id="colorPicker"
v-model="profileBgColor"
type="color"
>
</div>
</ft-flex-box>
<ft-flex-box>
<ft-input
class="profileName"
placeholder=""
:value="profileBgColor"
:show-action-button="false"
:disabled="true"
/>
</ft-flex-box>
<h3>{{ $t("Profile.Profile Preview") }}</h3>
<ft-flex-box
class="bottomMargin"
>
<div
class="colorOption"
:style="{ background: profileBgColor, color: profileTextColor }"
style="cursor: default"
>
<div
class="initial"
>
{{ profileInitial }}
</div>
</div>
</ft-flex-box>
<ft-flex-box>
<ft-button
v-if="isNew"
:label="$t('Profile.Create Profile')"
@click="saveProfile"
/>
<template
v-else
>
<ft-button
:label="$t('Profile.Update Profile')"
@click="saveProfile"
/>
<ft-button
:label="$t('Profile.Make Default Profile')"
@click="setDefaultProfile"
/>
<ft-button
v-if="!isMainProfile"
:label="$t('Profile.Delete Profile')"
text-color="var(--text-with-main-color)"
background-color="var(--primary-color)"
@click="openDeletePrompt"
/>
</template>
</ft-flex-box>
</ft-card>
<ft-prompt
v-if="showDeletePrompt"
:label="deletePromptLabel"
:option-names="deletePromptNames"
:option-values="deletePromptValues"
@click="handleDeletePrompt"
/>
</div>
</template>
<script src="./ft-profile-edit.js" />
<style scoped src="./ft-profile-edit.scss" lang="scss" />