<script setup lang="ts">
const tldrawUrl = "https://www.tldraw.com";
</script>

<template>
  <section class="tldraw-lab-root">
    <div class="tldraw-lab-toolbar">
      <p class="tldraw-lab-title">tldraw demo (infinite canvas)</p>
      <a
        class="btn btn-xs btn-outline"
        :href="tldrawUrl"
        target="_blank"
        rel="noopener noreferrer"
      >
        Open in new tab
      </a>
    </div>

    <iframe
      class="tldraw-lab-frame"
      :src="tldrawUrl"
      title="tldraw demo"
      loading="lazy"
      referrerpolicy="no-referrer"
      allowfullscreen
    />
  </section>
</template>

<style scoped>
.tldraw-lab-root {
  height: calc(100dvh - 1rem);
  min-height: 640px;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--color-base-content) 20%, transparent);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: color-mix(in oklab, var(--color-base-100) 95%, transparent);
}

.tldraw-lab-toolbar {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border-bottom: 1px solid color-mix(in oklab, var(--color-base-content) 16%, transparent);
  background: color-mix(in oklab, var(--color-base-100) 94%, transparent);
}

.tldraw-lab-title {
  font-size: 0.78rem;
  color: color-mix(in oklab, var(--color-base-content) 72%, transparent);
}

.tldraw-lab-frame {
  width: 100%;
  height: calc(100% - 42px);
  border: 0;
}
</style>
