feat: добавлены иконки для PWA

This commit is contained in:
Vlad 2025-05-03 01:24:06 +03:00
parent 010e5817dc
commit 1bc4c2510f
9 changed files with 31 additions and 0 deletions

31
generate_icons.py Normal file
View File

@ -0,0 +1,31 @@
from PIL import Image
import os
def generate_icons():
# Создаем директорию если её нет
if not os.path.exists('static/icons'):
os.makedirs('static/icons')
# Открываем исходное изображение
source = Image.open('static/Logo2.png')
# Размеры иконок
sizes = [72, 96, 128, 144, 152, 192, 384, 512]
# Генерируем иконки каждого размера
for size in sizes:
# Создаем новое изображение с белым фоном
icon = Image.new('RGBA', (size, size), (255, 255, 255, 0))
# Изменяем размер исходного изображения
resized = source.resize((size, size), Image.Resampling.LANCZOS)
# Вставляем в центр
icon.paste(resized, (0, 0))
# Сохраняем
icon.save(f'static/icons/icon-{size}x{size}.png', 'PNG')
print(f'Создана иконка {size}x{size}')
if __name__ == '__main__':
generate_icons()

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
static/icons/icon-72x72.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
static/icons/icon-96x96.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB