diff --git a/packages/playground/website/public/php-playground.html b/packages/playground/website/public/php-playground.html index e8918d3ce1..ef1aa12901 100644 --- a/packages/playground/website/public/php-playground.html +++ b/packages/playground/website/public/php-playground.html @@ -32,17 +32,17 @@ } .controls { - padding: 8px 12px; + padding: 12px 16px; background: #f5f5f5; border-bottom: 1px solid #ddd; display: flex; - align-items: center; - justify-content: space-between; - gap: 8px; - &, - * { - font-size: 16px; - } + flex-direction: column; + gap: 12px; + font-size: 16px; + } + + .controls * { + font-size: inherit; } .controls h1 { @@ -52,13 +52,28 @@ color: #333; } - .controls-right { + .controls-main { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + flex-wrap: wrap; + } + + .controls-actions { display: flex; align-items: center; gap: 8px; + flex-wrap: wrap; } - .controls-right button { + .control-group { + display: flex; + align-items: center; + gap: 6px; + } + + .controls-actions button { padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; @@ -67,11 +82,11 @@ transition: background-color 0.2s; } - .controls-right button:hover { + .controls-actions button:hover { background: #f0f0f0; } - .controls-right select { + .controls-actions select { padding: 6px 8px; border: 1px solid #ccc; border-radius: 4px; @@ -89,6 +104,100 @@ text-decoration: underline; } + .controls-secondary { + display: flex; + flex-direction: column; + gap: 10px; + } + + .toggle-group { + display: flex; + align-items: center; + gap: 16px; + flex-wrap: wrap; + } + + .toggle { + display: inline-flex; + align-items: center; + gap: 6px; + cursor: pointer; + font-size: 15px; + } + + .toggle input[type='checkbox'] { + width: 18px; + height: 18px; + accent-color: #0073aa; + } + + .toggle input[type='checkbox']:focus-visible { + outline: 2px solid #0073aa; + outline-offset: 2px; + } + + #multiVersionPanel { + display: flex; + align-items: center; + gap: 12px; + flex-wrap: wrap; + border: 1px solid #ddd; + background: white; + padding: 8px 12px; + border-radius: 6px; + } + + #multiVersionPanel[hidden] { + display: none; + } + + .multi-version-label { + font-weight: 600; + color: #333; + } + + .multi-version-list { + display: flex; + flex-wrap: wrap; + gap: 8px; + } + + .multi-version-option { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 4px 10px; + border: 1px solid #ccc; + border-radius: 20px; + background: #fff; + cursor: pointer; + transition: border-color 0.2s, background-color 0.2s; + } + + .multi-version-option input[type='checkbox'] { + margin: 0; + width: 16px; + height: 16px; + } + + .multi-version-option input[type='checkbox']:focus-visible { + outline: 2px solid #0073aa; + outline-offset: 2px; + } + + .multi-version-option:hover { + border-color: #0073aa; + background: #f0f8ff; + } + + .multi-version-option span { + font-weight: 500; + } + + #singlePhpControls[hidden] { + display: none; + } + #editor { flex: 1; font-size: 14px; @@ -155,6 +264,50 @@ border: 0; } + #preview[hidden] { + display: none; + } + + #multiPreview { + position: absolute; + inset: 0; + padding: 12px; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 12px; + overflow: auto; + background: #fff; + } + + #multiPreview[hidden] { + display: none; + } + + .preview-card { + display: flex; + flex-direction: column; + border: 1px solid #ddd; + border-radius: 6px; + background: #fff; + overflow: hidden; + min-height: 200px; + } + + .preview-card-header { + padding: 8px 12px; + border-bottom: 1px solid #eee; + font-weight: 600; + color: #333; + background: #fafafa; + } + + .preview-card iframe { + flex: 1; + border: 0; + width: 100%; + background: white; + } + /* Modal styles */ .modal { display: none; @@ -270,13 +423,17 @@ .controls h1 { font-size: 16px; } - .controls-right { + .controls-actions { gap: 6px; } - .controls-right label, - .controls-right select, - .controls-right button, - .controls-right a { + .controls-actions label, + .controls-actions select, + .controls-actions button, + .controls-actions a, + .toggle { + font-size: 14px; + } + .multi-version-option { font-size: 14px; } #previewPane { @@ -297,24 +454,46 @@ text-align: center; margin-bottom: 4px; } - .controls-right { + .controls-main { + flex-direction: column; + align-items: stretch; + gap: 8px; + } + .controls-actions { justify-content: center; flex-wrap: wrap; gap: 8px; } - .controls-right button { + .controls-actions button { padding: 8px 12px; min-height: 44px; /* Touch-friendly */ } - .controls-right select { + .controls-actions select { min-height: 44px; /* Touch-friendly */ } + .controls-secondary { + gap: 8px; + } + .toggle-group { + justify-content: center; + } + #multiVersionPanel { + flex-direction: column; + align-items: stretch; + } + .multi-version-list { + justify-content: center; + } #previewPane { height: 35vh; } #editor .cm-editor { font-size: 13px; } + #multiPreview { + padding: 8px; + grid-template-columns: 1fr; + } } /* Small mobile adjustments */ @@ -325,11 +504,8 @@ .controls h1 { font-size: 13px; } - .controls-right { - font-size: 13px; - } - .controls-right button, - .controls-right select { + .controls-actions button, + .controls-actions select { min-height: 40px; font-size: 13px; } @@ -343,6 +519,16 @@ font-size: 12px; line-height: 1.3; } + .toggle-group { + gap: 10px; + } + .multi-version-option { + padding: 4px 8px; + font-size: 13px; + } + #multiPreview { + padding: 6px; + } } /* Modal responsive styles */ @@ -376,14 +562,21 @@ /* Very small screens */ @media (max-width: 360px) { - .controls-right { + .controls-actions { flex-direction: column; - align-items: center; + align-items: stretch; } - .controls-right button, - .controls-right select { + .controls-actions button, + .controls-actions select { width: 100%; - max-width: 200px; + max-width: 220px; + } + .toggle-group { + flex-direction: column; + align-items: stretch; + } + .multi-version-list { + justify-content: center; } } @@ -402,9 +595,12 @@ .controls h1 { font-size: 12px; } - .controls-right { + .controls-actions { gap: 4px; } + .toggle-group { + gap: 8px; + } } @@ -412,31 +608,63 @@
-

WordPress PHP Playground

-
- - - - - - How does this work? +
+

WordPress PHP Playground

+
+
+ + +
+
+ + +
+ + How does this work? +
+
+
+
+ + +
+
+
@@ -517,114 +745,110 @@

💡 Tips