|
78 | 78 | </div>
|
79 | 79 | </section>
|
80 | 80 | {#if data.content}
|
81 |
| - {#each data.content as content, i} |
82 |
| - <article |
83 |
| - class="grid grid-cols-[repeat(auto-fit,minmax(450px,1fr))] gap-4 bg-surface-active-token my-4 py-4 px-8 rounded-xl" |
84 |
| - > |
85 |
| - <section> |
86 |
| - <div class="mb-4 relative"> |
87 |
| - <h2 class="h2">Textzeuge: {generateLabel([content.sigla])}</h2> |
88 |
| - <p> |
89 |
| - Vers: {localVerses[i]} |
90 |
| - </p> |
91 |
| - <a class="btn btn-icon absolute top-0 right-0" href={generateCloseLink(content.sigla)} |
92 |
| - ><i class="fa-solid fa-x"></i></a |
93 |
| - > |
94 |
| - </div> |
95 |
| - {#await content.meta then meta} |
96 |
| - {#if typeof meta === 'object' && typeof meta.tpData === 'object'} |
97 |
| - {#await meta.tpData} |
98 |
| - <p>Loading...</p> |
99 |
| - {:then tpData} |
100 |
| - {#if tpData} |
101 |
| - {#if tpData?.content} |
102 |
| - <TextzeugenContent |
103 |
| - content={tpData.content} |
104 |
| - on:localVerseChange={(e) => (localVerses[i] = e.detail)} |
105 |
| - /> |
| 81 | + <div class="grid grid-cols-[repeat(auto-fit,minmax(550px,1fr))] gap-4"> |
| 82 | + {#each data.content as content, i} |
| 83 | + <article |
| 84 | + class="grid grid-cols-[repeat(auto-fit,minmax(500px,1fr))] gap-4 bg-surface-active-token my-4 py-4 px-8 rounded-xl relative" |
| 85 | + > |
| 86 | + <section> |
| 87 | + <div class="mb-4 relative"> |
| 88 | + <h2 class="h2">Textzeuge: {generateLabel([content.sigla])}</h2> |
| 89 | + <p> |
| 90 | + Vers: {localVerses[i]} |
| 91 | + </p> |
| 92 | + <a class="btn btn-icon absolute top-0 right-0" href={generateCloseLink(content.sigla)} |
| 93 | + ><i class="fa-solid fa-x"></i></a |
| 94 | + > |
| 95 | + </div> |
| 96 | + {#await content.meta then meta} |
| 97 | + {#if typeof meta === 'object' && typeof meta.tpData === 'object'} |
| 98 | + {#await meta.tpData} |
| 99 | + <p>Loading...</p> |
| 100 | + {:then tpData} |
| 101 | + {#if tpData} |
| 102 | + {#if tpData?.content} |
| 103 | + <TextzeugenContent |
| 104 | + content={tpData.content} |
| 105 | + on:localVerseChange={(e) => (localVerses[i] = e.detail)} |
| 106 | + /> |
| 107 | + {:else} |
| 108 | + {JSON.stringify(tpData)} |
| 109 | + {/if} |
106 | 110 | {:else}
|
107 |
| - {JSON.stringify(tpData)} |
| 111 | + <p>Der Vers existiert nicht</p> |
108 | 112 | {/if}
|
109 |
| - {:else} |
110 |
| - <p>Der Vers existiert nicht</p> |
| 113 | + {:catch error} |
| 114 | + <p style="color: red">{error.message}</p> |
| 115 | + {/await} |
| 116 | + {/if} |
| 117 | + {/await} |
| 118 | + </section> |
| 119 | + {#if !($page.url.searchParams.get('iiif')?.split('-')[i] === 'true')} |
| 120 | + <section class="min-h-[40vh] relative"> |
| 121 | + {#await content.meta then meta} |
| 122 | + {#if typeof meta === 'object' && typeof meta.tpData === 'object'} |
| 123 | + {#await meta.iiif} |
| 124 | + <p>Loading...</p> |
| 125 | + {:then iiif} |
| 126 | + {#if typeof iiif === 'object'} |
| 127 | + <a |
| 128 | + class="btn btn-icon absolute top-0 right-0 z-10" |
| 129 | + href={generateIiifLink($page.url, i, true)}><i class="fa-solid fa-x"></i></a |
| 130 | + > |
| 131 | + <IIIFViewer {iiif} /> |
| 132 | + {/if} |
| 133 | + {:catch error} |
| 134 | + <p style="color: red">{error.message}</p> |
| 135 | + {/await} |
111 | 136 | {/if}
|
112 |
| - {:catch error} |
113 |
| - <p style="color: red">{error.message}</p> |
114 | 137 | {/await}
|
115 |
| - {/if} |
116 |
| - {/await} |
117 |
| - </section> |
118 |
| - <section class="min-h-[40vh] relative"> |
119 |
| - {#await content.meta then meta} |
120 |
| - {#if typeof meta === 'object' && typeof meta.tpData === 'object'} |
121 |
| - {#await meta.iiif} |
122 |
| - <p>Loading...</p> |
123 |
| - {:then iiif} |
124 |
| - {#if typeof iiif === 'object'} |
125 |
| - {#if !($page.url.searchParams.get('iiif')?.split('-')[i] === 'true')} |
126 |
| - <a |
127 |
| - class="btn btn-icon absolute top-0 right-0 z-10" |
128 |
| - href={generateIiifLink($page.url, i, true)}><i class="fa-solid fa-x"></i></a |
129 |
| - > |
130 |
| - <IIIFViewer {iiif} /> |
131 |
| - {:else} |
132 |
| - <a |
133 |
| - class="btn btn-icon absolute top-0 right-0 z-10" |
134 |
| - href={generateIiifLink($page.url, i, false)}><i class="fa-solid fa-x"></i></a |
135 |
| - > |
136 |
| - {/if} |
137 |
| - {/if} |
138 |
| - {:catch error} |
139 |
| - <p style="color: red">{error.message}</p> |
140 |
| - {/await} |
141 |
| - {/if} |
142 |
| - {/await} |
143 |
| - </section> |
144 |
| - </article> |
145 |
| - {/each} |
| 138 | + </section> |
| 139 | + {:else} |
| 140 | + <a class="btn btn-icon" href={generateIiifLink($page.url, i, false)} |
| 141 | + ><i class="fa-solid fa-image"></i></a |
| 142 | + > |
| 143 | + {/if} |
| 144 | + </article> |
| 145 | + {/each} |
| 146 | + </div> |
146 | 147 | {/if}
|
0 commit comments