Skip to content

Commit

Permalink
add random images slayd on index page
Browse files Browse the repository at this point in the history
  • Loading branch information
RustamovAkrom committed Oct 28, 2024
1 parent 1e26ce4 commit 064114a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/routes/site.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import random

from flask import Blueprint, render_template, abort, send_from_directory, flash, request
from flask_mail import Message
from app.models import Resume, About, Skill, Service, Project, Category, Contact
Expand Down Expand Up @@ -27,7 +29,8 @@ def index():
# "template_title": "Rustamov Akrom",
"template_body_class_name": "index",
"resume": resume_data,
"about_avatar_url": about_avatar_url.avatar
"about_avatar_url": about_avatar_url.avatar,
"baground_image": f"{random.randint(1, 3)}.jpg"
}
return context

Expand Down
Binary file added app/static/assets/img/bg_images/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/assets/img/bg_images/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/assets/img/bg_images/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/templates/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- Hero Section -->
<section id="hero" class="hero section dark-background">
<img src="{{ url_for('static', filename='assets/img/index-bg.jpg') }}" alt="Background Image" data-aos="fade-in" class="img-fluid">
<img src="{{ url_for('static', filename='assets/img/bg_images/' + baground_image ) }}" alt="Background Image" data-aos="fade-in" class="img-fluid">

<div class="container d-flex align-items-center" data-aos="zoom-out" data-aos-delay="100">
<div class="col-md-6">
Expand Down

0 comments on commit 064114a

Please sign in to comment.