MCPcopy Index your code
hub / github.com/Bistutu/FluentRead / insertLoadingSpinner

Function insertLoadingSpinner

entrypoints/utils/icon.ts:112–131  ·  view source on GitHub ↗
(
  node: HTMLElement,
  isCache: boolean = false
)

Source from the content-addressed store, hash-verified

110
111// 插入加载动画
112export function insertLoadingSpinner(
113 node: HTMLElement,
114 isCache: boolean = false
115): HTMLElement {
116 const spinner = document.createElement("span");
117 spinner.className = "fluent-read-loading";
118 if (isCache) spinner.style.borderTop = "3px solid green"; // 存在缓存时改为绿色
119
120 // 异步检查动画配置
121 import('@/entrypoints/utils/config').then(({ config }) => {
122 if (!config.animations && !spinner.classList.contains('static')) {
123 spinner.classList.add('static');
124 }
125 }).catch(() => {
126 // 忽略错误,使用默认动画
127 });
128
129 node.appendChild(spinner);
130 return spinner;
131}

Callers 4

handleSingleTranslationFunction · 0.90
bilingualTranslateFunction · 0.90
singleTranslateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected