Skip to content

Commit

Permalink
Adapting to Flask
Browse files Browse the repository at this point in the history
Making big changes to adapt the platform to Flask. New images, new files structure, new app routes, adding CSP (Content Security Policy) and other new features and bug resolutions...
  • Loading branch information
Isaaker committed Dec 19, 2023
1 parent 2a7845e commit 5ba2207
Show file tree
Hide file tree
Showing 44 changed files with 119 additions and 185 deletions.
43 changes: 38 additions & 5 deletions ghost_simulator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import os

from flask import Flask
from flask import *


def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)
app = Flask(__name__, instance_relative_config=True,
static_folder='static',
template_folder='templates')

if test_config is None:
# load the instance config, if it exists, when not testing
Expand All @@ -19,10 +21,41 @@ def create_app(test_config=None):
os.makedirs(app.instance_path)
except OSError:
pass

### APP ROUTES ###

# Index

@app.route('/index')
@app.route('/index.html')
@app.route('/index.php')
@app.route('/')
def index():
return 'Hello, World!'

return app


# Login

@app.route('/login.html')
@app.route('/login')
def login_page():
return render_template("/login.html")

# Simulator Home

@app.route('/home.html')
@app.route('/home')
def home_page():
return render_template("/home.html")

# About

@app.route('/about.html')
@app.route('/about')
def about_page():
return render_template("/about.html")





return app
35 changes: 0 additions & 35 deletions ghost_simulator/old/html/login.html

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Binary file added ghost_simulator/static/images/license_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
1 change: 1 addition & 0 deletions ghost_simulator/static/images/tech_logos/css3_logo.svg
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 ghost_simulator/static/images/tech_logos/flask_logo.svg
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 ghost_simulator/static/images/tech_logos/html5_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,36 @@
<html>
<head>

<!--- Content Security Policy (CSP)-->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">
<meta http-equiv="Content-Security-Policy" content="img-src 'self'">

<!--- Responsive Platform --->
<meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt>

<meta charset="utf-8">
<!--- Favicon --->
<link rel="apple-touch-icon" sizes="180x180" href="./images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./images/favicon-16x16.png">
<link rel="manifest" href="./images/site.webmanifest">
<link rel="apple-touch-icon" sizes="180x180" href="{{url_for('static', filename='images/apple-touch-icon.png')}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{url_for('static', filename='images/favicon-32x32.png')}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{url_for('static', filename='images/favicon-16x16.png')}}">
<link rel="manifest" href="{{url_for('static', filename='images/site.webmanifest')}}">
<meta name="msapplication-TileColor" content="#fade95">
<meta name="theme-color" content="#fade95">

<!--- CSS Style --->
<link rel="stylesheet" type="text/css" href="home.css">
<link rel="stylesheet" type="text/css" href="/static/css/home.css">


<title>Acerca De...</title>
</head>

<body>
<a href="./" ><button>🏠 Home</button></a>
<a href="./home.html" ><button>🏹 Simulator</button></a>

<img src="./images/Archery_Ghost_Simulator.png" width="120" height="120" alt="Ghost Archery Logo">
<img src="{{url_for('static', filename='images/Archery_Ghost_Simulator.png')}}" width="120" height="120" alt="Ghost Archery Logo">

<h1>Acerca del Proyecto</h1>
El proyecto Ghost Simulator empezó como una solución a una necesidad que yo y otros arqueros teniamos, necesitabamos tener una forma fácil y rápida de poder entrenar competiciónes como si realmente estuvieramos tirando con otra persona. Existe muchas aplicaciones que permiten registrar las puntuaciones que el arquero realiza, sin embargo, no existe la posibilidad de generera las puntuaciones de otras personas como si realmente se estuviera compitiendo con otra pesrona, por ello, decidi crear este proyecto.
Expand Down Expand Up @@ -58,14 +65,14 @@ <h1>Tecnologías</h1>

La plataforma funciona gracias a las siguientes tecnologias:

<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/html5/html5-original-wordmark.svg" alt="HTML 5 Logo" width=50 height=50/>
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/php/php-original.svg" alt="PHP Logo" width=50 height=50/>
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/css3/css3-original-wordmark.svg" alt="CSS3 Logo" width=50 height=50/>
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-original.svg" alt="Javascript Logo" width=50 height=50/>
<img src="{{url_for('static', filename='images/tech_logos/html5_logo.svg')}}" alt="HTML 5 Logo" width=50 height=50/>
<img src="{{url_for('static', filename='images/tech_logos/flask_logo.svg')}}" alt="Flask Logo" width=50 height=50/>
<img src="{{url_for('static', filename='images/tech_logos/css3_logo.svg')}}" alt="CSS3 Logo" width=50 height=50/>
<img src="{{url_for('static', filename='images/tech_logos/javascript_logo.svg')}}" alt="Javascript Logo" width=50 height=50/>

<h1>Licencia</h1>

<img src="https://github.com/Isaaker/Ghost_Simulator_ES/raw/main/images/Creative%20Commons.png" alt="CC BY-NC-ND 4.0" width="100" height= "40">
<img src="{{url_for('static', filename='images/license_image.png')}}" alt="CC BY-NC-ND 4.0" width="100" height= "40">

<p>Todo el proyecto Ghost Simulator incluido imagenes, software, documentos y otras obras derivadas del proyecto están bajo la Licencia Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License - CC BY-NC-ND 4.0, que pudes consultar <a href="https://github.com/Isaaker/Ghost_Simulator_ES/blob/main/LICENSE.txt">aquí</a>.</p>

Expand Down
60 changes: 60 additions & 0 deletions ghost_simulator/templates/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!doctype html>
<html>
<head>

<!--- Content Security Policy (CSP)-->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">
<meta http-equiv="Content-Security-Policy" content="img-src 'self' github.com/Isaaker/Ghost_Simulator_ES">


<!--- Responsive Platform --->
<meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt>

<meta charset="utf-8">
<!--- Favicon --->
<link rel="apple-touch-icon" sizes="180x180" href="{{url_for('static', filename='images/apple-touch-icon.png')}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{url_for('static', filename='images/favicon-32x32.png')}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{url_for('static', filename='images/favicon-16x16.png')}}">
<link rel="manifest" href="{{url_for('static', filename='images/site.webmanifest')}}">
<meta name="msapplication-TileColor" content="#fade95">
<meta name="theme-color" content="#fade95">

<!-- Redirect to simulator home-->
<meta http-equiv="refresh" content="3;URL='./home.html'" />

<!--- CSS Style --->
<link rel="stylesheet" type="text/css" href="/static/css/login.css">


<title>Ghost Simulator - Cargando...</title>
</head>

<body>
<div class="hamster-container">
<div aria-label="Orange and tan hamster running in a metal wheel" role="img" class="wheel-and-hamster">
<div class="wheel"></div>
<div class="hamster">
<div class="hamster__body">
<div class="hamster__head">
<div class="hamster__ear"></div>
<div class="hamster__eye"></div>
<div class="hamster__nose"></div>
</div>
<div class="hamster__limb hamster__limb--fr"></div>
<div class="hamster__limb hamster__limb--fl"></div>
<div class="hamster__limb hamster__limb--br"></div>
<div class="hamster__limb hamster__limb--bl"></div>
<div class="hamster__tail"></div>
</div>
</div>
<div class="spoke"></div>
</div>
<h1 class="loading-text">Cargando...</h1>
</div>
<div class="version">
<h3>Version 3.0-beta</h3>
</div>
</body>
</html>
Loading

0 comments on commit 5ba2207

Please sign in to comment.