Skip to content

Commit

Permalink
new styles for the home menu abr
Browse files Browse the repository at this point in the history
dropdown login stats

user profile in navbar

navbar component; home component

home page new layout

Game details page created (#56)

User profile page (#43)

new styles for the home menu abrs

user profile in navbar

navbar component; home component

home page new layout

home page

shared navbar

new dropdown menu

trash

update of home css

working logic
  • Loading branch information
Jakub-prog committed May 27, 2024
1 parent 5dd6c2b commit 3681cd6
Show file tree
Hide file tree
Showing 20 changed files with 1,029 additions and 21,291 deletions.
21,121 changes: 0 additions & 21,121 deletions package-lock.json

This file was deleted.

53 changes: 18 additions & 35 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,26 @@
import './App.scss'
import User from "./User/User";
import {Link} from "react-router-dom";
import UserButtons from './User/UserButtons';
import './App.scss';
import Navbar from './Navbar';
import Home from './Home';
import { useState } from 'react';

function App() {
const [isAuthenticated, setIsAuthenticated] = useState(false);
const [isCollapsed, setIsCollapsed] = useState(false);


const toggleUserBar = () => {
setIsCollapsed(!isCollapsed);
};

return (
<div className="app">
<UserButtons/>

<Navbar isAuthenticated={isAuthenticated} user={null} />
{/* tutaj przesyla uzytkownika */}

<div className="title">
<h1>Bot-Wars</h1>
<div className="login-btns">
<User isLoggedIn={false}/>
</div>
</div>
<div className="menu-btns">
<div className="menu-btn">
<Link to="index.html">
<button className="btn">Home</button>
</Link>
</div>
<div className="menu-btn">
<Link to="tournaments/home">
<button className="btn">Tournaments</button>
</Link>
</div>
<div className="menu-btn">
<Link to="games">
<button className="btn">Games</button>
</Link>
</div>
<div className="menu-btn">
<Link to="about">
<button className="btn">About</button>
</Link>
</div>
</div>
<Home isAuthenticated={isAuthenticated} />
</div>
)
);
}

export default App
export default App;
162 changes: 128 additions & 34 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,146 @@
-webkit-box-sizing: border-box;
}

body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background: #000;
color: #0f0;
}

