Skip to content

Commit 961999e

Browse files
authored
Merge pull request #113 from Nekoya3/feature/100-create-app-index
indexページの作成
2 parents 05fe743 + 6e9c04a commit 961999e

File tree

4 files changed

+119
-52
lines changed

4 files changed

+119
-52
lines changed

.github/workflows/firebase-deploy-development.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
- name: Build
3333
run: |
3434
yarn install
35+
node pre_build_script/swEnvBuild.js
3536
yarn build
3637
env:
3738
APIKEY: ${{ secrets.APIKEY_DEV }}

.github/workflows/firebase-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
- name: Build
3333
run: |
3434
yarn install
35+
node pre_build_script/swEnvBuild.js
3536
yarn build
3637
env:
3738
APIKEY: ${{ secrets.APIKEY }}

src/layouts/default.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
Loading
66
</div>
77
</v-overlay>
8+
<v-app-bar fixed app class="bar" elevation="0">
9+
<HeaderLogo />
10+
</v-app-bar>
811
<v-content class="content">
912
<v-container class="px-4 py-8">
1013
<nuxt />
@@ -15,12 +18,16 @@
1518

1619
<script lang="ts">
1720
import Vue from 'vue'
21+
import HeaderLogo from '@/assets/svgs/header_logo.svg'
1822
1923
type LocalData = {
2024
loading: boolean
2125
}
2226
2327
export default Vue.extend({
28+
components: {
29+
HeaderLogo
30+
},
2431
data(): LocalData {
2532
return {
2633
loading: true

src/pages/index.vue

Lines changed: 110 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,99 @@
11
<template>
2-
<div class="LoginPage">
3-
<v-flex>
4-
<div class="Logo">
5-
<Logo style="height: 80vw; max-height: 350px; width: 100%;" />
6-
</div>
7-
{{ errorMessages }}
8-
<div class="LoginForm">
9-
<v-form ref="form" v-model="valid">
10-
<v-text-field
11-
v-model="classId"
12-
:counter="6"
13-
label="クラスID"
14-
:rules="nameRules"
15-
outlined
16-
dark
17-
required
2+
<v-layout justify-center="true" align-center="true">
3+
<v-flex class="indexFlex">
4+
<v-row justify="center" class="mb-3">
5+
<v-icon color="white" size="60px">mdi-library</v-icon>
6+
</v-row>
7+
<v-row justify="center">
8+
<span class="description mb-3">授業をうける生徒・児童の方</span>
9+
</v-row>
10+
<v-row class="loginFieldRow" justify="center">
11+
<input-field
12+
v-model="classId"
13+
class="classIdField"
14+
type="classId"
15+
label="クラスID"
16+
/>
17+
<v-btn
18+
class="classLoginButton ml-3"
19+
color="#FFDB6C"
20+
width="56px"
21+
height="56px"
22+
:disabled="!/^[あ-ん]{6}$/.test(classId)"
23+
:loading="loading"
24+
@click="loginToClass"
25+
>
26+
<v-icon color="black">mdi-arrow-right-bold</v-icon>
27+
</v-btn>
28+
</v-row>
29+
<v-flex fill-width justify="center" class="forTeachers">
30+
<v-row class="mt-10 mb-3" justify="center">
31+
<v-icon color="white" size="60px">mdi-account-circle</v-icon>
32+
</v-row>
33+
<v-row justify="center">
34+
<span class="description mb-3">時間割をつくる先生方</span>
35+
</v-row>
36+
<div style="margin: 0 10px;">
37+
<action-button
38+
text="ユーザー登録する"
39+
class="registerButton"
40+
@click="$router.push('/terms')"
1841
/>
19-
<v-btn
20-
block
21-
outlined
22-
color="white"
23-
height="40px"
24-
:loading="loading"
25-
:disabled="loading || !valid"
26-
@click="loginToClass"
27-
>
28-
LOGIN
29-
</v-btn>
30-
</v-form>
31-
</div>
42+
43+
<action-button
44+
text="ログインする"
45+
class="loginButton"
46+
theme="secondary"
47+
@click="$router.push('/account/login')"
48+
/>
49+
<v-footer color="#004170" padless>
50+
<v-row justify="center" no-gutters>
51+
<v-col class="white--text text-center footerText" cols="12">
52+
<a class="white--text" href="#"> - おうちで時間割について </a>
53+
</v-col>
54+
<v-col class="white--text text-center footerText" cols="12">
55+
<a class="white--text" href="#"> - お問い合わせ </a>
56+
</v-col>
57+
<v-col class="white--text text-center footerText" cols="12">
58+
<nuxt-link class="white--text" to="policy">
59+
- 利用規約
60+
</nuxt-link>
61+
</v-col>
62+
</v-row>
63+
</v-footer>
64+
</div>
65+
</v-flex>
3266
</v-flex>
33-
</div>
67+
<v-snackbar :timeout="5000" :value="error" absolute top color="#C01B61">
68+
クラスIDが正しくありません
69+
</v-snackbar>
70+
</v-layout>
3471
</template>
3572

3673
<script lang="ts">
3774
import Vue from 'vue'
3875
import { vxm } from '@/store'
39-
import Logo from '@/assets/svgs/logo.svg'
76+
import InputField from '@/components/InputField.vue'
77+
import ActionButton from '@/components/ActionButton.vue'
4078
4179
type DataType = {
4280
classId: string
4381
loading: boolean
4482
error: boolean
45-
errorMessages: string
4683
valid: boolean
47-
nameRules: ((v: string) => boolean | string)[]
4884
}
4985
5086
export default Vue.extend({
51-
components: { Logo },
87+
components: {
88+
ActionButton,
89+
InputField
90+
},
5291
data(): DataType {
5392
return {
5493
classId: '',
5594
loading: false,
5695
error: false,
57-
errorMessages: '',
58-
valid: true,
59-
nameRules: [
60-
v => !!v || 'クラスIDは必須です',
61-
v => (v && v.length === 6) || 'クラスIDは6文字のひらがなです'
62-
]
96+
valid: true
6397
}
6498
},
6599
methods: {
@@ -70,26 +104,50 @@ export default Vue.extend({
70104
.then(() => {
71105
this.$router.push('/classes')
72106
})
73-
.catch((e: Error) => {
107+
.catch(() => {
74108
this.loading = false
75109
this.error = true
76-
this.errorMessages = e.message
77110
})
78111
}
79112
}
80113
})
81114
</script>
82115

83116
<style lang="scss" scoped>
84-
.MainPage {
85-
.Logo {
86-
text-align: center;
87-
}
88-
.DataBlock {
89-
margin: 0 -12px;
90-
.studycard {
91-
margin-bottom: 20px;
92-
}
93-
}
117+
.classLoginButton {
118+
border-radius: 14px;
119+
min-width: 48px !important;
120+
}
121+
.description {
122+
color: white;
123+
font-weight: bold;
124+
font-family: 'Noto Sans JP', sans-serif;
125+
}
126+
.forTeachers {
127+
background-color: $color-base-color-07;
128+
border-radius: 24px 24px 24px 24px;
129+
padding-top: 4px;
130+
padding-bottom: 24px;
131+
}
132+
.indexFlex {
133+
max-width: 640px !important;
134+
}
135+
.loginFieldRow {
136+
margin-left: auto !important;
137+
margin-right: auto !important;
138+
}
139+
.loginButton {
140+
font-size: 16px;
141+
font-weight: bold;
142+
margin-top: 10px;
143+
margin-bottom: 15px;
144+
}
145+
.registerButton {
146+
font-size: 16px;
147+
font-weight: bold;
148+
}
149+
.footerText {
150+
margin-top: 15px;
151+
font-size: 12px;
94152
}
95153
</style>

0 commit comments

Comments
 (0)