Adds css and js files

This commit is contained in:
Tutur33
2023-11-05 17:37:42 +01:00
parent 998af22328
commit be54738678
11 changed files with 80 additions and 7 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+8 -2
View File
@@ -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
View File
@@ -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
+16
View File
@@ -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;
}
+26
View File
@@ -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;
}
+13
View File
@@ -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>
+6 -3
View File
@@ -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>
+4 -1
View File
@@ -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"
}
+1
View File
@@ -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")