-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathsettings-modal.vue
More file actions
169 lines (152 loc) · 3.57 KB
/
settings-modal.vue
File metadata and controls
169 lines (152 loc) · 3.57 KB
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
168
169
<template>
<div class="modal">
<div class="modal-container">
<div class="modal-content">
<div class="modal-header">
<h3>Settings</h3>
<Button @click="onClose">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="icon icon-tabler icons-tabler-outline icon-tabler-x"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M18 6l-12 12" />
<path d="M6 6l12 12" />
</svg>
</Button>
</div>
<div class="modal-body">
<label class="checkbox-container">
<input
v-model="settings.value.rawMode"
type="checkbox"
name="rawMode"
/>
<span class="checkbox">
<span class="checkbox-overlay"></span>
</span>
<span class="checkbox-label">Raw Edit Mode </span>
</label>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { settings } from "../stores/settings";
import Button from "./button.vue";
const props = defineProps(["onClose"]);
</script>
<style>
.modal {
position: fixed;
height: 100vh;
width: 100vw;
top: 0;
left: 0;
}
.modal-container {
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
}
.modal-content {
background-color: var(--overlay);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
padding: 20px;
border-radius: 12px;
min-height: 50%;
min-width: 50%;
display: flex;
flex-direction: column;
transition: transform 0.3s ease, opacity 0.3s ease;
}
.modal-content .modal-header {
height: auto;
padding: 0 10px;
padding-bottom: 10px;
border-bottom: 1px solid var(--surface);
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.modal-content .modal-header h3 {
margin: 0;
font-weight: 600;
color: var(--text-primary);
}
.modal-content .modal-body {
padding: 15px 10px 0 10px;
font-size: 14px;
color: var(--text-secondary);
}
.toggle-label {
display: flex;
align-items: center;
gap: 8px;
}
input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
}
.checkbox-container {
display: inline-flex;
position: relative;
gap: 0.5rem;
}
.checkbox-container input[type="checkbox"] {
display: none;
cursor: pointer;
}
.checkbox-container input[type="checkbox"]:after {
opacity: 1;
}
.checkbox-container .checkbox {
display: inline-flex;
position: absolute;
top: 0px;
left: 0px;
justify-content: center;
align-items: center;
width: 1.25rem;
height: 1.25rem;
border-radius: 0.375rem;
border-width: 2px;
background: overlay;
border-color: var(--text);
border-style: solid;
}
.checkbox-container .checkbox-overlay {
transition-property: all;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
transition-duration: 300ms;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
display: inline-block;
width: 0.625rem;
height: 0.625rem;
border-radius: 2px;
opacity: 0;
background: var(--text);
}
.checkbox-container .checkbox-label {
margin-left: 2rem;
}
input[type="checkbox"]:checked ~ .checkbox > .checkbox-overlay{
opacity:1
}
</style>