Skip to content

Commit

Permalink
feature: improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
wilcorrea committed Apr 8, 2024
1 parent 90e66e7 commit 6d9b0b0
Show file tree
Hide file tree
Showing 19 changed files with 4,544 additions and 42 deletions.
9 changes: 4 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Super Quiz</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- <link-->
<!-- rel="stylesheet"-->
<!-- href="/assets/style/bootswatch/materia.min.css"-->
<!-- >-->
<link
rel="stylesheet"
href="/assets/style/bootswatch/quartz.min.css"
>
</head>
<body>
<div id="root"></div>
Expand Down
30 changes: 30 additions & 0 deletions public/assets/images/github/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
GitHub loves third party developers. We want to help make your project awesome, and often that includes showing off GitHub integration with an image. In order to keep everyone happy (and avoid involving lawyers), we've created this repository and filled it with artwork that you may use in your own applications.

For help or to add media not included here, please email [email protected] and we'll talk.


THESE THINGS ARE AWESOME, PLEASE DO THEM:

+ Use the Octocat, the Mark, or GitHub logo to link to GitHub

+ Use the Mark, in "social buttons" that link to your GitHub profile or project

+ Use the Octocat, the Mark, or GitHub logo to advertise that your product has built-in GitHub integration

+ Use the Octocat, the Mark or GitHub logo in a blog post or news article about GitHub


PLEASE, DON"T DO THESE THINGS:

- Use the Octocat or GitHub logo for your application's icon

- Create a modified version of the Octocat or GitHub logo

- Integrate the Octocat or GitHub logo into your logo

- Use any GitHub artwork without permission


NAMING YOUR APPLICATION

Please avoid naming your projects anything that implies GitHub's endorsement. For example, don't call your awesome new iPhone app "GitHub Issues". Instead consider "Octoissues" or "HubIssues" or "Gissues". Maybe not that last one, but you get the idea.
Binary file added public/assets/images/github/logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/github/logo-white.psd
Binary file not shown.
4,312 changes: 4,312 additions & 0 deletions public/assets/images/github/logo.ai

Large diffs are not rendered by default.

Binary file added public/assets/images/github/logo.eps
Binary file not shown.
Binary file added public/assets/images/github/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/github/logo.psd
Binary file not shown.
Binary file added public/assets/images/github/mark-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/images/github/mark-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/github/mark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/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.
6 changes: 6 additions & 0 deletions public/assets/style/bootstrap.5.3.min.css

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,37 @@ import { GamePage } from './view/pages/game/GamePage.tsx'
import { GameEndPage } from './view/pages/game/GameEndPage.tsx'
// session
import { PrivatePage } from './view/pages/PrivatePage'
import { LoginPage } from './view/pages/LoginPage'
import { SignInPage } from './view/pages/SignInPage.tsx'

