File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed
Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,12 @@ onMount(() => {
5959});
6060 </script >
6161
62+ <svelte:head >
63+ {#each blocks as { thumbnail }}
64+ <link rel ="preload" as ="image" href ={thumbnail } />
65+ {/each }
66+ </svelte:head >
67+
6268<div id =" container" class =" fixed inset-0" >
6369 <div class =" w-full h-full py-8 backdrop-blur-xs flex flex-col" >
6470 <div class =" " >
@@ -128,19 +134,12 @@ onMount(() => {
128134 <!-- 画像を中央に配置 -->
129135 <div class =" h-full" >
130136 {#if search .selected !== null }
131- {#key search .world }
132- {#each blocks as block , idx }
133- {@const stage = idx + 1 }
134- <img
135- src ={block .thumbnail }
136- alt =" "
137- class ={[
138- " h-full skeleton" ,
139- stage !== search .selected && " hidden" ,
140- ]}
141- />
142- {/each }
143- {/ key }
137+ {@const block = blocks .find (
138+ (b , idx ) => /* stage = idx + 1 */ idx + 1 === search .selected ,
139+ )}
140+ {#if block }
141+ <img src ={block .thumbnail } alt =" " class =" h-full skeleton" />
142+ {/if }
144143 {/if }
145144 </div >
146145 <!-- テキストを画像の右側に配置 -->
You can’t perform that action at this time.
0 commit comments