Skip to content

Commit 562f7bc

Browse files
committed
wip:CallControlButtonの中身をAIconで置き換え
1 parent b3fd388 commit 562f7bc

File tree

5 files changed

+49
-31
lines changed

5 files changed

+49
-31
lines changed
File renamed without changes.

src/assets/mdi.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ import {
8080
mdiFormatTitle,
8181
mdiCloseCircle,
8282
mdiNotebook,
83-
mdiDelete
83+
mdiDelete,
84+
mdiVideo,
85+
mdiVideoOff
8486
} from '@mdi/js'
8587

8688
interface MdiIconsMapping {
@@ -169,7 +171,9 @@ const mdi: MdiIconsMapping = {
169171
stop: mdiStop,
170172
crown: mdiCrown,
171173
'format-title': mdiFormatTitle,
172-
delete: mdiDelete
174+
delete: mdiDelete,
175+
video: mdiVideo,
176+
'video-off': mdiVideoOff
173177
}
174178

175179
export default mdi

src/components/Main/MainView/QallView/CallControlButton.vue

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { defineProps, computed, useCssModule } from 'vue'
3+
import AIcon from '/@/components/UI/AIcon.vue'
34
45
const props = defineProps({
56
icon: {
@@ -13,6 +14,14 @@ const props = defineProps({
1314
isOn: {
1415
type: Boolean,
1516
required: true
17+
},
18+
inverted: {
19+
type: Boolean,
20+
default: false
21+
},
22+
mdi: {
23+
type: Boolean,
24+
default: true
1625
}
1726
})
1827
@@ -24,14 +33,19 @@ const buttonClass = computed(() => ({
2433
[style.off]: !props.isOn
2534
}))
2635
36+
const iconClass = computed(() => ({
37+
[style.icon]: true,
38+
[style.inverted]: props.inverted
39+
}))
40+
2741
function handleClick() {
2842
props.onClick?.()
2943
}
3044
</script>
3145

3246
<template>
3347
<button :class="buttonClass" @click="handleClick">
34-
<img v-if="icon" :src="icon" alt="Call control" />
48+
<AIcon v-if="icon" :name="icon" :mdi="mdi" :size="32" :class="iconClass" />
3549
</button>
3650
</template>
3751

@@ -58,4 +72,16 @@ function handleClick() {
5872
.callControlButton:hover {
5973
opacity: 0.85;
6074
}
75+
76+
.icon {
77+
width: 32px;
78+
height: 32px;
79+
display: flex;
80+
align-items: center;
81+
justify-content: center;
82+
}
83+
84+
.inverted {
85+
filter: invert(1);
86+
}
6187
</style>

src/components/Main/MainView/QallView/QallView.vue

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import { onMounted, ref } from 'vue'
55
import VideoComponent from '/@/components/Main/MainView/QallView/VideoTrack.vue'
66
import AudioComponent from '/@/components/Main/MainView/QallView/AudioTrack.vue'
77
import DanmakuContainer from './DanmakuContainer.vue'
8-
import CallControlButton from './CallControlButton.vue'
98
import CallControlButtonSmall from './CallControlButtonSmall.vue'
9+
import CallControlButton from './CallControlButton.vue'
1010
import ScreenShareComponent from './ScreenShareComponent.vue'
1111
import { LocalTrackPublication } from 'livekit-client'
12-
import ChannelViewContentMain from '../ChannelView/ChannelViewContent/ChannelViewContentMain.vue'
1312
import QallMessageView from './QallMessageView.vue'
1413
1514
const {
@@ -26,20 +25,10 @@ const isMicOn = ref(true)
2625
const isCameraOn = ref(false)
2726
const isScreenSharing = ref(false)
2827
29-
const micIcon = ref(
30-
isMicOn.value
31-
? '/@/assets/icons/mic.svg?url'
32-
: '/@/assets/icons/mic_off.svg?url'
33-
)
34-
const cameraIcon = ref(
35-
isCameraOn.value
36-
? '/@/assets/icons/videocam.svg?url'
37-
: '/@/assets/icons/videocam_off.svg?url'
38-
)
28+
const micIcon = ref(isMicOn.value ? 'microphone' : 'microphone-off')
29+
const cameraIcon = ref(isCameraOn.value ? 'vide' : 'video-off')
3930
const screenShareIcon = ref(
40-
isScreenSharing.value
41-
? '/@/assets/icons/stop_screen_share.svg?url'
42-
: '/@/assets/icons/screen_share.svg?url'
31+
isScreenSharing.value ? 'stop-screen-share' : 'screen-share'
4332
)
4433
4534
const toggleAudio = async () => {
@@ -56,9 +45,7 @@ const toggleAudio = async () => {
5645
await trackInfo.trackPublication.track.unmute()
5746
}
5847
isMicOn.value = !isMicOn.value
59-
micIcon.value = isMicOn.value
60-
? '/@/assets/icons/mic.svg?url'
61-
: '/@/assets/icons/mic_off.svg?url'
48+
micIcon.value = isMicOn.value ? 'microphone' : 'microphone-off'
6249
break
6350
}
6451
}
@@ -86,9 +73,7 @@ const toggleVideo = async () => {
8673
}
8774
isCameraOn.value = false
8875
}
89-
cameraIcon.value = isCameraOn.value
90-
? '/@/assets/icons/videocam.svg?url'
91-
: '/@/assets/icons/videocam_off.svg?url'
76+
cameraIcon.value = isCameraOn.value ? 'video' : 'video-off'
9277
} catch (err) {
9378
console.error('Failed to toggle video:', err)
9479
}
@@ -114,8 +99,8 @@ const toggleScreen = async () => {
11499
isScreenSharing.value = false
115100
}
116101
screenShareIcon.value = isScreenSharing.value
117-
? '/@/assets/icons/stop_screen_share.svg?url'
118-
: '/@/assets/icons/screen_share.svg?url'
102+
? 'stop-screen-share'
103+
: 'screen-share'
119104
} catch (err) {
120105
console.error('Failed to toggle screen sharing:', err)
121106
}
@@ -245,23 +230,26 @@ const backgroundType = ref<'original' | 'blur' | 'file' | 'screen'>('original')
245230
<div :class="$style.verticalBar"></div>
246231
<CallControlButton
247232
:icon="screenShareIcon"
248-
:on-click="toggleScreen"
249233
:is-on="isScreenSharing"
234+
:on-click="toggleScreen"
235+
:mdi="false"
250236
/>
251237
<CallControlButton
252238
:icon="cameraIcon"
253-
:on-click="toggleVideo"
254239
:is-on="isCameraOn"
240+
:on-click="toggleVideo"
241+
:inverted="!isCameraOn"
255242
/>
256243
<CallControlButton
257244
:icon="micIcon"
258-
:on-click="toggleAudio"
259245
:is-on="isMicOn"
246+
:on-click="toggleAudio"
247+
:inverted="!isMicOn"
260248
/>
261249
<CallControlButton
262-
icon="/@/assets/icons/call_end.svg?url"
263-
:on-click="leaveQall"
250+
icon="phone-hangup"
264251
:is-on="false"
252+
:on-click="leaveQall"
265253
/>
266254
<div :class="$style.verticalBar"></div>
267255
<div :class="$style.smallButtonGroup">

0 commit comments

Comments
 (0)