mirror of
https://github.com/arthur-pbty/PyRoute.git
synced 2026-06-03 15:07:34 +02:00
Adds css and js files
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
+8
-2
@@ -1,8 +1,14 @@
|
||||
from modules import page_html
|
||||
from modules import page_html, page_css_js
|
||||
|
||||
|
||||
def page_accueil():
|
||||
return page_html('welcome')
|
||||
|
||||
def page_accueil_css():
|
||||
return page_css_js('style','css')
|
||||
|
||||
def a_propos():
|
||||
return "À propos de nous!"
|
||||
return page_html('aboute')
|
||||
|
||||
def a_propos_css():
|
||||
return page_css_js('aboute','css')
|
||||
+6
-1
@@ -1,4 +1,9 @@
|
||||
def page_html(page):
|
||||
with open(f'resources/views/{page}.html', 'r') as fichier_html:
|
||||
with open(f'resources/views/{page}.html', 'r', encoding='utf-8') as fichier_html:
|
||||
res = fichier_html.read()
|
||||
return res
|
||||
|
||||
def page_css_js(page, type):
|
||||
with open(f'resources/{type}/{page}.{type}', 'r', encoding='utf-8') as fichier_css_js:
|
||||
res = fichier_css_js.read()
|
||||
return res
|
||||
@@ -0,0 +1,16 @@
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f2f2f2;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 18px;
|
||||
color: #c40000;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f2f2f2;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2 {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="/aboute.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Aboute</h1>
|
||||
<p>c'est une page</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,10 +3,13 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<title>Bienvenue sur PyRoute</title>
|
||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello, World!</h1>
|
||||
<a href="/a-propos">About</a>
|
||||
<h1>Ça fonctionne !</h1>
|
||||
<h2>Bienvenue sur PyRoute</h2>
|
||||
<p>Ceci est la page d'accueil de l'application web PyRoute.</p>
|
||||
<p><a href="/a-propos">En savoir plus sur nous</a></p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,7 @@
|
||||
routes = {
|
||||
"/": "page_accueil",
|
||||
"/a-propos": "a_propos"
|
||||
"/style.css": "page_accueil_css",
|
||||
|
||||
"/a-propos": "a_propos",
|
||||
"/aboute.css": "a_propos_css"
|
||||
}
|
||||
@@ -6,6 +6,7 @@ from dotenv import load_dotenv
|
||||
from route import *
|
||||
from controller import *
|
||||
|
||||
|
||||
load_dotenv()
|
||||
listen = int(os.getenv("LISTEN"))
|
||||
host = os.getenv("HOST")
|
||||
|
||||
Reference in New Issue
Block a user