fix some codevier overflows [2]

This commit is contained in:
Nikita Galaiko 2023-03-15 16:35:31 +01:00
parent 4a3bb13408
commit bf49ec9d9a
No known key found for this signature in database
GPG Key ID: EBAB54E845BA519D
2 changed files with 19 additions and 15 deletions

View File

@ -66,12 +66,12 @@
type === 'insert' ? 'bg-[#14FF00]/20' : type === 'delete' ? 'bg-[#FF0000]/20' : '';
</script>
<table class="h-full w-full whitespace-pre font-mono" bind:this={editor}>
<table class="flex h-full w-full flex-col whitespace-pre font-mono" bind:this={editor}>
{#each parsed as hunk}
<tbody>
{#each highlightBlocks(hunk.blocks) as block}
{#each block.lines as line}
<tr>
<tr class="w-full">
<td>
<div class="flex select-none justify-between gap-2">
<div>{line.oldNumber ?? ''}</div>
@ -80,14 +80,14 @@
</td>
<td
class={bgColor(line.type)}
class="flex-auto {bgColor(line.type)}"
class:changed={line.type === 'insert' || line.type === 'delete'}
>
<div class="d2h-code-line relative px-4">
<div class="px-4">
{#if line.content}
<span>{@html line.content}</span>
{:else}
<span class="d2h-code-line-ctn whitespace-pre">{line.originalContent}</span>
<span>{line.originalContent}</span>
{/if}
</div>
</td>

View File

@ -312,8 +312,8 @@
</div>
</div>
{:else}
<div class="flex h-full w-full flex-row bg-black">
<div class="w-24 flex-shrink-0 border-r border-zinc-700 p-2">
<div id="player-page" class="flex h-full w-full flex-row bg-black">
<div id="left" class="w-24 flex-shrink-0 border-r border-zinc-700 p-2">
<div class="font-zinc-100 mb-2 text-lg font-bold">Daily Work</div>
{#each Object.entries(sessionDays) as [day, sessions]}
{#if day == currentDay}
@ -335,9 +335,10 @@
{/if}
{/each}
</div>
<div class="flex-grow">
<div class="flex h-full w-full flex-col">
<div class="flex-auto overflow-x-hidden overflow-y-scroll text-clip p-2">
<div id="middle" class="flex-auto overflow-auto">
<div class="flex h-full w-full flex-col gap-2">
<div id="code" class="flex-auto overflow-auto px-2">
{#if dayPlaylist[currentDay] !== undefined}
{#if currentEdit !== null}
<CodeViewer
@ -347,10 +348,11 @@
/>
{/if}
{:else}
loading...
<span class="m-auto">loading...</span>
{/if}
</div>
<div class="p-2">
<div id="info" class="px-2">
{#if dayPlaylist[currentDay] !== undefined}
<div class="flex flex-row justify-between">
<div>{dayPlaylist[currentDay].chapters.length} sessions</div>
@ -365,9 +367,10 @@
{/if}
{/if}
</div>
<div class="flex flex-col bg-zinc-800 p-2 p-2">
<div id="controls" class="flex flex-col bg-zinc-800 px-2">
{#if dayPlaylist[currentDay] !== undefined}
<div class="h-0 w-full justify-between">
<div class="flex h-0 w-full justify-between">
{#each dayPlaylist[currentDay].chapters as chapter}
<div
class="inline-block h-2 rounded bg-white"
@ -442,7 +445,8 @@
</div>
</div>
</div>
<div class="w-80 flex-shrink-0 overflow-auto border-l border-zinc-700 bg-black p-2">
<div id="right" class="w-80 flex-shrink-0 overflow-auto border-l border-zinc-700 bg-black p-2">
<div class="flex flex-row justify-between">
<div class="font-zinc-100 mb-2 text-lg font-bold">Sessions</div>
<div>{Object.entries(sessionDays[currentDay]).length}</div>