Skip to content

Refresh UI#911

Open
MakinoharaShoko wants to merge 7 commits intodevfrom
refresh-ui
Open

Refresh UI#911
MakinoharaShoko wants to merge 7 commits intodevfrom
refresh-ui

Conversation

@MakinoharaShoko
Copy link
Member

将调整:
1、文本框 UI,使其更加通用化,降低存在感
2、标题 UI,去除按钮边框,优化文本显示(通过描边,阴影和微调颜色来提高存在感,但不打扰背景)

此 PR 合并后,将之前的 UI 作为一个模板 WebGAL Classic 内置到 WebGAL Terre,然后将新的模板命名为 WebGAL Refine 2026

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a refreshed UI for the WebGAL project, focusing on improving the text box and title elements. The changes aim to provide a more modern and user-friendly experience. The previous UI is being preserved as a classic template, while the new UI is introduced as a refined version.

Highlights

  • UI Refresh: This PR focuses on refreshing the user interface, specifically the text box and title UI elements, to improve their appearance and usability.
  • Text Box UI: The text box UI has been made more generic and less obtrusive.
  • Title UI: The title UI has been enhanced by removing button borders and optimizing text display through outlining, shadows, and color adjustments.
  • Template Update: The previous UI will be integrated as a 'WebGAL Classic' template in 'WebGAL Terre,' while the new UI will be named 'WebGAL Refine 2026.'
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

这个 PR 旨在刷新 UI,主要调整了文本框和标题的样式,使其更具通用性。大部分改动是样式文件(SCSS)的更新,以及一些游戏脚本中的文本修正(例如拼写错误)。

整体来看,新的 UI 样式代码实现得很好。不过,我发现了一些可以改进的地方,主要涉及代码的可维护性和跨浏览器兼容性。详细建议请参见具体的审查评论。

mask-image:
linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 0, rgba(0, 0, 0, 0.28) 10%, #000 75%),
linear-gradient(to right, rgba(0, 0, 0, 0.08) 0, rgba(0, 0, 0, 0.28) 10%, #000 42%);
mask-composite: intersect;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

mask-composite 属性目前在 Firefox 浏览器中不被原生支持,这可能会导致在 Firefox 中背景的渲染效果与预期不符。

根据 MDN 文档,此属性需要用户手动开启实验性功能标志位才能在 Firefox 中使用,对于普通用户来说默认是关闭的。

为了保证跨浏览器体验的一致性,建议:

  1. 寻找一种不使用 mask-composite 的替代实现方式。
  2. 或者为 Firefox 提供一个优雅降级的样式(fallback)。

参考: MDN Web Docs for mask-composite

font-weight: bold;
color: white;
padding: 1em 50px 70px 200px;
padding: calc(1em + #{$topReserve}) 50px 70px 490px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

padding 属性中的左边距 490px 是一个硬编码的“魔术数字”。这个值同样在第 159 行的 .TextBox_showNameleft 属性中重复使用。

为了提高代码的可维护性,建议将这个值提取为一个 SCSS 变量。例如,在文件的顶部定义一个变量,然后在所有使用到该值的地方引用这个变量。

// 建议
$textBoxLeftOffset: 490px;

.TextBox_main {
  // ...
  padding: calc(1em + #{$topReserve}) 50px 70px $textBoxLeftOffset;
  // ...
}

.TextBox_showName {
  // ...
  left: $textBoxLeftOffset;
  // ...
}

这样当需要调整布局时,只需修改一处即可。

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 22, 2026

Deploying webgal-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8133b08
Status: ✅  Deploy successful!
Preview URL: https://ed5f4c91.webgal-dev.pages.dev
Branch Preview URL: https://refresh-ui.webgal-dev.pages.dev

View logs

@MakinoharaShoko
Copy link
Member Author

请对修改后的 UI 提议,谢谢!

@MakinoharaShoko
Copy link
Member Author

对于默认 UI 的情况,我可能考虑在配置文件里面弄几个配色方案,然后可以在编辑器里面选。编辑器的这个选项只在检测到用默认refine模板后显示。

@MakinoharaShoko
Copy link
Member Author

Image_1774203369103_642

Image_1774203350678_316

人物名称那里可以加点修饰,不要太突兀即可。control panel的布局也可以再考虑一下

Comment on lines +33 to +41
const renderButtonText = (text: string) => (
<div className={applyStyle('Title_button_text', styles.Title_button_text)}>
<span className={applyStyle('Title_button_text_placeholder', '')}>
{text}
<span className={applyStyle('Title_button_text_outer', '')}>{text}</span>
<span className={applyStyle('Title_button_text_inner', '')}>{text}</span>
</span>
</div>
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么 applyStyle 没有指定 fallbackStyle

left: 0;
top: 0;
-webkit-text-stroke: 0.09em rgba(12, 20, 32, 0.7);
z-index: 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

出于模板的兼容性考虑,我感觉需要做如下改动

  • 不应该改 .Title_button_text ,而应该尽可能在新的类中覆盖属性
  • .Title_button_text_outer 应该只留一个 display: none; ,防止用户的模板多了一个描边,只把更改留到 public/game/template 即可
  • .Title_button_text_inner 缺了一个 color 属性,现在正常是因为漏了在 Title.tsx 写回退,所有继承到了 .Title_button_text ,但是实际上它容易继承 .Title_button_text_placeholder 里的 color: transparent;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我不太建议直接动任何 module.scss,它们是底样式,永远存在于样式表里,很容易影响用户的模板,应该只把更改限制在 public/game/template 中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants