-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc0b06b
commit fb12cc1
Showing
13 changed files
with
123 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from colour import Color | ||
from PIL import ImageDraw, ImageFont, Image | ||
|
||
|
||
def generate_cover(sid, aid, grad): | ||
img = Image.new("RGBA", (1920, 1080)) | ||
im = img.load() | ||
x, y = img.size | ||
if grad == 0: | ||
col = Color('#9D00B9') | ||
colors = list(map(lambda x: x.rgb, col.range_to(Color("blue"), 1920))) | ||
elif grad == 1: | ||
col = Color('#9D00B9') | ||
colors = list(map(lambda x: x.rgb, col.range_to(Color("white"), 1920))) | ||
elif grad == 2: | ||
col = Color('#9D00B9') | ||
colors = list(map(lambda x: x.rgb, col.range_to(Color((74, 186, 87)), 1920))) | ||
for i in range(x): | ||
for j in range(y): | ||
im[i, j] = (int(colors[i][0]), int(colors[i][1]), int(colors[i][2])) | ||
|
||
img.save(f"data/{aid}/{sid}_cover.png") | ||
|
||
generate_cover(1, 1, 0) |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,6 @@ | |
<!-- <noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript> --> | ||
|
||
|
||
|
||
|
||
</head> | ||
|
||
<body class="homepage is-preload"> | ||
|
@@ -29,7 +27,7 @@ | |
<div style="display: flex;justify-content: space-between;margin-top:2%;justify-content: center;align-items: center;background-color:azure;"> | ||
<div class="col-xs-3 col-sm-5 col-lg-4"><a href="/logout" class="btn btn-block btn-primary" style="float:left;">Logout</a></div> | ||
<div class='col'> | ||
{% if not current_user.utype %} | ||
{% if not current_user.utype %} | ||
<h3 class="post-category" style='float:right; margin-right: 5%;'>Hello <a class='username' href='/dashboard'>{{ current_user.nickname }}!</a></h3> | ||
|
||
{% else %} | ||
|
@@ -75,16 +73,19 @@ <h3 class="post-category" style='float:right; margin-right: 5%;'>Hello <a class= | |
|
||
<!-- Scripts --> | ||
<script src="{{ url_for('static', filename='/js/jquery.min.js') }}"></script> | ||
|
||
<script src="{{ url_for('static', filename='/js/main2.js') }}"></script> | ||
|
||
<!-- include libraries(jQuery, bootstrap) --> | ||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | ||
<script c="https://code.jquery.com/jquery-3.4.1.min.js"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | ||
<script c="https://code.jquery.com/jquery-3.4.1.min.js"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
|
||
<!-- include summernote css/js --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote.min.css" rel="stylesheet"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote.min.js"></script> | ||
|
||
|
||
<!-- include summernote css/js --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote.min.css" rel="stylesheet"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/summernote.min.js"></script> | ||
|
||
|
||
</body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,62 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
|
||
<head> | ||
<title>stories.ua.kz.ru</title> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> | ||
<link rel="stylesheet" href="static/css/main2.css" /> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | ||
<script src="https://kit.fontawesome.com/f755b64f54.js" crossorigin="anonymous"></script> | ||
<!-- <noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript> --> | ||
</head> | ||
|
||
<body class="homepage is-preload"> | ||
<!-- NAVBAR --> | ||
<nav class="navbar navbar-light" id='navbar-nav'> | ||
<div class="navbar-in" id='navbar-in'>STO <a href="/"><img src="https://img.icons8.com/nolan/64/r.png"></a>IES.RU</div> | ||
</nav> | ||
{% block content %}{% endblock %} | ||
|
||
<div class="row"> | ||
<div class="col"></div> | ||
</div> | ||
|
||
|
||
|
||
|
||
|
||
<!-- FOOTER --> | ||
<footer> | ||
<div class="container"> | ||
<div class="d-flex justify-content-around"> | ||
<div class="footer-left"> | ||
<a href="https://vk.com/m.kashirsky"><i class="fab fa-vk fa-5x"></i></a> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Id enim voluptatibus culpa facere, eveniet qui libero atque, aliquam dignissimos velit, provident modi laudantium quae ipsa. Neque, inventore nobis explicabo optio.</p> | ||
</div> | ||
|
||
<div class="footer-center"> | ||
<i class="fab fa-discord fa-5x"></i> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Id enim voluptatibus culpa facere, eveniet qui libero atque, aliquam dignissimos velit, provident modi laudantium quae ipsa. Neque, inventore nobis explicabo optio.</p> | ||
</div> | ||
|
||
<div class="footer-right"> | ||
<a href="https://vk.com/kiryabikeev"><i class="fab fa-vk fa-5x"></i></a> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Id enim voluptatibus culpa facere, eveniet qui libero atque, aliquam dignissimos velit, provident modi laudantium quae ipsa. Neque, inventore nobis explicabo optio.</p> | ||
</div> | ||
{% extends "base.html" %} | ||
|
||
{% block content %} | ||
|
||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> | ||
|
||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> | ||
|
||
<!--Carousel Wrapper--> | ||
<div id="carousel-example-1z" class="carousel slide carousel-fade" data-ride="carousel"> | ||
<!--Indicators--> | ||
<ol class="carousel-indicators"> | ||
<li data-target="#carousel-example-1z" data-slide-to="0" class="active"></li> | ||
{% for ind in range(1, len(stories) + 1) %} | ||
<li data-target="#carousel-example-1z" data-slide-to="{{ str(ind) }}"></li> | ||
{% endfor %} | ||
</ol> | ||
<!--/.Indicators--> | ||
<!--Slides--> | ||
<div class="carousel-inner" role="listbox"> | ||
<!--First slide--> | ||
<div class="carousel-item active"> | ||
<img class="d-block w-100" src="/static/img/white.jpg" alt="First slide"> | ||
<div class="carousel-caption d-md-block"> | ||
<h2>Hello! Let's have a look!</h2> | ||
<a href="#" class='btn btn-block btn-primary'>Let's go!</a> | ||
</div> | ||
</div> | ||
<!--/First slide--> | ||
|
||
{% for story in stories %} | ||
<div class="carousel-item"> | ||
<img class="d-block w-100" src="{{ story.color }}" alt="Second slide"> | ||
<div class="carousel-caption d-md-block"> | ||
<h2>{{ story.head }}</h2> | ||
<a href="/story/{ stoty.id }" class='btn btn-block btn-primary'>Read more</a> | ||
</div> | ||
</div> | ||
</footer> | ||
|
||
<!-- Scripts --> | ||
<script src="static/js/jquery.min.js"></script> | ||
<script src="static/js/main2.js"></script> | ||
</body> | ||
{% endfor %} | ||
|
||
</html> | ||
</div> | ||
<!--/.Slides--> | ||
<!--Controls--> | ||
<a class="carousel-control-prev" href="#carousel-example-1z" role="button" data-slide="prev" id="but"> | ||
<span class="carousel-control-prev-icon" aria-hidden="true"></span> | ||
<span class="sr-only">Previous</span> | ||
</a> | ||
<a class="carousel-control-next" href="#carousel-example-1z" role="button" data-slide="next" id="but"> | ||
<span class="carousel-control-next-icon" aria-hidden="true"></span> | ||
<span class="sr-only">Next</span> | ||
</a> | ||
<!--/.Controls--> | ||
</div> | ||
|
||
|
||
|
||
{% endblock %} |