ShtukbaseStandard
包页面→ /design/shtukbase-ui-html/components/shell/layout-canvas/layout-canvas.html

pages/design/shtukbase-ui-html/components/shell/layout-canvas/layout-canvas.html

22 行, 5.2 KB. 直接打开 (在项目中它旁边还有其他文件,这里可能缺失).

文件按包中的原样显示:代码及其注释不做翻译。

  1. <!---
  2. id: layout-canvas
  3. title: Canvas layout
  4. level: shell
  5. description: A page form - a surface with a faint dot grid that pans, zooms and fits; the zoom controls float in the corner, a minimap is optional. Any lens can be a canvas.
  6. uses: []
  7. parts: [layout-canvas-viewport, layout-canvas-stage, layout-canvas-controls, layout-canvas-zoom, layout-canvas-minimap]
  8. states: [default, minimap]
  9. status: [loading]
  10. controls:
  11. grid: {kind: segment, label: Grid, options: [dots, lines, none], default: dots}
  12. cssProperties: [--layout-canvas-zoom]
  13. --->
  14. <template data-state="default">
  15. <div data-slot="layout-canvas" class="layout-canvas" style="height: 320px"><div data-slot="layout-canvas-viewport" class="layout-canvas-viewport"><div data-slot="layout-canvas-stage" class="layout-canvas-stage" style="transform: scale(0.9)"><div class="layout-demo-tile" style="position: absolute; left: 40px; top: 40px"><b>Core</b><span>Pages and packages</span></div><div class="layout-demo-tile" style="position: absolute; left: 320px; top: 120px"><b>Lenses</b><span>HTML lenses</span></div></div></div><div data-slot="layout-canvas-controls" class="layout-canvas-controls"><button type="button" aria-label="Zoom out"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button><button type="button" data-slot="layout-canvas-zoom" class="layout-canvas-zoom" title="Back to 100%">90%</button><button type="button" aria-label="Zoom in"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button><span class="layout-canvas-sep"></span><button type="button" aria-label="Fit everything"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4"/></svg></button></div></div>
  16. </template>
  17. <template data-state="minimap">
  18. <div data-slot="layout-canvas" class="layout-canvas" style="height: 320px"><div data-slot="layout-canvas-viewport" class="layout-canvas-viewport"><div data-slot="layout-canvas-stage" class="layout-canvas-stage" style="transform: scale(0.9)"><div class="layout-demo-tile" style="position: absolute; left: 40px; top: 40px"><b>Core</b><span>Pages and packages</span></div><div class="layout-demo-tile" style="position: absolute; left: 320px; top: 120px"><b>Lenses</b><span>HTML lenses</span></div></div></div><div data-slot="layout-canvas-controls" class="layout-canvas-controls"><button type="button" aria-label="Zoom out"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button><button type="button" data-slot="layout-canvas-zoom" class="layout-canvas-zoom" title="Back to 100%">90%</button><button type="button" aria-label="Zoom in"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button><span class="layout-canvas-sep"></span><button type="button" aria-label="Fit everything"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4"/></svg></button></div><div data-slot="layout-canvas-minimap" class="layout-canvas-minimap" aria-hidden="true"><i style="left: 10%; top: 12%; width: 46%; height: 52%"></i></div></div>
  19. </template>
  20. <template data-status="loading">
  21. <div data-slot="layout-canvas" class="layout-canvas" data-status="loading" aria-busy="true" style="height: 320px"><div data-slot="layout-canvas-viewport" class="layout-canvas-viewport"><p class="layout-note">Drawing the canvas…</p></div><div data-slot="layout-canvas-controls" class="layout-canvas-controls"><button type="button" aria-label="Zoom out"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button><button type="button" data-slot="layout-canvas-zoom" class="layout-canvas-zoom" title="Back to 100%">90%</button><button type="button" aria-label="Zoom in"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button><span class="layout-canvas-sep"></span><button type="button" aria-label="Fit everything"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 9V5a1 1 0 0 1 1-1h4M15 4h4a1 1 0 0 1 1 1v4M20 15v4a1 1 0 0 1-1 1h-4M9 20H5a1 1 0 0 1-1-1v-4"/></svg></button></div></div>
  22. </template>