initial project layout + basic functions
This commit is contained in:
parent
0cec52618e
commit
e25a4c2288
4 changed files with 138 additions and 0 deletions
26
app.py
Normal file
26
app.py
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
from flask import Flask, url_for, redirect, render_template
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/', methods=['GET'])
|
||||||
|
def index():
|
||||||
|
return render_template('index.html')
|
||||||
|
|
||||||
|
@app.route('/board/<board_name>', methods=['GET'])
|
||||||
|
def board(board_name):
|
||||||
|
links = [
|
||||||
|
{'name': 'b', 'display_name': '/b/ - random'},
|
||||||
|
{'name': 'g', 'display_name': '/g/ - technology'},
|
||||||
|
{'name': 'a', 'display_name': '/a/ - anime'},
|
||||||
|
{'name': 'v', 'display_name': '/v/ - video games'},
|
||||||
|
{'name': 'w', 'display_name': '/w/ - wallpapers'},
|
||||||
|
{'name': 'x', 'display_name': '/x/ - paranormal'},
|
||||||
|
{'name': 'z', 'display_name': '/z/ - test'},
|
||||||
|
{'name': 's', 'display_name': '/s/ - soyjaks'},
|
||||||
|
{'name': 'pol', 'display_name': '/pol/ - politically incorrect'}
|
||||||
|
]
|
||||||
|
return render_template('board.html', title=board_name, header=board_name, links=links)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=True)
|
||||||
65
static/css/styles.css
Normal file
65
static/css/styles.css
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
body {
|
||||||
|
background-color: black;
|
||||||
|
color: #00FF00;
|
||||||
|
font-family: 'Courier New', Courier, monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 2vw;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
margin: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
font-size: 1vw;
|
||||||
|
color: #00FF00;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
background-color: black;
|
||||||
|
color: #00FF00;
|
||||||
|
border: 1px solid #00FF00;
|
||||||
|
padding: 10px 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background-color: #00FF00;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, textarea {
|
||||||
|
background-color: black;
|
||||||
|
color: #00FF00;
|
||||||
|
border: 1px solid #00FF00;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input::placeholder, textarea::placeholder {
|
||||||
|
color: #00FF00;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 4vw;
|
||||||
|
color: #00FF00;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
font-size: 2vw;
|
||||||
|
color: #00FF00;
|
||||||
|
}
|
||||||
19
templates/board.html
Normal file
19
templates/board.html
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>{{ title }}</title>
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% extends "index.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="link-container">
|
||||||
|
<h2>{{ header }}</h2>
|
||||||
|
<p>{{ content }}</p>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
28
templates/index.html
Normal file
28
templates/index.html
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>wirechan</title>
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div>
|
||||||
|
<h1>wirechan</h1>
|
||||||
|
<h4>the wirechan imageboard</h4>
|
||||||
|
</div>
|
||||||
|
<div class="link-container">
|
||||||
|
<h4>list of boards:</h4>
|
||||||
|
<a href="{{ url_for('board', board_name='b') }}">/b/ - random</a>
|
||||||
|
<a href="{{ url_for('board', board_name='g') }}">/g/ - technology</a>
|
||||||
|
<a href="{{ url_for('board', board_name='a') }}">/a/ - anime</a>
|
||||||
|
<a href="{{ url_for('board', board_name='v') }}">/v/ - video games</a>
|
||||||
|
<a href="{{ url_for('board', board_name='w') }}">/w/ - wallpapers</a>
|
||||||
|
<a href="{{ url_for('board', board_name='x') }}">/x/ - paranormal</a>
|
||||||
|
<a href="{{ url_for('board', board_name='z') }}">/z/ - test</a>
|
||||||
|
<a href="{{ url_for('board', board_name='s') }}">/s/ - soyjaks</a>
|
||||||
|
<a href="{{ url_for('board', board_name='pol') }}">/pol/ - politically incorrect</a>
|
||||||
|
</div>
|
||||||
|
<div class="bottom">
|
||||||
|
<a>lainlounge.xyz - copyleft all wrongs released</a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Reference in a new issue