Skip to content

Commit

Permalink
Design: 폰트 로드 방식 변경 및 assets에 폰트 파일 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Narastro committed Nov 18, 2021
1 parent a8d0501 commit 13436bc
Show file tree
Hide file tree
Showing 30 changed files with 31 additions and 2,398 deletions.
3 changes: 1 addition & 2 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -36,7 +36,6 @@ const App = (): JSX.Element => {
</Switch>
</BrowserRouter>
<GlobalStyles />
<GlobalFonts />
</>
);
};
Expand Down
30 changes: 22 additions & 8 deletions client/src/components/VideoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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 (
<VideoWrap>
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/Room/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export const RoomWrapper = styled.div`

export const RoomContainer = styled.div`
height: 100%;
width: 100%;
padding: ${({ theme }) => theme.paddings.lg};
`;
33 changes: 0 additions & 33 deletions client/src/styles/GlobalFonts.ts

This file was deleted.

7 changes: 7 additions & 0 deletions client/src/styles/fonts.css
Original file line number Diff line number Diff line change
@@ -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');
} ;
Binary file removed client/src/styles/fonts/dongle-v4-korean-700.eot
Binary file not shown.
441 changes: 0 additions & 441 deletions client/src/styles/fonts/dongle-v4-korean-700.svg

This file was deleted.

Binary file removed client/src/styles/fonts/dongle-v4-korean-700.ttf
Binary file not shown.
Binary file removed client/src/styles/fonts/dongle-v4-korean-regular.eot
Binary file not shown.
445 changes: 0 additions & 445 deletions client/src/styles/fonts/dongle-v4-korean-regular.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
488 changes: 0 additions & 488 deletions client/src/styles/fonts/nanum-gothic-v17-korean-700.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
498 changes: 0 additions & 498 deletions client/src/styles/fonts/nanum-gothic-v17-korean-800.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
483 changes: 0 additions & 483 deletions client/src/styles/fonts/nanum-gothic-v17-korean-regular.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 13436bc

Please sign in to comment.