Skip to content

Commit

Permalink
Edit to handle missing weekly image
Browse files Browse the repository at this point in the history
  • Loading branch information
tybayn committed Dec 23, 2024
1 parent 180f53b commit 09b2b7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ <h1 id="new_offset" style="display:none;"></h1>
<script src="scripts-v7/filter-v16.js"></script>
<script src="scripts-v7/sanity-v2.js"></script>
<script src="scripts-v7/wslink-v14.js"></script>
<script src="scripts-v7/zn-v10.js"></script>
<script src="scripts-v7/zn-v11.js"></script>
<script src="events-v7/events-v1.js"></script>
<script src="models-v7/models-v1.js"></script>
<script src="feed-v7/feed-v1.js"></script>
Expand Down
4 changes: 3 additions & 1 deletion scripts-v7/zn-v10.js → scripts-v7/zn-v11.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ function loadAllAndConnect(){
"difficulty_id": data.difficulty_id
}

let image_str = weekly_data.equipment_url !== null ? `<img class="weekly-image" loading="lazy" src="${weekly_data.equipment_url}">` : "<h4>Hold tight! We will have an image soon!</h4>"

let weekly_html = `
<h1>${weekly_data.title}</h1>
<h4 style="margin-top:0px;"><i>${weekly_data.description}</i></h4>
Expand All @@ -404,7 +406,7 @@ function loadAllAndConnect(){
<div class="weekly-mod"><b>Cursed Possessions</b>${weekly_data.cursed_objects.join(', ')}</div>
<div class="weekly-mod"><b>Difficulty Settings</b><a href="https://zero-network.net/phasmo-cheat-sheet/difficulty-builder/?share=${weekly_data.difficulty_id}" target="_blank">${weekly_data.difficulty_id}</a></div>
</div>
<img class="weekly-image" loading="lazy" src="${weekly_data.equipment_url}">
${image_str}
`

document.getElementById("weekly_title").innerText += ` (${getCurrentWeekUTC()})`
Expand Down

0 comments on commit 09b2b7b

Please sign in to comment.