绑定使用图片回复 #61 (#305)

* 🚧 查数据图初版测试

Co-authored-by: C1ystal <m17687496044@163.com>
Co-authored-by: C29H25N3O5 <michaelgu495@gmail.com>

* 🙈 添加一些 ignore 文件

* 🎨 格式化代码

* 🐛 修复格式化导致的样式爆炸

* 💄 优化曲线图观感

* 💄 将雷达图的指示器名称旋转显示

* 💄 查数据图第二版

Co-authored-by: C29H25N3O5 <michaelgu495@gmail.com>

* ✏️ 修复 typo

* 💄 把用户头像文件的引用放到 html 里

* 💄 账户绑定图第一版

Co-authored-by: C1ystal <m17687496044@163.com>
Co-authored-by: C29H25N3O5 <michaelgu495@gmail.com>

* 🚧 模板化测试

*  添加依赖 fastapi

*  通过 FastAPI 提供静态文件

*  添加依赖 jinja2

* 💄 更新数据图模板 (#291)

* feat(template): show actual value

* feat(template): add user avatar

* feat(template): fix radar

* feat(style): fix name container width fixed caused display misplacement

* feat(style): fix vs value wrap display

* feat(template): make check data length in template

* feat(template): update radar data

* feat(jinja): update data

* fix(template): fix typo

* feat(style): prevent sign too long

* feat(template): turn off echarts animation

* chore(deps): add identicon.js

* fix(template): fix typo

* 🙈 更新.gitignore

* 🏗️ 大部分重构为 flex 布局

---------

Co-authored-by: shoucandanghehe <wallfjjd@gmail.com>
Co-authored-by: 呵呵です <51957264+shoucandanghehe@users.noreply.github.com>

*  添加依赖 nonebot_plugin_userinfo

*  通过 FastAPI 托管渲染后的模板

*  新增头像 api 使用 playwright 生成

*  修正模板资源文件引用路径
被托管后的正确路径

* 💄 将绑定图模板化

* 💄 重命名变量

* 🚚 重命名资源

*  使用 jinja2 渲染模板

*  使用 playwright 渲染网页

* 🩹 渲染模板时对 IO 进行一些额外处理

*  添加依赖 pillow

* 🚚 修改托管页面的路由路径

* 💬 优化绑定图文案

*  新增获取自身网络位置的方法

* 🍱 更新 unknown.svg

*  新增获取用户头像的方法

*  绑定消息使用图片回复

*  为 identicon api 添加缓存

* 🔥 删除旧文件

* 🚚 重命名模板

* 📄 添加字体 License

* 🙈 更新.gitignore

---------

Co-authored-by: C1ystal <m17687496044@163.com>
Co-authored-by: C29H25N3O5 <michaelgu495@gmail.com>
Co-authored-by: 渣渣120 <WOSHIZHAZHA120@qq.com>
This commit is contained in:
呵呵です
2024-05-02 01:22:33 +08:00
committed by GitHub
parent 80f4316564
commit fd85140c99
62 changed files with 2302 additions and 48 deletions

View File

@@ -0,0 +1,27 @@
<svg width="275" height="125" viewBox="0 0 275 125" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_601_51)">
<rect width="275" height="125" rx="30" fill="url(#paint0_linear_601_51)"/>
<g style="mix-blend-mode:overlay">
<mask id="mask0_601_51" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="127" y="-29" width="195" height="196">
<rect x="127.168" y="12.7571" width="158.811" height="158.811" transform="rotate(-15 127.168 12.7571)" fill="url(#paint1_radial_601_51)"/>
</mask>
<g mask="url(#mask0_601_51)">
<path d="M189.83 16.5183L186.405 3.73504L224.755 -6.54079L228.18 6.24251L189.83 16.5183ZM221.453 83.4012L234.236 79.976L223.96 41.6261L211.177 45.0513L221.453 83.4012ZM241.545 132.822C233.662 134.934 225.825 135.408 218.032 134.245C210.242 133.076 203.038 130.58 196.42 126.759C189.801 122.938 184.039 117.947 179.131 111.785C174.227 105.619 170.719 98.5937 168.607 90.7107C166.495 82.8277 166.02 74.9898 167.184 67.1972C168.353 59.4077 170.848 52.2037 174.669 45.5852C178.491 38.9667 183.482 33.206 189.645 28.303C195.811 23.3946 202.835 19.8843 210.718 17.7721C217.323 16.0024 223.946 15.3693 230.589 15.8728C237.232 16.3764 243.759 17.9385 250.17 20.5594L256.721 9.21339L268.067 15.764L261.516 27.11C266.992 31.3517 271.608 36.2232 275.366 41.7244C279.123 47.2255 281.887 53.2785 283.657 59.8832C285.769 67.7662 286.243 75.6041 285.079 83.3967C283.91 91.1862 281.415 98.3902 277.594 105.009C273.773 111.627 268.781 117.39 262.62 122.297C256.453 127.201 249.428 130.71 241.545 132.822ZM238.12 120.039C250.477 116.727 259.853 109.534 266.248 98.4581C272.643 87.3822 274.184 75.6657 270.873 63.3085C267.562 50.9513 260.369 41.5754 249.293 35.1807C238.217 28.7861 226.5 27.2443 214.143 30.5554C201.786 33.8665 192.41 41.06 186.015 52.1358C179.621 63.2117 178.079 74.9282 181.39 87.2854C184.701 99.6426 191.895 109.019 202.971 115.413C214.046 121.808 225.763 123.35 238.12 120.039Z" fill="#1C1B1F"/>
</g>
</g>
<path d="M33.475 42H26.95V38.825H32.95C33.9 38.825 34.5917 38.6667 35.025 38.35C35.4583 38.0333 35.675 37.5333 35.675 36.85C35.675 36.4 35.5667 36.0333 35.35 35.75C35.15 35.4667 34.85 35.2583 34.45 35.125C34.05 34.975 33.5667 34.9 33 34.9H26.95V32.025H32.675C33.1417 32.025 33.5417 31.9667 33.875 31.85C34.225 31.7333 34.4917 31.55 34.675 31.3C34.875 31.0333 34.975 30.6833 34.975 30.25C34.975 29.7833 34.875 29.425 34.675 29.175C34.4917 28.9083 34.225 28.7167 33.875 28.6C33.525 28.4833 33.1083 28.425 32.625 28.425H26.95V25.25H33.575C34.8083 25.25 35.8 25.4417 36.55 25.825C37.3167 26.1917 37.875 26.7 38.225 27.35C38.575 28 38.75 28.7167 38.75 29.5C38.75 30.2167 38.6 30.825 38.3 31.325C38.0167 31.8083 37.6333 32.2 37.15 32.5C36.6667 32.7833 36.1167 33 35.5 33.15C34.8833 33.2833 34.25 33.3667 33.6 33.4C35.0167 33.45 36.1417 33.6583 36.975 34.025C37.825 34.3917 38.4333 34.8917 38.8 35.525C39.1667 36.1417 39.35 36.8417 39.35 37.625C39.35 38.675 39.1083 39.5167 38.625 40.15C38.1417 40.7833 37.4583 41.25 36.575 41.55C35.6917 41.85 34.6583 42 33.475 42ZM28.925 42H25.35V25.25H28.925V42ZM44.9871 42H41.4121V25.25H44.9871V42ZM51.0906 28.3H47.5156V25.25H51.0906V28.3ZM51.0906 42H47.5156V29.75H51.0906V42ZM58.4691 42.25C57.5691 42.25 56.8191 42.0833 56.2191 41.75C55.6358 41.4167 55.2025 40.9583 54.9191 40.375C54.6358 39.7917 54.4941 39.125 54.4941 38.375V28.3L58.0691 26.425V37.725C58.0691 38.225 58.1775 38.575 58.3941 38.775C58.6275 38.975 58.9191 39.075 59.2691 39.075C59.6525 39.075 60.0025 38.95 60.3191 38.7C60.6525 38.4333 60.9108 38.125 61.0941 37.775L62.1191 40.7C61.8525 41.0333 61.4108 41.375 60.7941 41.725C60.1775 42.075 59.4025 42.25 58.4691 42.25ZM61.4691 32.475H52.6691V29.75H61.4691V32.475ZM73.9848 42H62.7848V39.375L67.0348 34.725L69.6598 32.475L66.0348 32.65H63.1348V29.75H73.7348V32.375L69.4098 36.8L66.6348 39.25L70.4098 39.1H73.9848V42Z" fill="#8E23B4"/>
</g>
<defs>
<linearGradient id="paint0_linear_601_51" x1="50.5" y1="-12" x2="244" y2="144.5" gradientUnits="userSpaceOnUse">
<stop stop-color="#EAC7FF"/>
<stop offset="1" stop-color="#D19CFA"/>
</linearGradient>
<radialGradient id="paint1_radial_601_51" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(206.573 92.1626) rotate(90) scale(84.3683)">
<stop offset="0.208333" stop-color="white" stop-opacity="0.78"/>
<stop offset="1" stop-color="white" stop-opacity="0"/>
</radialGradient>
<clipPath id="clip0_601_51">
<rect width="275" height="125" rx="30" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB