add: random bg
All checks were successful
Deploy via SSH on push / deploy-via-ssh (push) Successful in 22s

This commit is contained in:
2025-12-01 11:05:16 +00:00
parent 651e4e2893
commit 378f096fd6
9 changed files with 5 additions and 2 deletions

View File

@@ -1,10 +1,13 @@
import random
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def home():
return render_template("index.html", title="Accueil")
bg_files = os.listdir("static/img/backgrounds")
bg = random.choice(bg_files)
return render_template("index.html", title="Accueil", background=bg)
@app.route("/projects")
def projects():

View File

@@ -9,7 +9,7 @@ body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-image: url("/static/img/background.webp");
background-image: url("{{ url_for('static', filename='img/backgrounds/' ~ background) }}");
background-size: cover;
background-repeat: no-repeat;
background-position: center;

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB