| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- /* XJS library styles
- * This file centralizes all runtime UI CSS used by the library.
- * Currently includes: Layer popup (layer-*)
- */
- /* =========================
- Layer (layer-*)
- ========================= */
- .layer-overlay {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: rgba(0, 0, 0, 0.4);
- display: flex;
- justify-content: center;
- align-items: center;
- z-index: 1000;
- opacity: 0;
- transition: opacity 0.3s;
- }
- .layer-overlay.show {
- opacity: 1;
- }
- .layer-popup {
- background: #fff;
- border-radius: 8px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
- width: 32em;
- max-width: 90%;
- padding: 1.5em;
- display: flex;
- flex-direction: column;
- align-items: center;
- position: relative;
- z-index: 1;
- transform: scale(0.92);
- transition: transform 0.26s ease;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
- }
- .layer-overlay.show .layer-popup {
- transform: scale(1);
- }
- .layer-title {
- font-size: 1.8em;
- font-weight: 600;
- color: #333;
- margin: 0 0 0.5em;
- text-align: center;
- }
- .layer-content {
- font-size: 1.125em;
- color: #545454;
- margin-bottom: 1.5em;
- text-align: center;
- line-height: 1.5;
- }
- .layer-actions {
- display: flex;
- justify-content: center;
- gap: 1em;
- width: 100%;
- }
- .layer-button {
- border: none;
- border-radius: 4px;
- padding: 0.6em 1.2em;
- font-size: 1em;
- cursor: pointer;
- transition: background-color 0.2s, box-shadow 0.2s;
- color: #fff;
- }
- .layer-confirm {
- background-color: #3085d6;
- }
- .layer-confirm:hover {
- background-color: #2b77c0;
- }
- .layer-cancel {
- background-color: #aaa;
- }
- .layer-cancel:hover {
- background-color: #999;
- }
- .layer-icon {
- position: relative;
- box-sizing: content-box;
- width: 5em;
- height: 5em;
- margin: 0.5em auto 1.8em;
- border: 0.25em solid rgba(0, 0, 0, 0);
- border-radius: 50%;
- font-family: inherit;
- line-height: 5em;
- cursor: default;
- user-select: none;
- /* Ring sweep angles (match SweetAlert2 success feel) */
- --layer-ring-start-rotate: -45deg;
- /* End is one full turn from start so it "sweeps then settles" */
- --layer-ring-end-rotate: -405deg;
- }
- /* SVG mark content (kept), sits above the ring */
- .layer-icon svg {
- width: 100%;
- height: 100%;
- display: block;
- overflow: visible;
- position: relative;
- z-index: 3;
- }
- .layer-svg-ring,
- .layer-svg-mark {
- fill: none;
- stroke-linecap: round;
- stroke-linejoin: round;
- }
- .layer-svg-ring {
- stroke-width: 4.5;
- opacity: 0.95;
- }
- .layer-svg-mark {
- stroke-width: 6;
- }
- .layer-svg-dot {
- transform-box: fill-box;
- transform-origin: center;
- }
- /* =========================================
- "success-like" ring (shared by all icons)
- - we reuse the success ring pieces/rotation for every icon type
- - color is driven by currentColor
- ========================================= */
- .layer-icon.success { border-color: #a5dc86; color: #a5dc86; }
- .layer-icon.error { border-color: #f27474; color: #f27474; }
- .layer-icon.warning { border-color: #f8bb86; color: #f8bb86; }
- .layer-icon.info { border-color: #3fc3ee; color: #3fc3ee; }
- .layer-icon.question { border-color: #b18cff; color: #b18cff; }
- /* Keep ring sweep logic identical across built-in icons (match success). */
- .layer-icon .layer-success-ring {
- position: absolute;
- z-index: 2;
- top: -0.25em;
- left: -0.25em;
- box-sizing: content-box;
- width: 100%;
- height: 100%;
- border: 0.25em solid currentColor;
- opacity: 0.3;
- border-radius: 50%;
- }
- .layer-icon .layer-success-fix {
- position: absolute;
- z-index: 1;
- top: 0.5em;
- left: 1.625em;
- width: 0.4375em;
- height: 5.625em;
- transform: rotate(-45deg);
- background-color: #fff; /* adjusted at runtime to popup bg */
- }
- .layer-icon .layer-success-circular-line-left,
- .layer-icon .layer-success-circular-line-right {
- position: absolute;
- width: 3.75em;
- height: 7.5em;
- border-radius: 50%;
- background-color: #fff; /* adjusted at runtime to popup bg */
- }
- .layer-icon .layer-success-circular-line-left {
- top: -0.4375em;
- left: -2.0635em;
- transform: rotate(-45deg);
- transform-origin: 3.75em 3.75em;
- border-radius: 7.5em 0 0 7.5em;
- }
- .layer-icon .layer-success-circular-line-right {
- top: -0.6875em;
- left: 1.875em;
- transform: rotate(-45deg);
- transform-origin: 0 3.75em;
- border-radius: 0 7.5em 7.5em 0;
- }
- /* Clip ONLY the success tick (do not clip the ring sweep masks) */
- .layer-icon .layer-success-mark {
- position: absolute;
- inset: 0;
- border-radius: 50%;
- overflow: hidden;
- z-index: 3;
- pointer-events: none;
- }
- .layer-icon .layer-success-line-tip,
- .layer-icon .layer-success-line-long {
- display: block;
- position: absolute;
- z-index: 2;
- height: 0.3125em;
- border-radius: 0.125em;
- background-color: currentColor;
- }
- .layer-icon .layer-success-line-tip {
- top: 2.875em;
- left: 0.8125em;
- width: 1.5625em;
- transform: rotate(45deg);
- }
- .layer-icon .layer-success-line-long {
- top: 2.375em;
- right: 0.5em;
- width: 2.9375em;
- transform: rotate(-45deg);
- }
- /* Triggered when icon has .layer-icon-show */
- .layer-icon.layer-icon-show .layer-success-line-tip {
- animation: layer-animate-success-line-tip 0.75s;
- }
- .layer-icon.layer-icon-show .layer-success-line-long {
- animation: layer-animate-success-line-long 0.75s;
- }
- .layer-icon.layer-icon-show .layer-success-circular-line-right {
- animation: layer-rotate-icon-circular-line 4.25s ease-in;
- }
- @keyframes layer-animate-success-line-tip {
- 0% {
- top: 1.1875em;
- left: 0.0625em;
- width: 0;
- }
- 54% {
- top: 1.0625em;
- left: 0.125em;
- width: 0;
- }
- 70% {
- top: 2.1875em;
- left: -0.375em;
- width: 3.125em;
- }
- 84% {
- top: 3em;
- left: 1.3125em;
- width: 1.0625em;
- }
- 100% {
- top: 2.8125em;
- left: 0.8125em;
- width: 1.5625em;
- }
- }
- @keyframes layer-animate-success-line-long {
- 0% {
- top: 3.375em;
- right: 2.875em;
- width: 0;
- }
- 65% {
- top: 3.375em;
- right: 2.875em;
- width: 0;
- }
- 84% {
- top: 2.1875em;
- right: 0;
- width: 3.4375em;
- }
- 100% {
- top: 2.375em;
- right: 0.5em;
- width: 2.9375em;
- }
- }
- @keyframes layer-rotate-icon-circular-line {
- 0% { transform: rotate(var(--layer-ring-start-rotate)); }
- 5% { transform: rotate(var(--layer-ring-start-rotate)); }
- 12% { transform: rotate(var(--layer-ring-end-rotate)); }
- 100% { transform: rotate(var(--layer-ring-end-rotate)); } /* match 12% so it "sweeps then stops" */
- }
- /* (Other icon shapes stay SVG-driven; only the ring animation is unified above) */
|