Skip to content

feat: custom cursor#977

Draft
xiaoxustudio wants to merge 5 commits into
OpenWebGAL:devfrom
xiaoxustudio:feat/custom-cursor
Draft

feat: custom cursor#977
xiaoxustudio wants to merge 5 commits into
OpenWebGAL:devfrom
xiaoxustudio:feat/custom-cursor

Conversation

@xiaoxustudio

@xiaoxustudio xiaoxustudio commented Jun 14, 2026

Copy link
Copy Markdown
Member

issue: #975

支持:.ani.curpng,svg等格式文件

Custom_Corsur:<路径>[,类型,x,y];

具体类型在https://developer.mozilla.org/zh-CN/docs/Web/CSS/Reference/Properties/cursor
image

各个属性使用英文逗号分割。同时也同样支持设置多个鼠标状态,使用空格分割即可

注意
当使用ani文件时,xy值将当作宽高处理(即ani文件无法设置热点位置)

预览
屏幕录制 2026-06-14 132456

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for custom cursors via the Custom_Corsur command, introducing the ani-cursor.js dependency to handle .ani files. Feedback on the implementation identifies a path resolution bug where the /game/ prefix is omitted for non-.ani cursors, a potential CSS injection vulnerability due to inserting unescaped values into a <style> element's innerHTML, and missing safety checks for parseInt results. A secure, refactored implementation is suggested to resolve these issues.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/webgal/src/Core/util/coreInitialFunction/infoFetcher.ts
@xiaoxustudio xiaoxustudio marked this pull request as draft June 14, 2026 05:34
@xiaoxustudio

xiaoxustudio commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

目前使用的是ani-cursor.js库,但原库似乎存在很多问题,如类型、不支持设置自定义热点坐标,查看原作者是否还在维护项目,如果没有维护可能会考虑fork原库后单独维护

@xiaoxustudio

Copy link
Copy Markdown
Member Author

目前还有些特性未实现,考虑是否可以实现,如果无法实现,则放弃并保留基础自定义功能

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.

1 participant