Skip to content

Commit

Permalink
feat: add github icon
Browse files Browse the repository at this point in the history
  • Loading branch information
flowersayo committed May 18, 2023
1 parent 024ae88 commit 6472fe0
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 27 deletions.
22 changes: 4 additions & 18 deletions client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import TutorialModal from "./components/common/TutorialModal";
import SvgIcon from "./components/common/SvgIcon";
import MusicOnSrc from "./assets/images/music_on.png";
import MusicOffSrc from "./assets/images/music_off.png";
import Github from "./components/Github";
const Background = styled.div`
width: 100%;
height: 100vh;
Expand Down Expand Up @@ -84,7 +85,7 @@ function App() {
top: "3%",
left: "8%",
};
console.log(mode);

return (
<LanguageContext.Provider value={mode}>
<WebsocketProvider>
Expand Down Expand Up @@ -124,6 +125,7 @@ function App() {
) : (
<></>
)}

{pathname == "/" && (
<TutorialBtn
setTutorialModalVisible={setTutorialModalVisible}
Expand Down Expand Up @@ -204,6 +206,7 @@ function App() {
) : (
<></>
)}

{pathname === "/" && (
<TutorialBtn
setTutorialModalVisible={setTutorialModalVisible}
Expand All @@ -215,7 +218,6 @@ function App() {
setModalVisible={setTutorialModalVisible}
/>
{pathname === "/" && <Toggle mode={mode} setMode={setMode} />}

<Routes>
<Route path="/" element={<MobileLandingScreen />} />

Expand Down Expand Up @@ -247,21 +249,5 @@ function App() {
</LanguageContext.Provider>
);
}
const LeftTop = styled.div`
position: absolute;
left: 3%;
top: 3%;
z-index: 10;
`;

const Bottom = styled.div`
position: absolute;
width: 100%;

display: flex;
justify-content: center;
align-items: center;
bottom: 1%;
z-index: 1;
`;
export default App;
1 change: 1 addition & 0 deletions client/src/assets/images/github-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions client/src/components/Github.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";
import SvgIcon from "./common/SvgIcon";
import GithubSrc from "../assets/images/github-mark.svg";
import styled from "styled-components";
function Github() {
return (
<IconContainer>
<SvgIcon
src={GithubSrc}
size="40px"
onClick={() => window.open("https://github.com/salt26/rpsbrawl")}
/>
</IconContainer>
);
}

const IconContainer = styled.a`
border-radius: 50px;
width: 30px;
height: 40px;
background-color: white;
position: absolute;
`;

export default Github;
1 change: 1 addition & 0 deletions client/src/components/common/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Btn = styled.button`
: "linear-gradient(180deg, #3ab6bc 0%, #3a66bc 100%, #2f508e 100%)"};
&:hover {
background-color: var(--light-mint);
transform: scale(1.1);
}
`;
export default function Button({ text, onClick, width, height, bg }) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/common/TutorialBtn.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function TutorialBtn({

const IconContainer = styled.div`
position: absolute;
right: calc(3% + 40px);
right: calc(4% + 50px);
top: 3%;
cursor: pointer;
`;
16 changes: 13 additions & 3 deletions client/src/pages/LandingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useRef, createContext, useEffect } from "react";
import { LanguageContext } from "../utils/LanguageProvider";
import { getUserName, setUserName } from "../utils/User";
import { Language } from "../db/Language";

import Github from "../components/Github";
import { WebsocketContext } from "../utils/WebSocketProvider";
import { useMediaQuery } from "react-responsive";

Expand Down Expand Up @@ -175,6 +175,9 @@ export default function LandingPage() {

<LoginBox />
</Row>
<GithubBox>
<Github />
</GithubBox>
</Container>
);
}
Expand All @@ -183,7 +186,14 @@ export default function LandingPage() {
https://apes0113.postype.com/post/2620
linear | ease | ease-in | ease-out | ease-in-out | step-start | step-end | steps(int,start|end) | cubic-bezier(n,n,n,n)
*/

const GithubBox = styled.div`
width: 100%;
position: relative;
display: flex;
padding-right: 3%;
flex-direction: row;
justify-content: flex-end;
`;
const Anim = styled.div`
animation: anim1 5s infinite ease-in-out;
animation-delay: ${({ delay }) => delay}s;
Expand Down Expand Up @@ -229,7 +239,7 @@ const Container = styled.div`
width: 100%;
height: 100%;
padding-bottom: 50px;
padding-bottom: 3%;
align-items: center;
Expand Down
4 changes: 1 addition & 3 deletions client/src/pages/MobileIngameScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,12 @@ export default function MobileInGameScreen() {
if (ready) {
if (res?.response === "error") {
if (
res.message === "Cannot play the same hand in a row (limited mode)."
res.message === "Cannot play the same hand in a row. (limited mode)"
) {
setMsg(Language[mode].limited_text);
setShowTime(true);
return;
}
alert(res.message);
return;
}
if (res?.request === "disconnected") {
//기존 인원과 새인원 비교
Expand Down
13 changes: 11 additions & 2 deletions client/src/pages/MobileLandingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import React, { useState } from "react";
import styled from "styled-components";
import Logo from "../components/common/Logo";

import RockSrc from "../assets/images/rock.png";
import ScissorSrc from "../assets/images/scissor.png";
import PaperSrc from "../assets/images/paper.png";
import SvgIcon from "../components/common/SvgIcon";
import SizedBox from "../components/common/SizedBox";

import Github from "../components/Github";
import Button from "../components/common/Button";
import { useContext } from "react";
import { Medium, MediumOutline } from "../styles/font";
Expand Down Expand Up @@ -232,6 +231,9 @@ export default function MobileLandingScreen() {

{currentTab === 0 ? <RuleBox /> : <LoginBox />}
</div>
<GithubBox>
<Github />
</GithubBox>
</Container>
);
}
Expand All @@ -240,6 +242,13 @@ export default function MobileLandingScreen() {
https://apes0113.postype.com/post/2620
linear | ease | ease-in | ease-out | ease-in-out | step-start | step-end | steps(int,start|end) | cubic-bezier(n,n,n,n)
*/
const GithubBox = styled.div`
position: absolute;
right: 4%;
top: 3%;
width: 40px;
height: 40px;
`;

const Anim = styled.div`
animation: anim1 5s infinite ease-in-out;
Expand Down

0 comments on commit 6472fe0

Please sign in to comment.