add: random bg
All checks were successful
Deploy via SSH on push / deploy-via-ssh (push) Successful in 22s
@@ -1,10 +1,13 @@
|
|||||||
|
import random
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def home():
|
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")
|
@app.route("/projects")
|
||||||
def projects():
|
def projects():
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ body {
|
|||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background-image: url("/static/img/background.webp");
|
background-image: url("{{ url_for('static', filename='img/backgrounds/' ~ background) }}");
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
BIN
src/data/static/img/backgrounds/background2.webp
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
src/data/static/img/backgrounds/background3.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/data/static/img/backgrounds/background4.webp
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/data/static/img/backgrounds/background5.webp
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src/data/static/img/backgrounds/background6.gif
Normal file
|
After Width: | Height: | Size: 321 KiB |
BIN
src/data/static/img/backgrounds/background7.webp
Normal file
|
After Width: | Height: | Size: 15 KiB |