Skip to content

Commit d3d404e

Browse files
committed
[WIP] 閲覧者(学生側)ページ作成
1 parent b2eb883 commit d3d404e

File tree

4 files changed

+101
-31
lines changed

4 files changed

+101
-31
lines changed

src/components/CalendarBar.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ export default class CalendarBar extends Vue {
276276
background: rgba(0, 0, 0, 0);
277277
height: 68px;
278278
min-width: 12px;
279-
font-family: 'Noto Sans JP', sans-serif;
280279
281280
.title {
282281
color: $color-base-color-01;
@@ -308,12 +307,12 @@ export default class CalendarBar extends Vue {
308307
flex-direction: column;
309308
background: $color-white;
310309
height: 68px;
311-
min-width: 16px;
312-
border-radius: 30px !important;
310+
min-width: 1rem;
311+
max-width: 3rem;
312+
border-radius: 3em !important;
313313
align-items: center;
314314
justify-content: center;
315315
color: $color-gray;
316-
font-family: 'Noto Sans JP', sans-serif;
317316
margin: 0 3px;
318317
}
319318

src/components/ContentCard.vue

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,18 @@ export default Vue.extend({
4343

4444
<style scoped lang="scss">
4545
.ContentCard {
46-
color: 'black';
46+
color: $color-gray;
4747
border-radius: 14px !important;
4848
.ContentCard-SubjectTag {
4949
margin-right: 4px;
5050
}
5151
.ContentCard-Title {
52-
font-family: 'Noto Sans', sans-serif;
53-
font-style: normal;
5452
font-weight: bold;
5553
font-size: 14px;
56-
line-height: 19px;
57-
color: #424242;
5854
}
5955
.ContentCard-Description {
6056
white-space: pre-wrap;
61-
font-family: 'Noto Sans', sans-serif;
62-
font-style: normal;
63-
font-weight: normal;
6457
font-size: 12px;
65-
line-height: 16px;
66-
color: #424242;
6758
}
6859
}
6960
</style>

src/components/PeriodCard.vue

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<template>
2+
<div class="PeriodCard">
3+
<div class="PeriodCard-NumberBlock">
4+
<div class="PeriodCard-Number">
5+
<span class="PeriodCard-Number-Num">1</span>
6+
<span class="PeriodCard-Number-Text">時間目</span>
7+
</div>
8+
<div class="PeriodCard-Time">
9+
<span>00:00</span>
10+
<span>|</span>
11+
<span>00:00</span>
12+
</div>
13+
</div>
14+
<v-row>
15+
<v-col
16+
v-for="(item, i) in classData.getLessonsByDisplayDate"
17+
:key="i"
18+
cols="12"
19+
md="6"
20+
>
21+
<ContentCard
22+
:description="formatDate(item.startTime)"
23+
:title="item.content"
24+
:subjects="[{ name: item.subject }]"
25+
/>
26+
</v-col>
27+
</v-row>
28+
</div>
29+
</template>
30+
31+
<script lang="ts">
32+
import Vue from 'vue'
33+
import dayjs from 'dayjs'
34+
import ContentCard from '@/components/ContentCard.vue'
35+
36+
export default Vue.extend({
37+
components: { ContentCard },
38+
props: {
39+
classData: {
40+
type: Object,
41+
default: () => {}
42+
}
43+
},
44+
methods: {
45+
formatDate(date: Date): string {
46+
return dayjs(date).format('HH:MM')
47+
}
48+
}
49+
})
50+
</script>
51+
52+
<style scoped lang="scss">
53+
.PeriodCard {
54+
display: flex;
55+
56+
&-NumberBlock {
57+
display: flex;
58+
flex-direction: column;
59+
margin: 12px;
60+
}
61+
62+
&-Number {
63+
display: flex;
64+
flex-direction: column;
65+
align-items: center;
66+
color: $color-white;
67+
background-color: $color-base-color-06;
68+
max-width: 40px;
69+
border-radius: 3em;
70+
padding: 12px 4px;
71+
margin-bottom: 8px;
72+
73+
&-Num {
74+
font-size: 22px;
75+
}
76+
77+
&-Text {
78+
font-size: 8px;
79+
}
80+
}
81+
82+
&-Time {
83+
display: flex;
84+
flex-direction: column;
85+
justify-content: center;
86+
text-align: center;
87+
font-size: 10px;
88+
color: $color-white;
89+
}
90+
}
91+
</style>

src/pages/classes/index.vue

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
<template>
22
<div class="MainPage">
3-
<v-row v-if="classData.getLessonsByDisplayDate.length" class="DataBlock">
4-
<v-col
5-
v-for="(item, i) in classData.getLessonsByDisplayDate"
6-
:key="i"
7-
cols="12"
8-
md="6"
9-
>
10-
<ContentCard
11-
:description="formatDate(item.startTime)"
12-
:title="item.content"
13-
:subjects="[{ name: item.subject }]"
14-
/>
15-
</v-col>
16-
</v-row>
17-
3+
<period-card
4+
v-if="classData.getLessonsByDisplayDate.length"
5+
:class-data="classData"
6+
/>
187
<v-row v-else-if="today" class="DataBlock">
198
<h1 style="color: white; width: 100vw; text-align: center;">
209
今日の時間割はまだ届いていないみたいです
@@ -33,7 +22,7 @@ import Vue from 'vue'
3322
import dayjs from 'dayjs'
3423
import isToday from 'date-fns/isToday'
3524
import { vxm } from '@/store'
36-
import ContentCard from '@/components/ContentCard.vue'
25+
import PeriodCard from '@/components/PeriodCard.vue'
3726
3827
type Data = {
3928
classData: typeof vxm.classData
@@ -42,7 +31,7 @@ type Data = {
4231
}
4332
4433
export default Vue.extend({
45-
components: { ContentCard },
34+
components: { PeriodCard },
4635
layout: 'classes',
4736
data(): Data {
4837
return {

0 commit comments

Comments
 (0)