Skip to content

Commit

Permalink
ElementPhoto.svelte use .avif extension
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Mar 16, 2023
1 parent 3923def commit 507b0ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lib/ElementPhoto.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$: ({ name, number } = element ?? {})
$: file = `elements/${number}-${name?.toLowerCase()}.jpg`
$: file = `elements/${number}-${name?.toLowerCase()}.avif`
let hidden = false
$: file, (hidden = false) // reset hidden to false when src changes
</script>
Expand Down
18 changes: 9 additions & 9 deletions src/update-site-screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ const today = new Date().toISOString().slice(0, 10)

const pages = [
{
url: '/',
url: `/`,
name: `landing-page`,
actions: [['hover', 'a[href="selenium"]']],
actions: [[`hover`, `a[href="selenium"]`]],
},
{
url: '/',
url: `/`,
name: `heatmap`,
actions: [
['click', 'input[placeholder="Select a heat map"]'],
['click', 'ul.options > li:nth-child(2)'],
['click', 'h1'], // close dropdown
['hover', 'a[href="radon"]'],
[`click`, `input[placeholder="Select a heat map"]`],
[`click`, `ul.options > li:nth-child(2)`],
[`click`, `h1`], // close dropdown
[`hover`, `a[href="radon"]`],
],
},
{ url: '/radon', name: `details-page` },
{ url: `/radon`, name: `details-page` },
]

const browser = await puppeteer.launch()
Expand All @@ -32,7 +32,7 @@ for (const { url, name, actions = [] } of pages) {
// increase screenshot resolution
await page.setViewport({ width: 1200, height: 700, deviceScaleFactor: 3 })

await page.goto(`http://localhost:3000${url}`, { waitUntil: 'networkidle2' })
await page.goto(`http://localhost:3000${url}`, { waitUntil: `networkidle2` })
for (const [action, selector] of actions) {
await page.waitForSelector(selector)
await page[action](selector)
Expand Down

0 comments on commit 507b0ee

Please sign in to comment.