feat: 全面迁移到 Flutter + 新增 GitHub 源与 CI 流水线
前端
- 移除全部 Avalonia 依赖,模型渲染与界面统一改用 Flutter
- 新增用户页:登录/注册(SHA-512 + 盐)、签到积分(30 天一循环)、
主题色积分购买、二选一随机、今日人品
- 新增百宝箱页、模型内嵌渲染页、自绘标题栏(最小化/最大化/关闭)
- 下载页显示模型下载进度条,下载源读取加速
- 关于页新增「重新下载启动器」并在下载后做 sha256 完整性校验
- 修复浅色主题下标题栏不跟随主题色、无法连接后端等问题
后端
- 新增 UserService:.GC/user/<用户名>.yaml 存用户名/积分/SHA-512 口令,
登录返回 session token,本地 .GC/user/user.yaml 保存登录态
- 新增 /api/user/{register,login,me,signin,theme} 接口
- 去掉 Avalonia 窗口宿主,后端只提供 HTTP API
下载源
- 新增 GitHub 镜像源(Morris-morris-cloud/GC),与 Xhmcl 并发测速
- 单源探测超时收紧到 2 秒,取最快且可用的源;GitHub 复用 GiteaRemote
(contents 带 ref、releases 带 per_page=100)
构建与 CI
- macOS 上默认只出 macOS 包,Windows 交给原生 Windows 构建
- 修复 Windows 交叉编译中 flutter-cpp-client-wrapper 双层目录嵌套
- 新增 GitHub Actions:
· nightly-prerelease:每天 21:00 编译三平台,发布 nightly 预发布
· build-bot:Issue/PR 评论 @build-bot build <mac|win-amd|win-arm|all>,
发布 ip-prerelease 预发布
· pr-review:检查能否编译、静态分析、合并冲突、是否落后 main
- 忽略 79MB 课件产物等高线.html 与工具链临时备份
This commit is contained in:
1 parent
b9cb56cb8b
commit
ea1fa6b6d1
134 files changed
+4309
-16614
No files matched your search
@@ -1,141 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace GC.ScaleCalculator;
|
||||
|
||||
/// <summary>
|
||||
/// 比例尺计算器主界面。三栏(已知量 / 可视化标尺 / 三种写法与判读)+ 底部实地尺与练习。
|
||||
/// 全部用显式画刷(与启动器 AppTheme 同色),不依赖 DynamicResource —— 模型 dll 在
|
||||
/// 独立 ALC 里加载,headless 生成封面时也没有 Application 样式。
|
||||
/// </summary>
|
||||
public sealed partial class ScaleCalculatorView : UserControl
|
||||
{
|
||||
// 调色(与 GC/src/Styles/AppTheme.axaml 一致)
|
||||
internal static readonly Color CAppBg = Color.Parse("#F4F6FB");
|
||||
internal static readonly Color CSurface = Color.Parse("#FFFFFF");
|
||||
internal static readonly Color CSurfaceAlt = Color.Parse("#F7F9FE");
|
||||
internal static readonly Color CLine = Color.Parse("#E3E8F3");
|
||||
internal static readonly Color CLineStrong = Color.Parse("#D2DAEA");
|
||||
internal static readonly Color CInk = Color.Parse("#111A2E");
|
||||
internal static readonly Color CInkDim = Color.Parse("#5B6A86");
|
||||
internal static readonly Color CInkFaint = Color.Parse("#8A97B1");
|
||||
internal static readonly Color CAccent = Color.Parse("#2F6BFF");
|
||||
internal static readonly Color CAccentDark = Color.Parse("#1F4FD0");
|
||||
internal static readonly Color CAccentSoft = Color.Parse("#EAF1FF");
|
||||
internal static readonly Color CSuccess = Color.Parse("#1F9D6B");
|
||||
internal static readonly Color CDanger = Color.Parse("#D64545");
|
||||
internal static readonly Color CWarn = Color.Parse("#D98613");
|
||||
internal static readonly Color CHero = Color.Parse("#12203C");
|
||||
|
||||
internal static SolidColorBrush B(Color c) => new(c);
|
||||
internal static SolidColorBrush Brush(string hex) => new(Color.Parse(hex));
|
||||
|
||||
private readonly ScaleData _data;
|
||||
private readonly Dictionary<string, string> _texts;
|
||||
private readonly string _language;
|
||||
private readonly Random _rnd = new();
|
||||
|
||||
public string T(string key)
|
||||
=> _texts.TryGetValue(key, out var v) ? v
|
||||
: DefaultTexts.Zh.TryGetValue(key, out var f) ? f : key;
|
||||
|
||||
public string TF(string key, params object[] args)
|
||||
=> string.Format(CultureInfo.InvariantCulture, T(key), args);
|
||||
|
||||
public ScaleCalculatorView(ScaleData data, Dictionary<string, string> texts, string language)
|
||||
{
|
||||
_data = data;
|
||||
_texts = texts;
|
||||
_language = language;
|
||||
|
||||
BuildLayout();
|
||||
WireEvents();
|
||||
SetMode(SolveMode.Real, initial: true);
|
||||
NewQuiz();
|
||||
RefreshAll(syncInputs: true);
|
||||
}
|
||||
|
||||
// ────────────────────────────────────────────────────────── 小工具
|
||||
|
||||
internal static Border Card(Control content, double radius = 14)
|
||||
=> new()
|
||||
{
|
||||
Background = B(CSurface),
|
||||
BorderBrush = B(CLine),
|
||||
BorderThickness = new Thickness(1),
|
||||
CornerRadius = new CornerRadius(radius),
|
||||
Padding = new Thickness(14),
|
||||
Child = content
|
||||
};
|
||||
|
||||
internal static TextBlock Tb(string text, double size, Color color, FontWeight? weight = null,
|
||||
TextAlignment align = TextAlignment.Left)
|
||||
=> new()
|
||||
{
|
||||
Text = text,
|
||||
FontSize = size,
|
||||
Foreground = B(color),
|
||||
FontWeight = weight ?? FontWeight.Normal,
|
||||
TextAlignment = align,
|
||||
TextWrapping = TextWrapping.Wrap
|
||||
};
|
||||
|
||||
internal static TextBlock Label(string text, double size = 12, Color? color = null)
|
||||
=> Tb(text, size, color ?? CInkDim);
|
||||
|
||||
internal static TextBlock H3(string text) => Tb(text, 13.5, CInk, FontWeight.SemiBold);
|
||||
|
||||
internal static Border Chip(string text, Color bg, Color fg, double radius = 8)
|
||||
=> new()
|
||||
{
|
||||
Background = B(bg),
|
||||
CornerRadius = new CornerRadius(radius),
|
||||
Padding = new Thickness(10, 4),
|
||||
Child = Tb(text, 11, fg, FontWeight.SemiBold)
|
||||
};
|
||||
|
||||
internal static Button Btn(string text, bool primary = false)
|
||||
=> new()
|
||||
{
|
||||
Content = Tb(text, 12.5, primary ? Colors.White : CInk, FontWeight.SemiBold),
|
||||
Background = B(primary ? CAccent : CSurface),
|
||||
BorderBrush = B(primary ? CAccent : CLineStrong),
|
||||
BorderThickness = new Thickness(primary ? 0 : 1),
|
||||
CornerRadius = new CornerRadius(9),
|
||||
Padding = new Thickness(12, 7),
|
||||
HorizontalContentAlignment = HorizontalAlignment.Center,
|
||||
VerticalContentAlignment = VerticalAlignment.Center,
|
||||
Cursor = new Cursor(StandardCursorType.Hand)
|
||||
};
|
||||
|
||||
internal static TextBox Input(string text = "")
|
||||
=> new()
|
||||
{
|
||||
Text = text,
|
||||
FontSize = 12.5,
|
||||
Background = B(CSurface),
|
||||
Foreground = B(CInk),
|
||||
BorderBrush = B(CLineStrong),
|
||||
BorderThickness = new Thickness(1),
|
||||
CornerRadius = new CornerRadius(9),
|
||||
Padding = new Thickness(10, 7),
|
||||
VerticalContentAlignment = VerticalAlignment.Center,
|
||||
MinHeight = 34
|
||||
};
|
||||
|
||||
internal static Border Divider(double h = 1)
|
||||
=> new() { Background = B(CLine), Height = h, Margin = new Thickness(0, 10, 0, 10) };
|
||||
|
||||
internal static StackPanel V(double spacing = 8)
|
||||
=> new() { Orientation = Orientation.Vertical, Spacing = spacing };
|
||||
|
||||
internal static StackPanel H(double spacing = 8)
|
||||
=> new() { Orientation = Orientation.Horizontal, Spacing = spacing, VerticalAlignment = VerticalAlignment.Center };
|
||||
}
|
||||
Reference in new issue
Block a user