Skip to content

Commit 6f1c486

Browse files
authored
Merge pull request #322 from traPtitech/overlay-update
オーバレイの変更
2 parents 6a01865 + 9a84a41 commit 6f1c486

19 files changed

+138
-172
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ node_modules
77
dist
88
*.local
99

10+
.vscode
11+
1012
/client/src/lib/pb/**
1113
!/client/src/lib/pb/index.ts
1214
/client/src/lib/apis/generated/**

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 開発環境
44

55
golang 1.17
6+
67
node 16
78

89
download https://github.com/protocolbuffers/protobuf/releases

client/src/components/Admin/PresentationStatics.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div :class="$style.presentaionStatics">
2+
<div :class="$style.presentationStatics">
33
<h3>{{ presentation.name }}</h3>
44
<p>{{ presentation.description }}</p>
55
<p>{{ presentation.speakers }}</p>
@@ -45,7 +45,7 @@ import apis, {
4545
Comment,
4646
ReviewStatistics
4747
} from '/@/lib/apis'
48-
import { stampToFileName } from '/@/components/LiveOverlay/reactionRenderer'
48+
import { stampToFileName } from '/@/use/reactionRenderer'
4949
5050
interface State {
5151
reactions: ReactionStatistics | null

client/src/components/CommentList.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<transition-group name="transition" tag="ul" :class="$style.list">
3-
<li v-for="c in comments" :key="c">{{ c }}</li>
3+
<li v-for="c in comments" :key="c" :class="$style.comment">{{ c }}</li>
44
</transition-group>
55
</template>
66

@@ -39,6 +39,13 @@ export default defineComponent({
3939
<style lang="scss" module>
4040
.list {
4141
padding: 0.5rem;
42+
text-align: center;
4243
word-break: break-all;
4344
}
45+
.comment {
46+
background-color: white;
47+
border-radius: 10px;
48+
padding: 0.5rem 10px;
49+
margin: 5px 0;
50+
}
4451
</style>

client/src/components/Live.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default defineComponent({
2727
left: 0;
2828
bottom: 0;
2929
right: 0;
30+
pointer-events: all;
3031
}
3132
.iframe {
3233
height: 100%;
Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
<template>
22
<div :class="$style.container">
3-
<comment-sender v-show="show" />
4-
<button v-show="show" :class="$style.button" @click="$emit('toggleDesc')">
5-
説明
6-
</button>
7-
<button :class="$style.button" @click="$emit('toggle')">表示/非表示</button>
3+
<input
4+
ref="inputRef"
5+
v-model="text"
6+
:class="$style.input"
7+
type="text"
8+
placeholder="コメント"
9+
@keydown.enter="comment"
10+
/>
11+
12+
<div :class="$style.bottomContents">
13+
<button :class="$style.button" @click="$emit('toggle')">
14+
表示/非表示
15+
</button>
16+
<button :class="$style.button" @click="$emit('toggleDesc')">説明</button>
17+
<button :class="$style.button" @click="comment">送信</button>
18+
</div>
819
</div>
920
</template>
1021

1122
<script lang="ts">
1223
import { defineComponent, computed, ref } from 'vue'
1324
import { useStore } from '/@/store'
1425
import { sendComment } from '/@/lib/connect'
15-
import CommentSender from './CommentSender.vue'
26+
import useShortcut from '/@/use/shortcut'
1627
1728
export default defineComponent({
1829
name: 'BottomControls',
19-
components: {
20-
CommentSender
21-
},
22-
props: {
23-
show: {
24-
type: Boolean,
25-
required: true
26-
}
27-
},
2830
emits: {
2931
toggle: () => true,
3032
toggleDesc: () => true
@@ -35,23 +37,43 @@ export default defineComponent({
3537
3638
const text = ref('')
3739
const comment = () => {
40+
if (!text.value) return
3841
sendComment({ presentationId: presentationId.value, text: text.value })
3942
text.value = ''
4043
}
4144
42-
return { text, comment }
45+
const inputRef = ref<HTMLInputElement>()
46+
useShortcut({ key: ' ', ctrlKey: true }, () => {
47+
inputRef.value?.focus()
48+
})
49+
50+
return { text, inputRef, comment }
4351
}
4452
})
4553
</script>
4654

4755
<style lang="scss" module>
4856
.container {
49-
display: flex;
5057
pointer-events: auto;
51-
background: rgba(255, 255, 255, 0.8);
58+
background: white;
59+
text-align: center;
60+
padding: 10px 5%;
61+
}
62+
.input {
63+
width: 100%;
64+
height: 2rem;
65+
border-radius: 20px;
66+
border: 2px solid #c9c1b1;
67+
&:focus {
68+
border-color: #fff344;
69+
}
70+
}
71+
.bottomContents {
72+
display: flex;
73+
flex-direction: row;
74+
justify-content: center;
5275
}
5376
.button {
5477
margin: 0 8px;
55-
padding: 0 8px;
5678
}
5779
</style>

client/src/components/LiveOverlay/CommentPanel.vue

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
22
<div :class="$style.container">
3-
<comment-list v-if="isCommentsShown" :class="$style.list" />
3+
<comment-list :class="$style.list" />
44
<button @click="popupCommentsList">コメントパネルポップアップ</button>
5-
<button @click="toggleIsCommentsShown">コメントパネル表示切替</button>
65
</div>
76
</template>
87

@@ -22,11 +21,6 @@ export default defineComponent({
2221
const store = useStore()
2322
const presentationId = computed(() => store.state.presentation?.id ?? null)
2423
25-
const isCommentsShown = ref(true)
26-
const toggleIsCommentsShown = () => {
27-
isCommentsShown.value = !isCommentsShown.value
28-
}
29-
3024
const comments = ref<string[]>([])
3125
onMounted(async () => {
3226
if (!presentationId.value) return
@@ -54,8 +48,6 @@ export default defineComponent({
5448
}
5549
5650
return {
57-
isCommentsShown,
58-
toggleIsCommentsShown,
5951
comments,
6052
popupCommentsList
6153
}
@@ -68,11 +60,11 @@ export default defineComponent({
6860
display: flex;
6961
flex-direction: column;
7062
width: min(20vw, 20rem);
71-
background: rgba(255, 255, 255, 0.8);
63+
background: #fff9ed;
7264
pointer-events: auto;
7365
}
7466
.list {
75-
height: min(30vh, 30rem);
67+
flex: 1;
7668
overflow-y: scroll;
7769
}
7870
</style>

client/src/components/LiveOverlay/CommentSender.vue

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<template>
22
<div :class="$style.container">
3-
<top-controls :show="show" />
4-
<live-overlay-view :show="show" />
3+
<live-overlay-view :class="$style.overlay" :show="show" />
4+
<stamp-controls :class="$style.stampControls" />
5+
<comment-panel :class="$style.commentPanel" />
56
<bottom-controls
67
:class="$style.bottomControls"
7-
:data-is-shown="show"
8-
:show="show"
98
@toggle="toggle"
109
@toggle-desc="$emit('toggleDesc')"
1110
/>
@@ -14,21 +13,27 @@
1413

1514
<script lang="ts">
1615
import { defineComponent, ref } from 'vue'
17-
import TopControls from './TopControls.vue'
18-
import BottomControls from './BottomControls.vue'
19-
import LiveOverlayView from './LiveOverlayView.vue'
16+
import LiveOverlayView from '/@/components/LiveOverlay/LiveOverlayView.vue'
17+
import StampControls from '/@/components/LiveOverlay/StampControls.vue'
18+
import CommentPanel from '/@/components/LiveOverlay/CommentPanel.vue'
19+
import BottomControls from '/@/components/LiveOverlay/BottomControls.vue'
20+
import { useStore } from '/@/store'
2021
2122
export default defineComponent({
2223
name: 'LiveOverlay',
2324
components: {
24-
TopControls,
2525
LiveOverlayView,
26+
StampControls,
27+
CommentPanel,
2628
BottomControls
2729
},
2830
emits: {
2931
toggleDesc: () => true
3032
},
3133
setup() {
34+
const store = useStore()
35+
store.dispatch.fetchLive()
36+
3237
const show = ref(true)
3338
const toggle = () => {
3439
show.value = !show.value
@@ -41,18 +46,26 @@ export default defineComponent({
4146

4247
<style lang="scss" module>
4348
.container {
44-
position: absolute;
45-
top: 0;
46-
left: 0;
47-
bottom: 0;
48-
right: 0;
49-
display: flex;
50-
flex-direction: column;
51-
pointer-events: none;
49+
height: 100%;
50+
width: 100%;
51+
display: grid;
52+
grid-template: 1fr min-content / 1fr min-content;
53+
}
54+
.overlay {
55+
grid-row: 1;
56+
grid-column: 1;
57+
}
58+
.stampControls {
59+
grid-row: 2;
60+
grid-column: 1;
61+
}
62+
.commentPanel {
63+
grid-row: 1;
64+
grid-column: 2;
65+
min-height: 0;
5266
}
5367
.bottomControls {
54-
&:not([data-is-shown='true']) {
55-
align-self: flex-end;
56-
}
68+
grid-row: 2;
69+
grid-column: 2;
5770
}
5871
</style>

0 commit comments

Comments
 (0)