Skip to content

Commit

Permalink
Merge pull request #158 from lfmnovaes/feat/infernalist-webp
Browse files Browse the repository at this point in the history
Ascendancies webp version
  • Loading branch information
marcoaaguiar authored Dec 4, 2024
2 parents 0bc9573 + 8aeac8f commit e2f1c72
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/lib/data/nodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -15390,8 +15390,8 @@
},
{
"id": "AS10",
"x": 0.5194545454545455,
"y": 0.4812614525139665,
"x": 0.5196403418306645,
"y": 0.47886322739524173,
"kind": "small",
"class": "infernalist"
},
Expand Down Expand Up @@ -15467,8 +15467,8 @@
},
{
"id": "AN10",
"x": 0.5219545454545455,
"y": 0.4910614525139665,
"x": 0.5232346776432371,
"y": 0.488551374200091,
"kind": "notable",
"class": "infernalist"
},
Expand Down
39 changes: 22 additions & 17 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,8 @@
onmousedown={handleContainerMousedown}
onwheel={handleWheel}
>
<!-- svelte-ignore a11y_no_static_element_interactions -->
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
bind:this={imageWrapperEl}
class="absolute top-0 left-0"
Expand All @@ -673,23 +675,26 @@
height: {imageEl ? imageEl.naturalHeight * scale + 'px' : 'auto'};
"
/>

<img
class="pointer-events-none absolute"
bind:this={ascImageEl}
src="{base}/ascendancies/{selectedAscendancy}.png"
alt="Interactive"
draggable="false"
style="
width: {320 * scale + 'px'};
top: 50%;
left: 50%;
margin-top: -{320 * scale * 0.46 + 'px'};
margin-left: -{320 * scale * 0.487 + 'px'};
height: {320 * scale + 'px'};
"
/>

<picture>
<!-- Attempt to load the .webp version -->
<source srcset="{base}/ascendancies/{selectedAscendancy}.webp" type="image/webp" />
<!-- Fallback to the .png version -->
<img
class="pointer-events-none absolute"
bind:this={ascImageEl}
src="{base}/ascendancies/{selectedAscendancy}.png"
alt="Interactive"
draggable="false"
style="
width: {320 * scale + 'px'};
top: 50%;
left: 50%;
margin-top: -{320 * scale * 0.46 + 'px'};
margin-left: -{320 * scale * 0.487 + 'px'};
height: {320 * scale + 'px'};
"
/>
</picture>
<!-- Display hoverable regions with lighter color -->
{#if hasLoaded}
{#each Object.values(nodes).filter(filterNodes) as node}
Expand Down
Binary file added static/ascendancies/acolyte.webp
Binary file not shown.
Binary file added static/ascendancies/bloodmage.webp
Binary file not shown.
Binary file added static/ascendancies/chronomancer.webp
Binary file not shown.
Binary file added static/ascendancies/deadeye.webp
Binary file not shown.
Binary file added static/ascendancies/gemling.webp
Binary file not shown.
Binary file added static/ascendancies/infernalist.webp
Binary file not shown.
Binary file added static/ascendancies/invoker.webp
Binary file not shown.
Binary file added static/ascendancies/pathfinder.webp
Binary file not shown.
Binary file added static/ascendancies/stormweaver.webp
Binary file not shown.
Binary file added static/ascendancies/titan.webp
Binary file not shown.
Binary file added static/ascendancies/warbringer.webp
Binary file not shown.
Binary file added static/ascendancies/witchhunter.webp
Binary file not shown.

0 comments on commit e2f1c72

Please sign in to comment.