Skip to content

Commit

Permalink
フロントデザイン変更
Browse files Browse the repository at this point in the history
  • Loading branch information
MurakawaTakuya committed Oct 27, 2024
1 parent 8eada23 commit 3b7e181
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 18 deletions.
8 changes: 6 additions & 2 deletions backend/public/stylesheets/style.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
body {
padding: 50px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
font:
14px "Lucida Grande",
Helvetica,
Arial,
sans-serif;
}

a {
color: #00B7FF;
color: #00b7ff;
}
81 changes: 81 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
"dependencies": {
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@mui/base": "^5.0.0-beta.60",
"@mui/material": "^6.1.5",
"next": "14.2.15",
"react": "^18",
"react-dom": "^18",
"react-icons": "^5.3.0",
"sass": "^1.80.3",
"socket.io-client": "^4.8.0"
},
Expand Down
31 changes: 29 additions & 2 deletions frontend/src/components/Header/Header.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@import url("https://fonts.googleapis.com/css2?family=Fontdiner+Swanky&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Modak&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Michroma&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Holtwood+One+SC&display=swap");

.header {
z-index: 1000;
transition: all 0.3s ease-out;
Expand All @@ -12,6 +17,11 @@
box-sizing: border-box;
height: var(--header-height);
padding: 8px 0 6px 0;
background: linear-gradient(
180deg,
rgb(212 225 255) 1%,
rgba(187, 187, 187, 0) 70.9%
);
background-color: #f8f8f8;
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.15);
opacity: 1;
Expand All @@ -20,12 +30,29 @@
}

.navigation {
box-sizing: border-box;
display: flex;
justify-content: space-around;
justify-content: space-between;
width: 100%;
padding: 0 !important;
padding: 0 30px !important;
}

.logo {
font-family: "Fontdiner Swanky", serif;
font-family: "Modak", system-ui;
font-family: "Michroma", sans-serif;
font-family: "Holtwood One SC", serif;
font-size: 30px;
font-style: normal;
font-weight: bold;
font-weight: 400;
color: #1d9bf8;
text-shadow:
2px 2px 1px #ffe6d4,
3px 3px 0px rgb(86 49 0 / 34%);
}

.logoutButton {
padding: 8px 0 6px 0;
zoom: 1.2;
}
12 changes: 7 additions & 5 deletions frontend/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

import React from "react";
import styles from "./Header.module.scss";
import { ImExit } from "react-icons/im";

export default function Header() {
return (
<header className={styles.header}>
<div className={styles.navigationContainer}>
<nav className={styles.navigation}>
<div className={styles.logo}>ls-chat</div>
<div className={styles.userNumber}>users</div>
<button
<span className={styles.logo}>What&apos;s up?</span>
<span className={styles.userNumber}>users</span>
<div
className={styles.logoutButton}
onClick={() => window.location.reload()}
>
logout
</button>
<ImExit />
</div>
</nav>
</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Modal/NestedModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function NestedModal({
onClick={handleClose}
disabled={name === ""}
>
送信
接続
</Button>
</Box>
</Modal>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/SendForm/SendForm.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
min-height: 40px;
margin: 3px auto 35px auto;
input {
width: min(70vw, 400px);
margin-right: 5px;
width: min(80vw, 500px);
padding: 8px 8px 6px;
font-size: 18px;
}
}
24 changes: 20 additions & 4 deletions frontend/src/components/SendForm/SendForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import React, { useState } from "react";
import { Socket } from "socket.io-client";
import styles from "./SendForm.module.scss";
import { IoIosSend } from "react-icons/io";
import TextField from "@mui/material/TextField"; // TextFieldをインポート

interface SendFormProps {
socket: Socket;
Expand All @@ -21,18 +23,32 @@ export default function SendForm({ socket }: SendFormProps) {

return (
<div className={styles.sendForm}>
<input
type="text"
<TextField
value={input}
onChange={(e) => setInput(e.target.value)}
placeholder="Enter a message"
style={{ marginRight: "5px" }}
placeholder="メッセージを入力"
onKeyPress={(e) => {
if (e.key === "Enter") {
sendMessage(); // Enterキーが押されたときにメッセージを送信
}
}}
fullWidth
variant="outlined"
margin="normal"
/>
<button onClick={sendMessage}>送信</button>
<div
onClick={sendMessage}
style={{
display: "flex",
flexDirection: "column",
justifyContent: "center",
zoom: 1.8,
marginTop: "5px",
}}
>
<IoIosSend />
</div>
</div>
);
}
8 changes: 6 additions & 2 deletions frontend/src/styles/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--header-height: 6vh;
--header-height: 60px;
}

html {
Expand All @@ -13,7 +13,11 @@ body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
background: white;
background: linear-gradient(
0deg,
rgb(181, 239, 249) 10.5%,
rgb(254, 254, 254) 86.8%
);
}

main {
Expand Down

0 comments on commit 3b7e181

Please sign in to comment.