.app {
text-align: center;

h1:hover {
cursor: default;
}
.log-head {
display: flex;
flex-flow: column;
align-items: left;

.title {
overflow: auto;
padding: 10px;
}
.header {
z-index: 600;
display: flex;
justify-content: space-between;
align-items: center;
background: rgba(0, 0, 0, 0.8);
width: 100%;

.login-btns {
float: right;
}
.logo {
flex-basis: 60%;
display: flex;
justify-content: left;
letter-spacing: 5px;
}

.btn {
display: inline-block;
width: 100%;
}
.logo h1 {
margin: 0;
font-size: 1.5em;
color: #0f0;
}
}

.menu-btn {
margin: 3px;
width: 23%
}
.menu-btns.admin .menu-btn{
width: 32%
}
.flex-user {
z-index: 300;
max-width: 50%;
display: flex;
flex-direction: row;
align-items: left;
background-color: #000;
opacity: 0.85;
border: 3px solid #24da00;
// margin-top: -60px;
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
transform: translateY(0);

&.collapsed {
transform: translateY(-100%);
opacity: 0;
}

.menu-btns {
margin-top: 25px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.user-bar {
border: none;

.user-buttons-container {
display: flex;
justify-content: flex-end;

a {
display: flex;
align-items: center;
}

.user-button {
width: 65px;
height: 65px;
padding: 6px;
margin-right: 10px;
border-radius: 50%;
border: 2px solid #24da00;
text-align: center;
}

.setting-button {
padding: 0;
}
}
}
}

.hide-arrow {
position: relative;
z-index: 200;
top: -10px;
margin: 0;
padding-top: 10px;
background-color: #0f0;
color: #000;
width: 100px;
font-size: 16px;
border-radius: 10px;
cursor: pointer;
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
transform: translateY(0);

@media only screen and (max-width: 650px) {
.menu-btn {
width: 100%
&.collapsed {
transform: translateY(-100px);
opacity: 0;
}
}
.menu-btns.admin .menu-btn{
width: 100%

.collapsed-bar {
position: relative;
margin-top: -108px;
background: #0f0;
color: #000;
min-width: 150px;
height: 60;
-webkit-border-bottom-right-radius: 20px;
-webkit-border-bottom-left-radius: 20px;
-moz-border-radius-bottomright: 20px;
-moz-border-radius-bottomleft: 20px;
border-bottom-right-radius: 20px;
border-bottom-left-radius: 20px;
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 10px;
cursor: pointer;
font-size: 22px;

.username {
margin-left: 10px;
}
}
}

.login-btn {
width: 100%;
.container {
display: flex;
width: 70%;
opacity: 85%;
height: 100%;
margin: auto;
background-color: #161616;
// border-left: 3px dashed #0BE400;
// border-right: 3px dashed #0BE400;
}
}
84 changes: 84 additions & 0 deletions src/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import React, { useRef } from 'react';
import './Home.scss';
import roboImg from './resources/robot3.png';

function Home({ isAuthenticated }) {
const getStartedRef = useRef(null);

const scrollToGetStarted = () => {
if (getStartedRef.current) {
getStartedRef.current.scrollIntoView({ behavior: 'smooth' });
}
};

return (
<div className="home">
<div className="hero-section">
<img src={roboImg} alt="Robot" className="hero-image" />
<div className="welcome-box">
<h1>Welcome to Bot-Wars!</h1>
{isAuthenticated ? (
<>
<p>Welcome back! Check out our latest tournaments and games.</p>
</>
) : (
<>
<p>Join us today and start competing in our exciting tournaments!</p>
<div className="get-started-link" onClick={scrollToGetStarted}>
<a href="#">Get Started</a>
</div>
</>
)}
</div>
</div>

<div className="info-boxes">
<div className="info-box large">
<h2>Versatile Bot Platform</h2>
<p>
Create, duel, and compete with your bots. Join or create tournaments, challenge friends, or rise in the global rankings.
</p>
</div>
<div className="info-box">
<h2>AI Bot Mastery</h2>
<p>Learn to design and configure bots for exciting matches and tournaments.</p>
</div>
<div className="info-box">
<h2>Tournaments</h2>
<p>Join tournaments, compete with players, and climb the leaderboard to become the champion.</p>
</div>
</div>

<div ref={getStartedRef} className="content">
<div className="content-box">
<h2>Getting Started</h2>
<ol>
<li><a href="link-to-signup">Sign Up</a>: Create your account to join the community.</li>
<li><a href="link-to-games">Explore Games</a>: Discover various bot games and tournaments available.</li>
<li><a href="link-to-create-tournament">Create Your Own Tournament</a>: Design and host your tournaments, invite friends, and compete.</li>
</ol>
</div>
<div className="content-box">
<h2>How to Play</h2>
<ul>
<li><h3>Design Your Bot:</h3> <span>Use our intuitive tools to create and program your bot or see the example bots on our <a href="link-to-signup">GitHub</a> page</span></li>
<li><h3>Test Your Bot:</h3> <span>Run simulations to ensure your bot performs well under different scenarios.</span></li>
<li><h3>Join Tournament:</h3> <span>Enter your bot in matches and tournaments to compete against others.</span></li>
<li><h3>Analyze Results:</h3> <span>Review match results to improve your bot's performance.</span></li>
</ul>
</div>
<div className="content-box">
<h2>Registration Process</h2>
<ol>
<li>Visit the <a href="link-to-signup">Sign-Up Page</a>.</li>
<li>Fill in your details and verify your email.</li>
<li>Complete your profile and set up your first bot.</li>
<li>Start participating in tournaments and duels!</li>
</ol>
</div>
</div>
</div>
);
}

export default Home;
Loading

0 comments on commit 3681cd6

Please sign in to comment.