Fix small bugs and redesign some cards (#8)

* fix: 🐛 fix some config examples

* docs: 📝 add doc that install genshin.py with starrail support

* fix: 🐛 suring mysql won't think 'admin' as sys word

* feat(stats):  new design of stats card

* feat(gacha):  new design of gacha log card
This commit is contained in:
CWorld 2023-05-07 18:56:52 +08:00 committed by GitHub
parent a9dca3bf2a
commit 5616f0637c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 324 additions and 314 deletions

View File

@ -40,7 +40,7 @@ OWNER=0
# VERIFY_GROUPS=[] # VERIFY_GROUPS=[]
# logger 配置 可选配置项 # logger 配置 可选配置项
# LOGGER_NAME="TGPaimon" # LOGGER_NAME="HonkaiStarRailGram"
# 打印时的宽度 # 打印时的宽度
# LOGGER_WIDTH=180 # LOGGER_WIDTH=180
# log 文件存放目录 # log 文件存放目录
@ -80,12 +80,11 @@ LOGGER_FILTERED_NAMES=["uvicorn","ErrorPush","ApiHelper"]
# API_ID=12345 # API_ID=12345
# API_HASH="abcdefg" # API_HASH="abcdefg"
# ENKA_NETWORK_API 可选配置项 # ENKA_NETWORK_API 可选配置项(暂时无法使用)
# ENKA_NETWORK_API_AGENT="" # ENKA_NETWORK_API_AGENT=""
# Web Server # Web Server
# WEB_SWITCH=False # 是否开启 # WEB_ENABLE=False # 是否开启 WebServer
# WEB_URL=http://localhost:8080/
# WEB_HOST=localhost # WEB_HOST=localhost
# WEB_PORT=8080 # WEB_PORT=8080

1
.gitignore vendored
View File

@ -139,6 +139,7 @@ data/
plugins/genshin/daily/daily.json plugins/genshin/daily/daily.json
metadata/data/ metadata/data/
resources/assets/ resources/assets/
run.ps1
### private plugins ### ### private plugins ###
plugins/private plugins/private

View File

@ -13,7 +13,6 @@
基于 [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) 的 PaiGram 基于 [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) 的 PaiGram
![Alt](https://repobeats.axiom.co/api/embed/f73c1121006cb86196f83da2170242b7a97f8be0.svg "Repobeats analytics image") ![Alt](https://repobeats.axiom.co/api/embed/f73c1121006cb86196f83da2170242b7a97f8be0.svg "Repobeats analytics image")
## 环境需求 ## 环境需求
@ -37,6 +36,10 @@ poetry install
poetry run playwright install chromium poetry run playwright install chromium
``` ```
```bash
pip install git+https://github.com/PaiGramTeam/genshin.py@sr
```
#### 可选依赖项 #### 可选依赖项
```bash ```bash

View File

@ -193,7 +193,7 @@ def upgrade() -> None:
) )
try: try:
statement = "SELECT * FROM admin;" statement = "SELECT * FROM `admin`;"
old_user_table_data = connection.execute(text(statement)) old_user_table_data = connection.execute(text(statement))
except NoSuchTableError: except NoSuchTableError:
logger.warning("Table 'admin' doesn't exist") logger.warning("Table 'admin' doesn't exist")

View File

