diff --git a/content.js b/content.js index 076e46b..fd1b362 100644 --- a/content.js +++ b/content.js @@ -337,10 +337,54 @@ function removeJupyterOutput(str) { return str; } -// 开始等待动画,有30s等待时间,如果等待时间过了,出现“error”字体,返回两个值如下,接收:"const [animationInterval, animationElement] = startWaitingAnimation(activeCall)" -// 1. animationInterval(interval, 动画计时器),可使用clearInterval(animationInterval)消除动画, 每次请求完毕必须要关掉 -// 2. animationElement (dom, 动画字体节点), animationElement.innerHTML = xxx 来赋值 +// left animation css +const loadCss = ` + .before-content:before { + content: ""; + position: absolute; + top: 5px; + left: 10px; + right: 0; + bottom: 0; + border: 3px solid rgba(0, 0, 0, 0.1); + border-left-color: #000; + border-radius: 50%; + width: 15px; + height: 15px; + animation: spin 1s linear infinite; + } + + @keyframes spin { + to { + transform: rotate(360deg); + } + } + .paused:before { + content: ""; + position: absolute; + top: 5px; + left: 10px; + right: 0; + bottom: 0; + border: 3px solid rgba(0, 0, 0, 0.1); + border-radius: 50%; + width: 15px; + height: 15px; + // animation: spin 1s linear infinite; + border-left-color: red; + } +`; + +// start request animation, The maximum animation duration is 30s const startWaitingAnimation = (activeCell) => { + const inputElement = activeCell.parentElement.parentElement.parentElement; + + // Create a new