mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
Add spinner to py-editor run buttons (#2078)
* Add spinner to disabled py-editor run buttons * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * css nit suggested by WebReflection --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,5 +1,15 @@
|
|||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
|
## 2024.05.21
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
### Enhancements
|
||||||
|
|
||||||
|
- `py-editor` run buttons now display a spinner when disabled, which occurs when the editor is running code.
|
||||||
|
|
||||||
## 2023.05.01
|
## 2023.05.01
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -42,3 +42,34 @@ mpy-config {
|
|||||||
.mpy-editor-run-button:disabled {
|
.mpy-editor-run-button:disabled {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes spinner {
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.py-editor-run-button:disabled > *,
|
||||||
|
.mpy-editor-run-button:disabled > * {
|
||||||
|
display: none; /* hide all the child elements of the run button when it is disabled */
|
||||||
|
}
|
||||||
|
.py-editor-run-button:disabled,
|
||||||
|
.mpy-editor-run-button:disabled {
|
||||||
|
border-width: 0;
|
||||||
|
}
|
||||||
|
.py-editor-run-button:disabled::before,
|
||||||
|
.mpy-editor-run-button:disabled::before {
|
||||||
|
content: "";
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 100%;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin-top: -23px; /* hardcoded value to center the spinner on the run button */
|
||||||
|
margin-left: -26px; /* hardcoded value to center the spinner on the run button */
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 2px solid #aaa;
|
||||||
|
border-top-color: #000;
|
||||||
|
background-color: #fff;
|
||||||
|
animation: spinner 0.6s linear infinite;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user