Skip to content

Commit 963c33d

Browse files
authored
Merge branch 'development' into feature/85-from-cookie-to-localstorage
2 parents 0ba174e + f2aad9c commit 963c33d

File tree

6 files changed

+189
-277
lines changed

6 files changed

+189
-277
lines changed

src/components/CommentButton.vue

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/components/InputField.vue

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
<template>
2+
<v-text-field
3+
v-if="type === 'password'"
4+
v-model="value"
5+
:color="textFieldColor"
6+
:type="show ? 'text' : 'password'"
7+
:hint="hint"
8+
:label="label"
9+
background-color="white"
10+
class="elevation-0"
11+
solo
12+
flat
13+
outlined
14+
>
15+
<template v-slot:prepend-inner>
16+
<v-icon :color="prependIconColor">{{ prependIcon }}</v-icon>
17+
</template>
18+
<template v-slot:append>
19+
<v-icon
20+
color="blue"
21+
@click="show = !show"
22+
v-text="show ? 'mdi-eye' : 'mdi-eye-off'"
23+
/>
24+
</template>
25+
</v-text-field>
26+
<v-text-field
27+
v-else-if="type === 'email'"
28+
v-model="value"
29+
:color="textFieldColor"
30+
type="text"
31+
:hint="hint"
32+
:label="label"
33+
background-color="white"
34+
class="elevation-0"
35+
solo
36+
flat
37+
outlined
38+
>
39+
<template v-slot:prepend-inner>
40+
<v-icon :color="prependIconColor">{{ prependIcon }}</v-icon>
41+
</template>
42+
</v-text-field>
43+
<v-text-field
44+
v-else-if="type === 'classId'"
45+
v-model="value"
46+
:color="textFieldColor"
47+
type="text"
48+
:hint="hint"
49+
:label="label"
50+
background-color="white"
51+
class="elevation-0"
52+
solo
53+
flat
54+
outlined
55+
>
56+
<template v-slot:prepend-inner>
57+
<v-icon :color="prependIconColor">{{ prependIcon }}</v-icon>
58+
</template>
59+
</v-text-field>
60+
<v-text-field
61+
v-else
62+
v-model="value"
63+
:color="textFieldColor"
64+
type="text"
65+
:hint="hint"
66+
:label="label"
67+
background-color="white"
68+
class="elevation-0"
69+
solo
70+
flat
71+
outlined
72+
>
73+
<template v-slot:prepend-inner>
74+
<v-icon :color="prependIconColor">{{ prependIcon }}</v-icon>
75+
</template>
76+
</v-text-field>
77+
</template>
78+
79+
<script lang="ts">
80+
import Vue from 'vue'
81+
type DataType = {
82+
value: string
83+
show: boolean
84+
}
85+
export default Vue.extend({
86+
name: 'InputField',
87+
props: {
88+
type: {
89+
type: String,
90+
required: false,
91+
default: 'text'
92+
},
93+
label: {
94+
type: String,
95+
required: true,
96+
default: ''
97+
},
98+
hint: {
99+
type: String,
100+
required: false,
101+
default: ''
102+
},
103+
appendIcon: {
104+
type: String,
105+
required: false,
106+
default: ''
107+
},
108+
require: {
109+
type: Boolean,
110+
required: false,
111+
default: false
112+
}
113+
},
114+
data(): DataType {
115+
return {
116+
show: false,
117+
value: ''
118+
}
119+
},
120+
computed: {
121+
prependIconColor(): string {
122+
const classIdPattern = /^[あ-ん]{6}$/
123+
if (this.type === 'classId') {
124+
if (!this.value || !classIdPattern.test(this.value)) return '#C01B61'
125+
}
126+
if (this.type === 'email') {
127+
if (
128+
!this.value ||
129+
!this.value.match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)
130+
)
131+
return '#C01B61'
132+
}
133+
if (this.require) {
134+
if (!this.value) return '#C01B61'
135+
}
136+
if (this.value) {
137+
return '#138945'
138+
}
139+
return '#BDBDBD'
140+
},
141+
textFieldColor(): string {
142+
const classIdPattern = /^[あ-ん]{6}$/
143+
if (this.type === 'classId') {
144+
if (!this.value || !classIdPattern.test(this.value)) return '#C01B61'
145+
}
146+
if (this.type === 'email') {
147+
if (
148+
!this.value ||
149+
!this.value.match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)
150+
)
151+
return '#C01B61'
152+
}
153+
if (this.require) {
154+
if (!this.value) return '#C01B61'
155+
}
156+
return '#0071C2'
157+
},
158+
prependIcon(): string {
159+
const classIdPattern = /^[あ-ん]{6}$/
160+
if (this.type === 'classId') {
161+
if (!this.value || !classIdPattern.test(this.value))
162+
return 'mdi-alert-circle'
163+
}
164+
if (this.type === 'email') {
165+
if (
166+
!this.value ||
167+
!this.value.match(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/)
168+
)
169+
return 'mdi-alert-circle'
170+
}
171+
if (this.require) {
172+
if (!this.value) return 'mdi-alert-circle'
173+
}
174+
return 'mdi-check-circle'
175+
}
176+
},
177+
watch: {
178+
value(value) {
179+
this.$emit('input', value)
180+
}
181+
}
182+
})
183+
</script>
184+
185+
<style lang="scss">
186+
.v-input__slot {
187+
box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.3);
188+
}
189+
</style>

src/components/MovieButton.vue

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/components/StudyCard.vue

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)