Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e0ab15a34 | |||
| 6c3ea8fc6f | |||
| ca427f1fdd | |||
| 014ca8e51e | |||
| 0f64edc73c |
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 楼湘缘
|
||||
Copyright (c) 2026 edgevoid
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+90
-25
@@ -1,36 +1,101 @@
|
||||
# 爆闪进度条
|
||||
|
||||
#### Description
|
||||
一个基于Python的会爆闪的进度条
|
||||
# 🌀 INTP Loading Animation Simulator
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
> A vibrant, high-contrast terminal loading animation with dramatic flash alerts—designed for the INTP mindset (or anyone who loves stylish CLI effects)!
|
||||
|
||||
#### Installation
|
||||
## 📌 Overview
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
This project uses Python’s [`rich`](https://github.com/Textualize/rich) library to render a dynamic, multi-round loading animation directly in your terminal. Each cycle concludes with a bright, eye-catching flash—symbolizing the moment an INTP’s deep thinking finally crystallizes into insight ✨.
|
||||
|
||||
#### Instructions
|
||||
Inspired by the INTP cognitive style: slow to start, deeply processing, but brilliantly illuminating upon completion.
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
---
|
||||
|
||||
#### Contribution
|
||||
## 🚀 Key Features
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
- **Multi-round simulation**: Default of 5 rounds, each with 60 steps—mimicking phased ideation.
|
||||
- **Vibrant dynamic colors**: Randomly selected high-saturation RGB combinations (red, green, blue, yellow, magenta, cyan) for maximum visual contrast.
|
||||
- **Classic spinner**: Smooth `| / - \` rotation indicator for classic terminal loading vibes.
|
||||
- **Flash completion alert**: A bold white-on-pink burst flashes briefly at the end of each round.
|
||||
- **Fully configurable**: Easily adjust rounds, speed, and steps via simple variables.
|
||||
- **Flicker-free rendering**: Powered by `rich.live` for smooth, real-time updates in modern terminals.
|
||||
|
||||
---
|
||||
|
||||
#### Gitee Feature
|
||||
## 🛠️ Installation
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
Requires Python 3.7+ and the `rich` library.
|
||||
|
||||
```bash
|
||||
pip install rich
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ▶️ Usage
|
||||
|
||||
Download or clone `main.py`, then run:
|
||||
|
||||
```bash
|
||||
python main.py
|
||||
```
|
||||
|
||||
The animation will play in your terminal. Press **Enter** to exit after completion.
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Customization
|
||||
|
||||
Tweak behavior by editing the configuration block at the top of `main.py`:
|
||||
|
||||
```python
|
||||
ROUNDS = 5 # Total animation cycles
|
||||
STEPS = 60 # Steps per cycle (visual length)
|
||||
SLEEP_STEP = 0.15 # Delay between steps (seconds)
|
||||
SLEEP_FULL = 0.6 # Duration of the flash effect (seconds)
|
||||
```
|
||||
|
||||
Save and re-run to see changes.
|
||||
|
||||
---
|
||||
|
||||
## 🎨 Color Strategy
|
||||
|
||||
Colors are generated by `get_vibrant_color()`, using these rules to ensure brightness and distinction:
|
||||
|
||||
| Type | RGB Pattern |
|
||||
|----------|----------------------------------|
|
||||
| Red | `(255, g, b)` where g,b ∈ [80–200] |
|
||||
| Green | `(r, 255, b)` where r,b ∈ [80–200] |
|
||||
| Blue | `(r, g, 255)` where r,g ∈ [80–200] |
|
||||
| Yellow | `(255, 255, b)` where b ∈ [0–100] |
|
||||
| Magenta | `(255, g, 255)` where g ∈ [0–100] |
|
||||
| Cyan | `(r, 255, 255)` where r ∈ [0–100] |
|
||||
|
||||
All colors remain vivid while avoiding low-contrast pitfalls.
|
||||
|
||||
---
|
||||
|
||||
## 💡 Ideal Use Cases
|
||||
|
||||
- Adding flair to CLI tool startup sequences
|
||||
- Demoing terminal UI capabilities in talks or tutorials
|
||||
- Personalizing your dotfiles or developer workflow
|
||||
- Playfully signaling “deep thought in progress” during demos
|
||||
|
||||
---
|
||||
|
||||
## 📄 License
|
||||
|
||||
MIT License — free to use, modify, and distribute.
|
||||
|
||||
---
|
||||
|
||||
## ❤️ Acknowledgements
|
||||
|
||||
- [Rich](https://github.com/Textualize/rich) – for making beautiful terminal interfaces effortless
|
||||
- The global community of terminal enthusiasts and creative coders
|
||||
|
||||
---
|
||||
|
||||
> “I’m not slow—I’m just compiling.” — An INTP somewhere in the matrix
|
||||
@@ -1,185 +1,101 @@
|
||||
|
||||
# 🌀 INTP 加载动画模拟器
|
||||
|
||||
# 爆闪进度条
|
||||
> 一个炫酷、高对比度、带爆闪完成提示的终端加载动画,专为“INTP”人格类型(或任何喜欢酷炫终端效果的人)设计!
|
||||
|
||||
一个基于 Python 的创意进度条库,可以实现炫酷的爆闪效果,让命令行进度条更加生动有趣。
|
||||
## 📌 简介
|
||||
|
||||
## 特性
|
||||
本项目通过 Python 的 [`rich`](https://github.com/Textualize/rich) 库,在终端中实现一个多轮次、色彩鲜艳、动态流畅的加载动画。每轮加载完成后会触发一次高亮爆闪提示,带来强烈的视觉反馈,兼具趣味性与极客风格。
|
||||
|
||||
- **爆闪特效**:进度条在加载过程中会呈现闪烁效果,吸引注意力
|
||||
- **易于使用**:简洁的 API 设计,快速集成到项目中
|
||||
- **高度可定制**:支持自定义颜色、闪烁速度、进度条样式等参数
|
||||
- **跨平台**:支持 Windows、macOS、Linux 等主流操作系统
|
||||
- **纯 Python 实现**:无需额外依赖,安装简单
|
||||
|
||||
## 安装
|
||||
|
||||
### 使用 pip 安装(推荐)
|
||||
|
||||
```bash
|
||||
pip install flashing-progress-bar
|
||||
```
|
||||
|
||||
### 源码安装
|
||||
|
||||
```bash
|
||||
# 克隆仓库
|
||||
git clone https://gitee.com/louxian-yuan/flashing-progress-bar.git
|
||||
|
||||
# 进入项目目录
|
||||
cd flashing-progress-bar
|
||||
|
||||
# 安装
|
||||
pip install .
|
||||
```
|
||||
|
||||
## 快速开始
|
||||
|
||||
```python
|
||||
from flashing_progress_bar import FlashingProgressBar
|
||||
|
||||
# 基本用法
|
||||
progress = FlashingProgressBar(total=100)
|
||||
for i in range(101):
|
||||
progress.update(i)
|
||||
# 进度条会自动显示闪烁效果
|
||||
```
|
||||
|
||||
```python
|
||||
# 自定义样式
|
||||
from flashing_progress_bar import FlashingProgressBar
|
||||
|
||||
progress = FlashingProgressBar(
|
||||
total=100,
|
||||
desc="下载中",
|
||||
color="cyan",
|
||||
flash_speed=0.1,
|
||||
width=50
|
||||
)
|
||||
|
||||
for i in range(101):
|
||||
progress.update(i)
|
||||
```
|
||||
|
||||
## API 文档
|
||||
|
||||
### FlashingProgressBar
|
||||
|
||||
进度条的主类,用于创建和管理进度条显示。
|
||||
|
||||
**参数说明:**
|
||||
|
||||
- `total` (int):进度条的总任务量,默认为 100
|
||||
- `desc` (str):进度条的描述信息,默认为空
|
||||
- `color` (str):进度条的颜色,支持多种颜色
|
||||
- `flash_speed` (float):闪烁速度,数值越小闪烁越快
|
||||
- `width` (int):进度条的宽度,默认为 50
|
||||
- `fill` (str):进度条的填充字符
|
||||
- `blank` (str):进度条的空白字符
|
||||
|
||||
**主要方法:**
|
||||
|
||||
- `update(n)`:更新进度条到指定进度
|
||||
- `set_description(desc)`:设置进度条描述
|
||||
- `close()`:关闭进度条
|
||||
|
||||
## 高级用法
|
||||
|
||||
### 自定义闪烁效果
|
||||
|
||||
```python
|
||||
from flashing_progress_bar import FlashingProgressBar
|
||||
|
||||
# 自定义闪烁颜色序列
|
||||
progress = FlashingProgressBar(
|
||||
total=100,
|
||||
colors=["#FF0000", "#00FF00", "#0000FF"],
|
||||
flash_mode="rainbow"
|
||||
)
|
||||
```
|
||||
|
||||
### 多任务进度条
|
||||
|
||||
```python
|
||||
from flashing_progress_bar import FlashingProgressBar
|
||||
|
||||
# 同时管理多个进度条
|
||||
tasks = [
|
||||
{"desc": "任务1", "total": 100},
|
||||
{"desc": "任务2", "total": 200},
|
||||
{"desc": "任务3", "total": 150}
|
||||
]
|
||||
|
||||
bars = []
|
||||
for task in tasks:
|
||||
bar = FlashingProgressBar(**task)
|
||||
bars.append(bar)
|
||||
|
||||
# 更新各个进度条
|
||||
for i in range(101):
|
||||
for bar in bars:
|
||||
bar.update(i)
|
||||
```
|
||||
|
||||
## 配置选项
|
||||
|
||||
### 颜色支持
|
||||
|
||||
支持以下颜色:
|
||||
- 英文颜色名:`red`, `green`, `blue`, `yellow`, `cyan`, `magenta` 等
|
||||
- 十六进制颜色:`#FF0000`, `#00FF00` 等
|
||||
- ANSI 颜色代码
|
||||
|
||||
### 环境变量
|
||||
|
||||
| 环境变量 | 说明 | 默认值 |
|
||||
|---------|------|-------|
|
||||
| `FPB_FLASH_ENABLED` | 是否启用闪烁效果 | `True` |
|
||||
| `FPB_DEFAULT_COLOR` | 默认进度条颜色 | `cyan` |
|
||||
| `FPB_DEFAULT_WIDTH` | 默认进度条宽度 | `50` |
|
||||
|
||||
## 常见问题
|
||||
|
||||
**Q: 闪烁效果不工作?**
|
||||
A: 请检查终端是否支持 ANSI 转义序列,Windows 用户可能需要安装 `colorama` 库。
|
||||
|
||||
**Q: 如何禁用闪烁效果?**
|
||||
A: 在创建进度条时设置 `flash_enabled=False` 或使用环境变量禁用。
|
||||
|
||||
**Q: 支持 Jupyter Notebook 吗?**
|
||||
A: 当前版本主要支持命令行环境,Jupyter Notebook 支持将在后续版本中添加。
|
||||
|
||||
## 更新日志
|
||||
|
||||
### v1.0.0 (2024-01-01)
|
||||
- 初始版本发布
|
||||
- 实现基础进度条功能
|
||||
- 添加爆闪特效
|
||||
|
||||
## 贡献指南
|
||||
|
||||
欢迎对本项目进行贡献!请按照以下步骤参与:
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 创建您的特性分支 (`git checkout -b feature/AmazingFeature`)
|
||||
3. 提交您的更改 (`git commit -m 'Add some AmazingFeature'`)
|
||||
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
||||
5. 创建一个 Pull Request
|
||||
|
||||
## 许可证
|
||||
|
||||
本项目采用 MIT 许可证,详情请参阅 LICENSE 文件。
|
||||
|
||||
## 联系方式
|
||||
|
||||
- 项目地址:https://gitee.com/louxian-yuan/flashing-progress-bar
|
||||
- 作者:louxian-yuan
|
||||
- 问题反馈:https://gitee.com/louxian-yuan/flashing-progress-bar/issues
|
||||
|
||||
## 感谢
|
||||
|
||||
感谢所有为这个项目做出贡献的人!
|
||||
灵感来源于对 INTP 思维模式的抽象表达——看似缓慢加载,实则深度思考;一旦完成,便光芒四射 ✨。
|
||||
|
||||
---
|
||||
|
||||
如果本项目对您有帮助,请给项目一个 ⭐ Star 支持一下!
|
||||
## 🚀 功能亮点
|
||||
|
||||
- **多轮加载**:默认运行 5 轮,每轮 60 步,模拟“阶段性思考”。
|
||||
- **动态鲜艳配色**:每次加载使用随机高饱和 RGB 颜色(红/绿/蓝/黄/品红/青为主),确保高对比度与视觉冲击。
|
||||
- **旋转指示器**:经典 `| / - \` 字符旋转动画,增强加载感。
|
||||
- **完成爆闪效果**:每轮结束时,白色文字 + 粉红背景短暂闪烁,强调“已完成”。
|
||||
- **可配置参数**:轻松调整轮数、步长、速度等(见 `main.py` 中的配置区)。
|
||||
- **终端友好**:基于 `rich.live` 实现无闪烁实时更新,兼容大多数现代终端。
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ 安装依赖
|
||||
|
||||
本项目依赖 `rich` 库。请确保已安装 Python 3.7+。
|
||||
|
||||
```bash
|
||||
pip install rich
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ▶️ 运行方式
|
||||
|
||||
将 `main.py` 下载到本地后,直接运行:
|
||||
|
||||
```bash
|
||||
python main.py
|
||||
```
|
||||
|
||||
程序将在终端中启动动画,结束后按回车退出。
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ 自定义配置
|
||||
|
||||
在 `main.py` 开头的 **配置参数区** 可调整以下选项:
|
||||
|
||||
```python
|
||||
ROUNDS = 5 # 总轮数
|
||||
STEPS = 60 # 每轮步数(即进度条长度)
|
||||
SLEEP_STEP = 0.15 # 每步间隔(秒)
|
||||
SLEEP_FULL = 0.6 # 完成后爆闪停留时间(秒)
|
||||
```
|
||||
|
||||
修改后保存即可生效。
|
||||
|
||||
---
|
||||
|
||||
## 🎨 配色策略说明
|
||||
|
||||
颜色由 `get_vibrant_color()` 函数生成,策略如下:
|
||||
|
||||
| 主色类型 | RGB 构成 |
|
||||
|--------|--------|
|
||||
| 红 | `(255, g, b)`,g/b ∈ [80, 200] |
|
||||
| 绿 | `(r, 255, b)`,r/b ∈ [80, 200] |
|
||||
| 蓝 | `(r, g, 255)`,r/g ∈ [80, 200] |
|
||||
| 黄 | `(255, 255, b)`,b ∈ [0, 100] |
|
||||
| 品红 | `(255, g, 255)`,g ∈ [0, 100] |
|
||||
| 青 | `(r, 255, 255)`,r ∈ [0, 100] |
|
||||
|
||||
确保颜色既鲜艳又不会因过暗而难以辨识。
|
||||
|
||||
---
|
||||
|
||||
## 💡 使用场景
|
||||
|
||||
- 终端工具启动时的“思考中”动画
|
||||
- 演示/教学中的视觉化加载示例
|
||||
- 个人 dotfiles 或 CLI 工具的趣味增强
|
||||
- 向朋友展示你的“INTP 大脑正在编译……”
|
||||
|
||||
---
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
MIT License — 自由使用、修改、分发。
|
||||
|
||||
---
|
||||
|
||||
## ❤️ 致谢
|
||||
|
||||
- [Rich](https://github.com/Textualize/rich):强大的 Python 终端渲染库
|
||||
- 所有热爱命令行美学的开发者
|
||||
|
||||
---
|
||||
|
||||
> “我不是慢,我只是在深度加载。” —— 一位 INTP 用户
|
||||
Binary file not shown.
Reference in New Issue
Block a user