I've made it before 1st April!
This commit is contained in:
parent
773300d3b4
commit
c5a4f97c95
@ -3,7 +3,6 @@ from flask import Flask, url_for, render_template
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import numpy.random as gaussian_rnd
|
import numpy.random as gaussian_rnd
|
||||||
from app.snowfall import generate_snowfall
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
@ -68,5 +67,4 @@ def index():
|
|||||||
data = json.loads(file.read())
|
data = json.loads(file.read())
|
||||||
cols = data['cols']
|
cols = data['cols']
|
||||||
projects = data['projects']
|
projects = data['projects']
|
||||||
snowflake_image_url = dated_url_for('static', filename='images/snowflake.png')
|
return render_template('index.html', random_number=generate_iq(), projects=projects)
|
||||||
return render_template('index.html', random_number=generate_iq(), projects=projects, snowfall=generate_snowfall(snowflake_image_url))
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
'''
|
|
||||||
Source files of snowfall, including CSS you can find at https://github.com/Artimon/pure-css-snowfall
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
SNOWFLAKE_CHARACTERS = ['\U0001f49d', '\U0001f31f', '\U0001f381']
|
|
||||||
SNOWFLAKE_IMAGE_COUNT = 45
|
|
||||||
|
|
||||||
def generate_snowfall(snowflake_image_url):
|
|
||||||
snowfall = []
|
|
||||||
for char in SNOWFLAKE_CHARACTERS:
|
|
||||||
snowfall.append(f'<span>{char}</span>')
|
|
||||||
snowfall += [f'<img src="{snowflake_image_url}">'] * SNOWFLAKE_IMAGE_COUNT
|
|
||||||
return snowfall
|
|
||||||
|
|
||||||
|
|
@ -8,14 +8,8 @@
|
|||||||
<title>thematdev</title>
|
<title>thematdev</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<snowfall>
|
|
||||||
{% for snowflake in snowfall %}
|
|
||||||
<snowflake>{{snowflake|safe}}</snowflake>
|
|
||||||
{% endfor %}
|
|
||||||
</snowfall>
|
|
||||||
<div class="pagehead">
|
<div class="pagehead">
|
||||||
<div class="pagehead-inner">
|
<div class="pagehead-inner">
|
||||||
<h1 class="mainh">С Новым Годом!</h1>
|
|
||||||
<h1 class="mainh">thematdev</h1>
|
<h1 class="mainh">thematdev</h1>
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<a class="btn" href="https://git.thematdev.org/explore/repos">
|
<a class="btn" href="https://git.thematdev.org/explore/repos">
|
||||||
|
Loading…
Reference in New Issue
Block a user