Skip to content

Commit

Permalink
new background options (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored May 22, 2023
1 parent 1f3fe1e commit c3cdc8e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
2 changes: 2 additions & 0 deletions flask_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def questionnaire():
return render_template(
"questionnaire.html",
animate_transition="ease-in-out",
background="some_image",
questions=questions,
current_question_id=next_q_id,
answers=answers
Expand All @@ -106,6 +107,7 @@ def questionnaire():
return render_template(
"questionnaire.html",
animate_transition="ease-in-out",
background="some_image",
questions=questions,
current_question_id=questions[0]["id"],
answers=answers
Expand Down
Binary file added flask_app/static/css/backgrounds/fancy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion flask_app/static/css/backgrounds/gradient.css
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
gradient.css

body {
background-image: linear-gradient(315deg, #DECBA4, #3E5151);
}
Empty file.
5 changes: 5 additions & 0 deletions flask_app/static/css/backgrounds/some_image.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

body {
background-image: url("fancy.jpg");
background-size: 100%;
}
2 changes: 0 additions & 2 deletions flask_app/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ html {
body {
width: 100%;
height: 100%;
background-color: #134275;
background-image: linear-gradient(315deg, #133975 0%, #0b1f53 74%);
color: #f5f5f5;
}

Expand Down
13 changes: 10 additions & 3 deletions flask_app/templates/questionnaire.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@
href="{{ url_for('static', filename='css/style.css') }}"
/>

{% set file_name = 'css/animations/' + animate_transition.rstrip() + '.css'
{% set animation_file = 'css/animations/' + animate_transition.rstrip() + '.css'
%}
<link
type="text/css"
rel="stylesheet"
animate_transition="ease-in-out"
href="{{ url_for('static', filename=file_name) }}"
href="{{ url_for('static', filename=animation_file) }}"
/>

{% set background_file = 'css/backgrounds/' + background.rstrip() + '.css'
%}
<link
type="text/css"
rel="stylesheet"
href="{{ url_for('static', filename=background_file) }}"
/>
</head>

Expand Down

0 comments on commit c3cdc8e

Please sign in to comment.