list.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Layer - List</title>
  7. <link rel="stylesheet" href="../list.css">
  8. <style>
  9. .card { min-height: 120px; padding: 18px 18px 16px 18px; }
  10. .card-preview {
  11. height: 62px;
  12. border-radius: 10px;
  13. background: rgba(255,255,255,0.02);
  14. border: 1px solid rgba(255,255,255,0.04);
  15. position: relative;
  16. overflow: hidden;
  17. display: flex;
  18. align-items: center;
  19. justify-content: center;
  20. margin-bottom: 14px;
  21. }
  22. .preview-icons {
  23. display: flex;
  24. gap: 10px;
  25. align-items: center;
  26. justify-content: center;
  27. opacity: 0.9;
  28. }
  29. .mini {
  30. width: 22px;
  31. height: 22px;
  32. border-radius: 999px;
  33. border: 2px solid currentColor;
  34. display: grid;
  35. place-items: center;
  36. color: #aaa;
  37. }
  38. .mini.success { color: #a5dc86; }
  39. .mini.error { color: #f27474; }
  40. .mini.warning { color: #f8bb86; }
  41. .mini.info { color: #3fc3ee; }
  42. .mini svg { width: 14px; height: 14px; display: block; }
  43. .preview-pill {
  44. font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  45. color: #9a9a9a;
  46. background: rgba(255,255,255,0.04);
  47. border: 1px solid rgba(255,255,255,0.06);
  48. padding: 10px 14px;
  49. border-radius: 10px;
  50. font-size: 13px;
  51. letter-spacing: 0.2px;
  52. }
  53. </style>
  54. </head>
  55. <body>
  56. <div class="search-header">
  57. <div class="search-title">Layer</div>
  58. <div class="search-input-container">
  59. <div class="search-icon"></div>
  60. <input type="text" class="search-input" placeholder="Filter layer tests..." disabled>
  61. </div>
  62. </div>
  63. <div class="grid-section">
  64. <div class="header-card active" onclick="selectItem('overview.html', this)">
  65. <div class="header-dots"></div>
  66. <div class="header-title">Layer</div>
  67. </div>
  68. <div class="card-grid" style="margin-top: 40px;">
  69. <div class="card" data-content="layer/test_icons_svg_animation.html" onclick="selectItem('test_icons_svg_animation.html', this)">
  70. <div class="card-preview">
  71. <div class="preview-icons" aria-hidden="true">
  72. <div class="mini success">
  73. <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round">
  74. <path d="M20 6L9 17l-5-5"></path>
  75. </svg>
  76. </div>
  77. <div class="mini error">
  78. <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round">
  79. <path d="M6 6l12 12"></path>
  80. <path d="M18 6L6 18"></path>
  81. </svg>
  82. </div>
  83. <div class="mini warning">
  84. <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round">
  85. <path d="M12 3v12"></path>
  86. <path d="M12 19h.01"></path>
  87. </svg>
  88. </div>
  89. <div class="mini info">
  90. <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round">
  91. <path d="M12 10v8"></path>
  92. <path d="M12 6h.01"></path>
  93. </svg>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="card-footer">SVG Icon animation (SweetAlert-like)</div>
  98. </div>
  99. <div class="card" data-content="layer/test_confirm_flow.html" onclick="selectItem('test_confirm_flow.html', this)">
  100. <div class="card-preview">
  101. <div class="preview-pill">xjs.layer(...).then(res =&gt; ...)</div>
  102. </div>
  103. <div class="card-footer">Confirm flow (success / error)</div>
  104. </div>
  105. <div class="card" data-content="layer/test_selection_layer_dataset.html" onclick="selectItem('test_selection_layer_dataset.html', this)">
  106. <div class="card-preview">
  107. <div class="preview-pill">xjs('.btn').layer() + data-layer-*</div>
  108. </div>
  109. <div class="card-footer">Selection.layer() + dataset</div>
  110. </div>
  111. <div class="card" data-content="layer/test_static_fire.html" onclick="selectItem('test_static_fire.html', this)">
  112. <div class="card-preview">
  113. <div class="preview-pill">Layer.fire(...) / Layer.$(...).fire()</div>
  114. </div>
  115. <div class="card-footer">Static API / Builder API</div>
  116. </div>
  117. </div>
  118. </div>
  119. <script>
  120. function selectItem(url, el) {
  121. document.querySelectorAll('.card').forEach(c => c.classList.remove('active'));
  122. document.querySelectorAll('.header-card').forEach(c => c.classList.remove('active'));
  123. el.classList.add('active');
  124. if (window.parent && window.parent.loadContent) {
  125. window.parent.loadContent('layer/' + url);
  126. }
  127. }
  128. function setActiveByContentUrl(contentUrl) {
  129. const normalized = String(contentUrl || '').replace(/^\.\//, '');
  130. const header = document.querySelector('.header-card');
  131. const cards = Array.from(document.querySelectorAll('.card[data-content]'));
  132. document.querySelectorAll('.card').forEach(c => c.classList.remove('active'));
  133. document.querySelectorAll('.header-card').forEach(c => c.classList.remove('active'));
  134. if (!normalized) return;
  135. if (normalized.includes('layer/overview.html')) {
  136. header?.classList.add('active');
  137. return;
  138. }
  139. header?.classList.add('active');
  140. const match = cards.find(c => normalized.endsWith(c.dataset.content) || normalized.includes(c.dataset.content));
  141. if (match) match.classList.add('active');
  142. }
  143. window.setActiveByContentUrl = setActiveByContentUrl;
  144. </script>
  145. </body>
  146. </html>