@ -5,11 +5,13 @@
font-style: normal; font-style: normal;
} }
* { .header {
margin: 0; background: #e0dad3 url(./img/starrail.png) no-repeat right;
padding: 0; box-shadow: 0 0 8px #72a2ae79;
box-sizing: border-box; }
user-select: none;
.frame {
border-color: #cdbea8;
} }
body { body {
@ -263,7 +265,6 @@ body {
border-radius: 100%; border-radius: 100%;
transform: scale(1.5); transform: scale(1.5);
-webkit-transform: scale(1.5); -webkit-transform: scale(1.5);
} }
.ritem .role_text { .ritem .role_text {

View File

@ -2,34 +2,25 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="shortcut icon" href="#"/>
<link rel="stylesheet" type="text/css" href="gacha_log.css" /> <link rel="stylesheet" type="text/css" href="gacha_log.css" />
<link rel="preload" href="./../../fonts/tttgbnumber.ttf" as="font"> <link type="text/css" href="../../styles/public.css" rel="stylesheet" />
<link rel="preload" href="./img/提纳里.png" as="image"> <link rel="preload" href="./img/starrail.png" as="image" />
<link rel="preload" href="./../../genshin/abyss/background/roleStarBg5.png" as="image"> <script src="../../js/tailwindcss-3.1.8.js"></script>
<link rel="preload" href="./../../genshin/abyss/background/roleStarBg4.png" as="image"> <title>Title</title>
<style>
.head_box {
background-position: right center;
background: #fff url(./img/提纳里.png) no-repeat;
background-size: cover;
}
</style>
<title></title>
</head> </head>
<body id="container" class="body_box"> <body id="container" class="body_box">
<div class="container"> <div class="container">
<div class="info_box"> <div class="info_box">
<div class="header p-2 rounded-xl bg-contain mb-6">
<div class="head_box"> <div class="frame p-4 flex-col rounded-lg border-solid border-2">
<div class="id_text"> <h2 class="font-bold italic">ID: {{ uid }}</h2>
ID: {{ uid }} <h2 class="italic">
</div>
<h2 class="day_text">
{{ allNum }}抽 {{ allNum }}抽
<span class="label label_{{type}}">{{ typeName }}</span> <span class="label text-neutral-600 label_{{type}}"
>{{ typeName }}</span
>
</h2> </h2>
<img class="starrail_logo" src="./../../bot/help/background/starrail.png" alt=""/> </div>
</div> </div>
<div class="data_box"> <div class="data_box">
@ -38,7 +29,9 @@
<div class="data_line"> <div class="data_line">
{% for item in val %} {% for item in val %}
<div class="data_line_item"> <div class="data_line_item">
<div class="num">{{item.num}}<span class="unit">{{item.unit}}</span></div> <div class="num">
{{item.num}}<span class="unit">{{item.unit}}</span>
</div>
<div class="lable">{{item.lable}}</div> <div class="lable">{{item.lable}}</div>
</div> </div>
{% endfor %} {% endfor %}
@ -51,7 +44,6 @@
<span class="line"></span> <span class="line"></span>
</div> </div>
<div class="card_list"> <div class="card_list">
{% for val in fiveLog %} {% for val in fiveLog %}
<div class="item star5"> <div class="item star5">

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

View File

@ -13,18 +13,25 @@
</head> </head>
<body class="text-neutral-600"> <body class="text-neutral-600">
<div class="mx-auto max-w-[600px] py-8"> <div class="mx-auto max-w-[600px] py-8">
<div class="header p-6 flex mb-8 rounded-xl bg-cover justify-between"> <div class="header p-2 rounded-xl bg-cover mb-6">
<div
class="frame-pic p-4 flex justify-between rounded-lg border-solid border-2"
>
<div class="flex flex-col items-center justify-center"> <div class="flex flex-col items-center justify-center">
<h1 class="text-4xl italic name mb-2 px-2"> <h1 class="name text-4xl italic mb-2 px-2 text-shadow">
{{ info.nickname }} {{ info.nickname }}
<span class="text-lg">lv.{{ info.level }}</span> <span class="text-lg">lv.{{ info.level }}</span>
</h1> </h1>
<h1 class="italic uid px-10">UID - {{ uid }}</h1> <h1 class="italic uid px-10">UID - {{ uid }}</h1>
</div> </div>
</div> </div>
<div class="box pt-4 rounded-xl overflow-hidden"> </div>
<div> <div class="box p-2 rounded-xl overflow-hidden">
<h2 class="box-title text-center text-xl ring text-neutral-100 p-1"> <div class="frame rounded-lg border-solid border-2">
<h2
class="title font-semibold pt-4 text-center text-xl text-neutral-700 p-1"
>
<img src="./items/star.png" class="inline-block w-4" />
数据总览 数据总览
</h2> </h2>
<div class="p-6 grid grid-cols-4 gap-4 text-center"> <div class="p-6 grid grid-cols-4 gap-4 text-center">
@ -35,12 +42,12 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div>
<div class="about text-center leading-8 text-xs opacity-50"> <div class="about text-center leading-8 text-xs opacity-50">
所有数据会有一小时延迟 以游戏内为准 此处仅供参考 所有数据会有一小时延迟 以游戏内为准 此处仅供参考
</div> </div>
</div> </div>
</div> </div>
</div>
</body> </body>
</html> </html>

View File

@ -4,17 +4,12 @@ body {
.header { .header {
background-image: url(../../bot/help/background/header.png); background-image: url(../../bot/help/background/header.png);
box-shadow: 0 0 8px rgb(123 242 248 / 50%); box-shadow: 0 0 8px #72a2ae79;
} }
.box { .box {
background-color: #fdfdf3; background-color: #f4f2e4;
box-shadow: 0 0 8px rgb(123 242 248 / 50%); box-shadow: 0 0 8px #72a2ae79;
}
.box-title {
background-color: #43849abb;
--tw-ring-color: #43849a;
} }
.pointer-bar { .pointer-bar {
@ -32,18 +27,30 @@ body {
} }
.name { .name {
background: linear-gradient(to bottom, #FFFFEE, #FFEEFF, #EEFFFF); color: #ffffee;
background-clip: text; text-shadow: 0 0.08em 0.1em #00000093, 0 0.1em 0.3em rgba(0, 0, 0, 0.4);
-webkit-background-clip: text;
color: transparent;
} }
.uid { .uid {
color: #fff; color: #fff;
background: linear-gradient(to right, rgb(0, 0, 0, 0), #5ddddd, rgb(0, 0, 0, 0)); background: linear-gradient(
to right,
rgb(0, 0, 0, 0),
#3f7587 25%,
#3f7587 75%,
rgb(0, 0, 0, 0)
);
} }
.about { .about {
background-color: #e0dad3; background-color: #e0dad3;
color: #8a4d30; color: #8a4d30;
} }
.frame-pic {
border-color: #fdfdf356;
}
.frame {
border-color: #cdbea8;
}