Skip to content

Commit

Permalink
feat: 开发消息功能 (#11)
Browse files Browse the repository at this point in the history
* feat: back title

* feat: 本地联调

* feat: 聊天室初始化,以及联动query

* feat: useSocket,online users count

* feat: 调整useSocket、useCreateRoom(优化hook)

* feat: 拆分roomInfo、roomConnect 的 hook

* feat: chat room 基本布局

* feat: chat

* fix: 样式 + emoji

* feat: 拖拽改变元素大小的hook,一些样式fix

* feat: video chat init

* feat: 调试摄像头、audio信息

* feat: video的一些设置,代码优化

* fix: 样式

* feat: 视频聊天的连接测试

* feat: https

* feat: 多人视频通话,待优化整理代码

* feat: 代码优化、边界处理

* feat: 优化一轮使用体验

* feat: 构建相关
  • Loading branch information
xgChange committed Sep 7, 2023
1 parent 40d7619 commit a5ae9d9
Show file tree
Hide file tree
Showing 77 changed files with 3,483 additions and 54 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ package-lock.json


docker/mysql/data/*

client_dist
2 changes: 2 additions & 0 deletions client/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"dev:web": "pnpm -C packages/rtc-web dev"
"dev:web": "pnpm -C packages/rtc-web dev",
"build:web": "pnpm -C packages/rtc-web build"
},
"keywords": [],
"author": "",
Expand Down
3 changes: 2 additions & 1 deletion client/packages/rtc-web/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ module.exports = {
},
plugins: ['vue', '@typescript-eslint', 'prettier'],
rules: {
indent: ['error', 2],
indent: ['error', 2, { offsetTernaryExpressions: true }],
semi: ['error', 'always'],
'vue/attribute-hyphenation': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-debugger': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
};
9 changes: 8 additions & 1 deletion client/packages/rtc-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
"@types/lodash": "^4.14.195",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"@vueuse/core": "^10.2.0",
"@vueuse/router": "^10.2.1",
"dayjs": "^1.11.9",
"lodash": "^4.17.21",
"nanoid": "^4.0.2",
"socket.io-client": "2.3.0",
"vue": "^3.3.4",
"vue-router": "4"
"vue-router": "4",
"vue3-emoji-picker": "^1.1.7",
"vue3-popper": "^1.5.0"
},
"devDependencies": {
"@types/node": "^20.3.1",
Expand All @@ -32,7 +37,9 @@
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0",
"tailwindcss": "^3.3.2",
"terser": "^5.19.4",
"typescript": "^5.1.3",
"vconsole": "^3.15.1",
"vite": "^4.3.9",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-svg-icons": "^2.0.1",
Expand Down
14 changes: 13 additions & 1 deletion client/packages/rtc-web/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
<script lang="ts" setup>
import Layout from '@/layout/index.vue';
import ErrorBoundary from '@/components/error-boundary/index.vue';
import { useErrorCaptured } from '@/hooks';
const errors = useErrorCaptured();
</script>

<!-- 这里后面可以加 provider、区分登录和未登录页面 -->
<template>
<Layout />
<Suspense>
<Layout />
<template v-if="errors.length" #fallback>
<ErrorBoundary
class="h-screen"
:tips-list="['服务器开小差了,请联系管理员']"
/>
</template>
</Suspense>
</template>
20 changes: 20 additions & 0 deletions client/packages/rtc-web/src/assets/styles/index.css
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
@import './tailwindcss';

/* width */
::-webkit-scrollbar {
width: 4px;
}

/* Track */
::-webkit-scrollbar-track {
background: #f1f1f1;
}

/* Handle */
::-webkit-scrollbar-thumb {
background: #888;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/audio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/camera.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/count.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/emoji.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/hang-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/member.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/packages/rtc-web/src/assets/svg-icon/user-smail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script lang="ts" setup>
defineOptions({
name: 'BackPreviousLevel',
});
const emits = defineEmits(['back']);
</script>

<template>
<div class="flex items-center">
<button
class="btn-circle btn border-0 bg-transparent"
@click="emits('back')"
>
<svg-icon name="back" class="h-6 w-6" />
</button>
<slot></slot>
</div>
</template>
26 changes: 26 additions & 0 deletions client/packages/rtc-web/src/components/back/back-title.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script lang="ts" setup>
import { PropType } from 'vue';
defineOptions({
name: 'BackTitle',
});
const props = defineProps({
svgName: {
type: String as PropType<string>,
required: true,
},
title: {
type: String as PropType<string>,
default: '',
},
});
</script>

<template>
<div class="flex items-center">
<!-- <svg-icon :name="props.svgName" class="mr-1 h-8 w-8"></svg-icon> -->
<div v-if="props.title">{{ props.title }}</div>
<slot v-else></slot>
</div>
</template>
2 changes: 2 additions & 0 deletions client/packages/rtc-web/src/components/back/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as BackPreviousLevel } from './back-previous-level.vue';
export { default as BackTitle } from './back-title.vue';
34 changes: 34 additions & 0 deletions client/packages/rtc-web/src/components/base/dropdown.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<script lang="ts" setup>
import { useVModel } from '@vueuse/core';
import { PropType } from 'vue';
defineOptions({
name: 'DropDown',
});
const props = defineProps({
visible: {
type: Boolean as PropType<boolean>,
default: false,
},
});
const emits = defineEmits(['update:visible']);
const visibleVm = useVModel(props, 'visible', emits);
</script>

<template>
<div class="dropdown-top dropdown-end dropdown">
<label tabindex="0">
<slot></slot>
</label>
<div
v-if="visibleVm"
tabindex="0"
class="dropdown-content menu rounded-box z-[1] bg-base-100 shadow"
>
<slot name="content"></slot>
</div>
</div>
</template>
2 changes: 2 additions & 0 deletions client/packages/rtc-web/src/components/base/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { default as SvgIcon } from './svg-icon.vue';
export { default as NavIcons } from './nav-icons.vue';
export { default as Modal } from './modal.vue';
export { default as Dropdown } from './dropdown.vue';
export { default as ToastBox } from './toast.vue';
Loading

0 comments on commit a5ae9d9

Please sign in to comment.