diff --git a/client/src/App.tsx b/client/src/App.tsx
index 192d56be..4438b756 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -1,12 +1,12 @@
import { useCallback, useEffect } from 'react';
import { BrowserRouter, Route, Redirect, Switch } from 'react-router-dom';
import GlobalStyles from './styles/GlobalStyles';
-import GlobalFonts from './styles/GlobalFonts';
import Introduction from '@pages/Introduction';
import Main from '@pages/Main';
import { useUser, useUserFns } from '@contexts/userContext';
import { getUserByToken } from '@utils/apis';
import Room from '@pages/Room';
+import './styles/fonts.css';
const App = (): JSX.Element => {
const user = useUser();
@@ -36,7 +36,6 @@ const App = (): JSX.Element => {
-
>
);
};
diff --git a/client/src/styles/fonts/dongle-v4-korean-700.woff b/client/src/assets/fonts/dongle-v4-korean-700.woff
similarity index 100%
rename from client/src/styles/fonts/dongle-v4-korean-700.woff
rename to client/src/assets/fonts/dongle-v4-korean-700.woff
diff --git a/client/src/styles/fonts/dongle-v4-korean-700.woff2 b/client/src/assets/fonts/dongle-v4-korean-700.woff2
similarity index 100%
rename from client/src/styles/fonts/dongle-v4-korean-700.woff2
rename to client/src/assets/fonts/dongle-v4-korean-700.woff2
diff --git a/client/src/components/VideoBox.tsx b/client/src/components/VideoBox.tsx
index 0a5c9a83..b6ad5885 100644
--- a/client/src/components/VideoBox.tsx
+++ b/client/src/components/VideoBox.tsx
@@ -7,7 +7,7 @@ import {
} from 'agora-rtc-react';
import styled from 'styled-components';
import defaultImage from '@assets/default-avatar.jpeg';
-import { useEffect, useState } from 'react';
+import { useEffect, useState, useRef, useCallback } from 'react';
const VIDEO_WIDTH = 30;
const VIDEO_HEIGHT = 20;
@@ -31,11 +31,11 @@ const VolumeVisualizer = styled.div`
height: ${VIDEO_HEIGHT}rem;
position: absolute;
right: 0;
- border: 3px solid ${({ theme }) => theme.colors.primary};
+ border: 3px solid ${({ theme }) => theme.colors.blue};
border-radius: ${BORDER_RADIUS};
`;
-const SPEAK_VOLUME = 0.1;
+const SPEAK_VOLUME = 0.2;
const VOLUME_VISUAL_TIME = 1000;
interface VideoBoxProps {
@@ -45,13 +45,27 @@ interface VideoBoxProps {
const VideoBox = ({ videoTrack, audioTrack }: VideoBoxProps): JSX.Element => {
const [isSpeak, setIsSpeak] = useState(false);
+ const isInterval = useRef(false);
+
+ const initInterval = useCallback(
+ function () {
+ if (!isInterval.current) {
+ setInterval(() => {
+ if (audioTrack) {
+ setIsSpeak(audioTrack?.getVolumeLevel() > SPEAK_VOLUME);
+ }
+ }, VOLUME_VISUAL_TIME);
+ }
+ isInterval.current = true;
+ },
+ [isInterval, audioTrack],
+ );
useEffect(() => {
- if (audioTrack)
- setInterval(() => {
- setIsSpeak(audioTrack?.getVolumeLevel() > SPEAK_VOLUME);
- }, VOLUME_VISUAL_TIME);
- }, [audioTrack]);
+ if (audioTrack) {
+ initInterval();
+ }
+ }, [audioTrack, initInterval]);
return (
diff --git a/client/src/pages/Room/style.ts b/client/src/pages/Room/style.ts
index 92b1b8bd..dbe28f23 100644
--- a/client/src/pages/Room/style.ts
+++ b/client/src/pages/Room/style.ts
@@ -8,5 +8,6 @@ export const RoomWrapper = styled.div`
export const RoomContainer = styled.div`
height: 100%;
+ width: 100%;
padding: ${({ theme }) => theme.paddings.lg};
`;
diff --git a/client/src/styles/GlobalFonts.ts b/client/src/styles/GlobalFonts.ts
deleted file mode 100644
index 6ab6609d..00000000
--- a/client/src/styles/GlobalFonts.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { createGlobalStyle } from 'styled-components';
-
-export default createGlobalStyle`
-
- /* dongle-700 - korean */
- @font-face {
- font-family: 'Dongle';
- font-style: normal;
- font-weight: 700;
- src: url('./fonts/dongle-v4-korean-700.eot'); /* IE9 Compat Modes */
- src: local(''), url('./fonts/dongle-v4-korean-700.eot?#iefix') format('embedded-opentype'),
- /* IE6-IE8 */ url('./fonts/dongle-v4-korean-700.woff2') format('woff2'),
- /* Super Modern Browsers */ url('./fonts/dongle-v4-korean-700.woff') format('woff'),
- /* Modern Browsers */ url('./fonts/dongle-v4-korean-700.ttf') format('truetype'),
- /* Safari, Android, iOS */ url('./fonts/dongle-v4-korean-700.svg#Dongle') format('svg'); /* Legacy iOS */
- };
-
-
- /* nanum-gothic-700 - korean */
- @font-face {
- font-family: 'Nanum Gothic';
- font-style: normal;
- font-weight: 700;
- src: url('./fonts/nanum-gothic-v17-korean-700.eot'); /* IE9 Compat Modes */
- src: local(''), url('./fonts/nanum-gothic-v17-korean-700.eot?#iefix') format('embedded-opentype'),
- /* IE6-IE8 */ url('./fonts/nanum-gothic-v17-korean-700.woff2') format('woff2'),
- /* Super Modern Browsers */ url('./fonts/nanum-gothic-v17-korean-700.woff') format('woff'),
- /* Modern Browsers */ url('./fonts/nanum-gothic-v17-korean-700.ttf') format('truetype'),
- /* Safari, Android, iOS */ url('./fonts/nanum-gothic-v17-korean-700.svg#NanumGothic') format('svg'); /* Legacy iOS */
- };
-
-
-`;
diff --git a/client/src/styles/fonts.css b/client/src/styles/fonts.css
new file mode 100644
index 00000000..7fe73430
--- /dev/null
+++ b/client/src/styles/fonts.css
@@ -0,0 +1,7 @@
+@font-face {
+ font-family: 'Dongle';
+ font-style: normal;
+ font-weight: 700;
+ src: url('../assets/fonts/dongle-v4-korean-700.woff2') format('woff2'),
+ url('../assets/fonts/dongle-v4-korean-700.woff') format('woff');
+} ;
diff --git a/client/src/styles/fonts/dongle-v4-korean-700.eot b/client/src/styles/fonts/dongle-v4-korean-700.eot
deleted file mode 100644
index 07422a70..00000000
Binary files a/client/src/styles/fonts/dongle-v4-korean-700.eot and /dev/null differ
diff --git a/client/src/styles/fonts/dongle-v4-korean-700.svg b/client/src/styles/fonts/dongle-v4-korean-700.svg
deleted file mode 100644
index b35eefed..00000000
--- a/client/src/styles/fonts/dongle-v4-korean-700.svg
+++ /dev/null
@@ -1,441 +0,0 @@
-
-
-
diff --git a/client/src/styles/fonts/dongle-v4-korean-700.ttf b/client/src/styles/fonts/dongle-v4-korean-700.ttf
deleted file mode 100644
index 0946a70c..00000000
Binary files a/client/src/styles/fonts/dongle-v4-korean-700.ttf and /dev/null differ
diff --git a/client/src/styles/fonts/dongle-v4-korean-regular.eot b/client/src/styles/fonts/dongle-v4-korean-regular.eot
deleted file mode 100644
index c4dfb57c..00000000
Binary files a/client/src/styles/fonts/dongle-v4-korean-regular.eot and /dev/null differ
diff --git a/client/src/styles/fonts/dongle-v4-korean-regular.svg b/client/src/styles/fonts/dongle-v4-korean-regular.svg
deleted file mode 100644
index d804932b..00000000
--- a/client/src/styles/fonts/dongle-v4-korean-regular.svg
+++ /dev/null
@@ -1,445 +0,0 @@
-
-
-
diff --git a/client/src/styles/fonts/dongle-v4-korean-regular.ttf b/client/src/styles/fonts/dongle-v4-korean-regular.ttf
deleted file mode 100644
index 9e56558c..00000000
Binary files a/client/src/styles/fonts/dongle-v4-korean-regular.ttf and /dev/null differ
diff --git a/client/src/styles/fonts/dongle-v4-korean-regular.woff b/client/src/styles/fonts/dongle-v4-korean-regular.woff
deleted file mode 100644
index 7fb0a862..00000000
Binary files a/client/src/styles/fonts/dongle-v4-korean-regular.woff and /dev/null differ
diff --git a/client/src/styles/fonts/dongle-v4-korean-regular.woff2 b/client/src/styles/fonts/dongle-v4-korean-regular.woff2
deleted file mode 100644
index 6f0ac6d2..00000000
Binary files a/client/src/styles/fonts/dongle-v4-korean-regular.woff2 and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-700.eot b/client/src/styles/fonts/nanum-gothic-v17-korean-700.eot
deleted file mode 100644
index a11a055b..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-700.eot and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-700.svg b/client/src/styles/fonts/nanum-gothic-v17-korean-700.svg
deleted file mode 100644
index 25dddff3..00000000
--- a/client/src/styles/fonts/nanum-gothic-v17-korean-700.svg
+++ /dev/null
@@ -1,488 +0,0 @@
-
-
-
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-700.ttf b/client/src/styles/fonts/nanum-gothic-v17-korean-700.ttf
deleted file mode 100644
index fc3d365f..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-700.ttf and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-700.woff b/client/src/styles/fonts/nanum-gothic-v17-korean-700.woff
deleted file mode 100644
index d17741b8..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-700.woff and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-700.woff2 b/client/src/styles/fonts/nanum-gothic-v17-korean-700.woff2
deleted file mode 100644
index 9ba9556d..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-700.woff2 and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-800.eot b/client/src/styles/fonts/nanum-gothic-v17-korean-800.eot
deleted file mode 100644
index e25413ce..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-800.eot and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-800.svg b/client/src/styles/fonts/nanum-gothic-v17-korean-800.svg
deleted file mode 100644
index ad5f1dd9..00000000
--- a/client/src/styles/fonts/nanum-gothic-v17-korean-800.svg
+++ /dev/null
@@ -1,498 +0,0 @@
-
-
-
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-800.ttf b/client/src/styles/fonts/nanum-gothic-v17-korean-800.ttf
deleted file mode 100644
index 4bf036ca..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-800.ttf and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-800.woff b/client/src/styles/fonts/nanum-gothic-v17-korean-800.woff
deleted file mode 100644
index cb8e5bc5..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-800.woff and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-800.woff2 b/client/src/styles/fonts/nanum-gothic-v17-korean-800.woff2
deleted file mode 100644
index b82f143a..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-800.woff2 and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.eot b/client/src/styles/fonts/nanum-gothic-v17-korean-regular.eot
deleted file mode 100644
index b192d616..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.eot and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.svg b/client/src/styles/fonts/nanum-gothic-v17-korean-regular.svg
deleted file mode 100644
index 7365512e..00000000
--- a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.svg
+++ /dev/null
@@ -1,483 +0,0 @@
-
-
-
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.ttf b/client/src/styles/fonts/nanum-gothic-v17-korean-regular.ttf
deleted file mode 100644
index 2f08e65b..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.ttf and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.woff b/client/src/styles/fonts/nanum-gothic-v17-korean-regular.woff
deleted file mode 100644
index 0394f4ec..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.woff and /dev/null differ
diff --git a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.woff2 b/client/src/styles/fonts/nanum-gothic-v17-korean-regular.woff2
deleted file mode 100644
index 1bfe79c9..00000000
Binary files a/client/src/styles/fonts/nanum-gothic-v17-korean-regular.woff2 and /dev/null differ