Skip to content

Commit

Permalink
fix: /code page responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Aug 24, 2024
1 parent 6db0892 commit cd7ce07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/assets/js/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ async function copyContent(from: HTMLElement, to: HTMLElement, highlight = false

async function copyName() {
if (input.$name && output.$name) {
input.$name.textContent = input.$name.textContent?.trim() ?? ""
await copyContent(input.$name, output.$name)
await copyCode()
}
Expand Down
16 changes: 8 additions & 8 deletions src/files/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const code = defineAkteFile<GlobalData>().from({
</p>
</header>
<form class="space-y-6">
<fieldset class="section space-y-2">
<fieldset class="section">
<p>
Change padding to
<input type="radio" name="padding" id="padding-0" value="0rem" data-on-change="set-padding" class="sr-only peer/padding-0" />
Expand All @@ -42,7 +42,7 @@ export const code = defineAkteFile<GlobalData>().from({
<input type="radio" name="size" id="size-fit" value="fit" data-on-change="set-size" class="sr-only peer/size-fit" />
<label for="size-fit" class="inline underline cursor-pointer peer-checked/size-fit:no-underline peer-checked/size-fit:cursor-auto">fit-content</label>, or
<input type="radio" name="size" id="size-2-1" value="2:1" data-on-change="set-size" class="sr-only peer/size-2-1" />
<label for="size-2-1" class="inline underline cursor-pointer peer-checked/size-2-1:no-underline peer-checked/size-2-1:cursor-auto">2:1ar</label>
<label for="size-2-1" class="inline underline cursor-pointer peer-checked/size-2-1:no-underline peer-checked/size-2-1:cursor-auto">2:1</label>
</p>
<p>
<label for="background">Set background to</labl>
Expand All @@ -59,8 +59,8 @@ export const code = defineAkteFile<GlobalData>().from({
</select>
</p>
</fieldset>
<fieldset class="flex center:justify-center right:justify-end">
<div class="min-w-[42.5rem] flex">
<fieldset class="flex md:center:justify-center md:right:justify-end overflow-x-auto overflow-y-hidden over scrollbar-thin" style="min-inline-size: auto;">
<div class="min-w-[39.5rem] flex">
<div id="preview" class="relative flex justify-center items-center" style="padding: 1.5rem;">
<div id="transparent" class="bg-grid absolute inset-0" data-ignore-in-export="true"></div>
<div id="inner-preview" class="relative mx-auto" style="width: 39.5rem;">
Expand All @@ -70,7 +70,7 @@ export const code = defineAkteFile<GlobalData>().from({
<pre class="min-h-[calc(1lh+1.5rem)]"><code class="outline-none text-wrap break-all min-h-[1lh] !text-transparent caret-cream block" contenteditable="plaintext-only" autocomplete="off" autocorrect="off" spellcheck="false" autocapitalize="off" data-enable-grammarly="false">import { defineAkteApp } from "akte"
export const app = defineAkteApp({
files: [],
files: [],
})</code></pre>
</div>
</figure>
Expand All @@ -88,10 +88,10 @@ files: [],
</div>
</div>
</fieldset>
<fieldset class="section space-y-2">
<fieldset class="section">
<p>
<button data-on-click="download-image" class="underline">Download image</button> or
<button data-on-click="copy-image" class="underline">copy it to your clipboard</button>.
<button type="button" data-on-click="download-image" class="underline">Download image</button> or
<button type="button" data-on-click="copy-image" class="underline">copy it to your clipboard</button>.
</p>
</fieldset>
</form>
Expand Down

0 comments on commit cd7ce07

Please sign in to comment.