export default function App () {
return (
<AppProvider>
<Routes>
<Route element={<Layout />}>
<Route
index
element={<HomePage />}
/>
<Route
path="/game"
element={<GameWelcomePage />}
/>
<Route
path="/game/:id/play"
element={<GamePage />}
/>
<Route
path="/game/:id/end"
element={<GameEndPage />}
/>
<Route
path="/"
element={<HomePage />}
>
<Route
index
element={<GameWelcomePage />}
/>
<Route
path="/game"
element={<GameWelcomePage />}
/>
<Route
path="/game/:id/play"
element={<GamePage />}
/>
<Route
path="/game/:id/end"
element={<GameEndPage />}
/>
</Route>
<Route
path="/login"
element={<LoginPage />}
path="/sign-in"
element={<SignInPage />}
/>
<Route
element={<ProtectPage />}
Expand Down
14 changes: 14 additions & 0 deletions src/config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ import { initReactI18next } from 'react-i18next'
const resources = {
'ptBR': {
default: {
layouts: {
root: {
brand: 'Quiz',
play: 'Jogar',
signIn: 'Entrar'
}
},
pages: {
home: {
title: 'Quiz',
description: 'O melhor jogo de perguntas e respostas para jogar com os amigos!\n' +
'Reúna sua galera e divirta-se com moderação! 🍻',
contributing: 'Não se esqueça de contribuir com o projeto no link abaixo! 😉',
callToAction: 'Jogar agora »'
},
game: {
welcome: {
title: 'PHPinga',
Expand Down
76 changes: 76 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}

@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}

.b-example-divider {
width: 100%;
height: 3rem;
background-color: rgba(0, 0, 0, .1);
border: solid rgba(0, 0, 0, .15);
border-width: 1px 0;
box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
}

.b-example-vr {
flex-shrink: 0;
width: 1.5rem;
height: 100vh;
}

.bi {
vertical-align: -.125em;
fill: currentColor;
}

.nav-scroller {
position: relative;
z-index: 2;
height: 2.75rem;
overflow-y: hidden;
}

.nav-scroller .nav {
display: flex;
flex-wrap: nowrap;
padding-bottom: 1rem;
margin-top: -1px;
overflow-x: auto;
text-align: center;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}

.btn-bd-primary {
--bd-violet-bg: #712cf9;
--bd-violet-rgb: 112.520718, 44.062154, 249.437846;

--bs-btn-font-weight: 600;
--bs-btn-color: var(--bs-white);
--bs-btn-bg: var(--bd-violet-bg);
--bs-btn-border-color: var(--bd-violet-bg);
--bs-btn-hover-color: var(--bs-white);
--bs-btn-hover-bg: #6528e0;
--bs-btn-hover-border-color: #6528e0;
--bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
--bs-btn-active-color: var(--bs-btn-hover-color);
--bs-btn-active-bg: #5a23c8;
--bs-btn-active-border-color: #5a23c8;
}

.bd-mode-toggle {
z-index: 1500;
}

.bd-mode-toggle .dropdown-menu .active .bi {
display: block !important;
}
54 changes: 45 additions & 9 deletions src/view/layouts/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,50 @@
import { Link, Outlet } from "react-router-dom";
import { Link, Outlet, useNavigate } from 'react-router-dom'
import { useTranslation } from 'react-i18next'

export function Layout() {
export function Layout () {
const navigate = useNavigate()
const { t } = useTranslation(
'default',
{ keyPrefix: 'layouts.root' }
)
return (
<div>
<div>
<Link to="/">Pública</Link>
&nbsp;|&nbsp;
<Link to="/private">Privada</Link>
<>
<nav className="navbar navbar-expand-lg bg-body-tertiary fixed-top">
<div className="container-fluid">
<Link
className="navbar-brand"
to="/"
>
{t('brand')}
</Link>

<ul className="navbar-nav me-auto">
<li className="nav-item">
<Link
to="/game"
className="nav-link"
>
{t('play')}
</Link>
</li>
</ul>
<button
className="btn btn-primary"
type="submit"
onClick={() => navigate('/sign-in')}
>
{t('signIn')}
</button>
</div>
</nav>

<main className="container">
<div className="mt-5">
<div className="pt-2">
<Outlet />
</div>
</div>
<Outlet />
</div>
</main>
</>
)
}
43 changes: 35 additions & 8 deletions src/view/pages/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
import { Outlet } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'
import { image } from '../../config/assets.ts'

export function HomePage () {
const { t } = useTranslation(
'default',
{ keyPrefix: 'pages.home' }
)
return (
<>
<div className="container">
<div className="app">
<Outlet />
</div>
</div>
</>
<div className="bg-body-tertiary text-light-emphasis p-4 rounded">
<h1>{t('title')}</h1>
<p className="lead mb-3">{t('description')}</p>
<p className="lead mb-1">
{t('contributing')}
</p>
<p className="lead mb-3">
<a
className="text-light-emphasis"
href="https://github.com/PHPcomRapadura/quiz"
target="_blank"
>
<img
src={image('github/mark.png')}
className="img-fluid"
alt="github logo"
width="60"
/>
</a>
</p>
<Link
className="btn btn-lg btn-primary"
to="/game"
role="button"
>
{t('callToAction')}
</Link>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { useApp } from '../hooks'

export function LoginPage () {
export function SignInPage () {
const app = useApp()
const navigate = useNavigate()
const [error, setError] = useState('')
Expand Down

0 comments on commit 6d9b0b0

Please sign in to comment.