Refactor shared layouts and remove unused CSS
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{% block title %}Chess{% endblock %}</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='app.css') }}" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="site-shell">
|
||||
<header class="topbar">
|
||||
<div class="topbar-inner">
|
||||
<a href="{{ url_for('main.home') }}" class="brand">Chess</a>
|
||||
<nav class="topnav">
|
||||
<a
|
||||
href="{{ url_for('main.home') }}"
|
||||
class="{{ 'active' if active_page == 'home' else '' }}"
|
||||
>Home</a
|
||||
>
|
||||
<a
|
||||
href="{{ url_for('main.play') }}"
|
||||
class="{{ 'active' if active_page == 'play' else '' }}"
|
||||
>Play</a
|
||||
>
|
||||
<a
|
||||
href="{{ url_for('main.friends') }}"
|
||||
class="{{ 'active' if active_page == 'friends' else '' }}"
|
||||
>Friends</a
|
||||
>
|
||||
</nav>
|
||||
<div class="profile-pill">{{ current_user.username }}</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="page-wrap">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %} {% if
|
||||
messages %}
|
||||
<div class="flash-stack">
|
||||
{% for category, message in messages %}
|
||||
<div class="flash {{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %} {% endwith %} {% block content %}{% endblock %}
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{% block title %}Chess{% endblock %}</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ url_for('static', filename='style.css') }}"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<main class="public-wrap">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %} {% if
|
||||
messages %}
|
||||
<div class="flash-stack">
|
||||
{% for category, message in messages %}
|
||||
<div class="flash {{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %} {% endwith %} {% block content %}{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
+10
-40
@@ -1,40 +1,10 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Home</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='app.css') }}" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="site-shell">
|
||||
<header class="topbar">
|
||||
<a href="{{ url_for('main.home') }}" class="brand">Chess</a>
|
||||
<nav class="topnav">
|
||||
<a href="{{ url_for('main.home') }}" class="active">Home</a>
|
||||
<a href="{{ url_for('main.play') }}">Play</a>
|
||||
<a href="{{ url_for('main.friends') }}">Friends</a>
|
||||
</nav>
|
||||
<div class="profile-pill">{{ current_user.username }}</div>
|
||||
</header>
|
||||
|
||||
<main class="page-wrap">
|
||||
<h1>Welcome back, {{current_user.username}}</h1>
|
||||
<div class="cta-row">
|
||||
<a href="{{ url_for('main.play') }}" class="btn btn-primary"
|
||||
>Start a game</a
|
||||
>
|
||||
<a href="{{ url_for('main.friends') }}" class="btn btn-secondary"
|
||||
>Open friends</a
|
||||
>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{% extends "base_app.html" %} {% set active_page = 'home' %} {% block title
|
||||
%}Home{% endblock %} {% block content %}
|
||||
<h1>Welcome back, {{ current_user.username }}</h1>
|
||||
<div class="cta-row">
|
||||
<a href="{{ url_for('main.play') }}" class="btn btn-primary">Start a game</a>
|
||||
<a href="{{ url_for('main.friends') }}" class="btn btn-secondary"
|
||||
>Open friends</a
|
||||
>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
+14
-20
@@ -1,20 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Chess</title>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ url_for('static', filename='style.css') }}"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Chess Game</h1>
|
||||
<p>main page</p>
|
||||
|
||||
<a href="{{ url_for('auth.login') }}" class="link-button"> Login </a>
|
||||
|
||||
<a href="{{ url_for('auth.register') }}" class="link-button"> Register </a>
|
||||
</body>
|
||||
</html>
|
||||
{% extends "base_public.html" %} {% block title %}Chess{% endblock %} {% block
|
||||
content %}
|
||||
<section class="public-card">
|
||||
<h1>Play Chess</h1>
|
||||
<p class="muted">
|
||||
Play games and challenge your friends. You just log in or create a new
|
||||
account below.
|
||||
</p>
|
||||
<div class="public-actions">
|
||||
<a href="{{ url_for('auth.login') }}" class="link-button">Login</a>
|
||||
<a href="{{ url_for('auth.register') }}" class="link-button">Register</a>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<h1>Login</h1>
|
||||
|
||||
<form method="POST">
|
||||
<input name="username" placeholder="Username" required />
|
||||
<input name="password" type="password" placeholder="Password" required />
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
|
||||
<a href="{{ url_for('auth.register') }}">Register</a>
|
||||
{% extends "base_public.html" %} {% block title %}Login{% endblock %} {% block
|
||||
content %}
|
||||
<section class="public-card">
|
||||
<h1>Login</h1>
|
||||
<form method="POST" class="auth-form">
|
||||
<input name="username" placeholder="Username" required />
|
||||
<input name="password" type="password" placeholder="Password" required />
|
||||
<button type="submit" class="link-button">Login</button>
|
||||
</form>
|
||||
<a href="{{ url_for('auth.register') }}">Register</a>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
+24
-55
@@ -1,56 +1,25 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Play</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='app.css') }}" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="site-shell">
|
||||
<header class="topbar">
|
||||
<a href="{{ url_for('main.home') }}" class="brand">Chess</a>
|
||||
<nav class="topnav">
|
||||
<a href="{{ url_for('main.home') }}">Home</a>
|
||||
<a href="{{ url_for('main.play') }}" class="active">Play</a>
|
||||
<a href="{{ url_for('main.friends') }}">Friends</a>
|
||||
</nav>
|
||||
<div class="profile-pill">{{ current_user.username }}</div>
|
||||
</header>
|
||||
|
||||
<!-- todo: make all of this via js and implement logic -->
|
||||
<main class="page-wrap">
|
||||
<section class="queue-layout">
|
||||
<article class="panel">
|
||||
<h2>Game settings</h2>
|
||||
<h4>Choose a time setup</h4>
|
||||
<div class="chip-row">
|
||||
<button class="chip">1 + 0</button>
|
||||
<button class="chip">3 + 2</button>
|
||||
<button class="chip active">10 + 0</button>
|
||||
<button class="chip">15 + 10</button>
|
||||
</div>
|
||||
<h4>You play as</h4>
|
||||
<div class="chip-row">
|
||||
<button class="chip">white</button>
|
||||
<button class="chip">black</button>
|
||||
<button class="chip active">random</button>
|
||||
</div>
|
||||
<div class="cta-row">
|
||||
<!-- <button class="btn btn-primary" type="button">Start game</button> -->
|
||||
<button class="btn btn-secondary" type="button">
|
||||
Create game code
|
||||
</button>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
{% extends "base_app.html" %} {% set active_page = 'play' %} {% block title
|
||||
%}Play{% endblock %} {% block content %}
|
||||
<section class="queue-layout">
|
||||
<article class="panel">
|
||||
<h1>Play</h1>
|
||||
<h2>Game settings</h2>
|
||||
<h3>Choose a time setup</h3>
|
||||
<div class="chip-row">
|
||||
<button class="chip" type="button">1 + 0</button>
|
||||
<button class="chip" type="button">3 + 2</button>
|
||||
<button class="chip active" type="button">10 + 0</button>
|
||||
<button class="chip" type="button">15 + 10</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<h3>You play as</h3>
|
||||
<div class="chip-row">
|
||||
<button class="chip" type="button">white</button>
|
||||
<button class="chip" type="button">black</button>
|
||||
<button class="chip active" type="button">random</button>
|
||||
</div>
|
||||
<div class="cta-row">
|
||||
<button class="btn btn-secondary" type="button">Create game code</button>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
<h1>Register</h1>
|
||||
|
||||
<form method="POST">
|
||||
<input name="username" placeholder="Username" required />
|
||||
<input name="password" type="password" required />
|
||||
<button type="submit">Create Account</button>
|
||||
</form>
|
||||
|
||||
<a href="{{ url_for('auth.login') }}">Back to Login</a>
|
||||
{% extends "base_public.html" %} {% block title %}Register{% endblock %} {%
|
||||
block content %}
|
||||
<section class="public-card">
|
||||
<h1>Register</h1>
|
||||
<form method="POST" class="auth-form">
|
||||
<input name="username" placeholder="Username" required />
|
||||
<input name="password" type="password" placeholder="Password" required />
|
||||
<button type="submit" class="link-button">Create Account</button>
|
||||
</form>
|
||||
<a href="{{ url_for('auth.login') }}">Back to Login</a>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user