{{#liquid-wormhole class="unsplash"}} {{!-- TODO: why does this modal background not cover the PSM without style override? --}}
{{!-- close button --}}
{{!-- static header --}}

{{svg-jar "unsplash" class="fill-darkgrey-d2"}} Unsplash

{{svg-jar "search"}} {{gh-text-input class="gh-unsplash-search" name="searchKeyword" placeholder="Search free high-resolution photos" tabindex="1" autofocus="autofocus" autocorrect="off" value=(readonly unsplash.searchTerm) input=(action "search" value="target.value") focusIn=(action "setKeyScope") focus-out=(action "resetKeyScope") }}
{{!-- content container --}}
{{!-- scrollable image container --}}
{{#if unsplash.photos}}
{{#each unsplash.columns as |photos|}}
{{#each photos as |photo|}} {{gh-unsplash-photo photo=photo zoom=(action "zoomPhoto") select=(action "select")}} {{/each}}
{{/each}}
{{else if (and unsplash.searchTerm (not unsplash.error unsplash.isLoading))}}
No photos found

No photos found for '{{unsplash.searchTerm}}'

{{/if}} {{#if unsplash.error}} {{!-- TODO: add better error styles? --}}
Network error

{{unsplash.error}} (retry)

{{/if}} {{#if unsplash.isLoading}}
{{/if}} {{gh-scroll-trigger enter=(action "loadNextPage") triggerOffset=1000}}
{{!-- zoomed image overlay --}} {{#if zoomedPhoto}}
{{gh-unsplash-photo photo=zoomedPhoto zoomed=true zoom=(action "closeZoom") select=(action "select")}}
{{/if}}
{{/liquid-wormhole}}