openvibers/openvibe.live Commits
Hero cards load their pictures at 320 px (#536)
Changes
@@@ -674,7 +674,7 @@ let _heroCollageTimer = null;function _heroFloatContent(item) {const badge = `<span class="hero-float-badge">${_HERO_BADGE[item.kind] || ''}</span>`;if (item.thumbnail) {-- return `<img src="${esc(item.thumbnail)}" alt="" loading="lazy" onerror="this.remove()">`++ return `<img src="${esc(ovImgW(item.thumbnail, 320))}" data-full="${esc(item.thumbnail)}" alt="" loading="lazy" onerror="${OV_IMG_RETRY}this.remove()">`+ `<span class="hero-float-body">${badge}<span class="hero-float-title">${esc(item.title || '')}</span></span>`;}const snippet = item.text ? esc(item.text) : '';@@@ -50,4 +50,5 @@ assert.match(recap, /ovImgW\(u\.avatar_url, size > 72 \? 320 : size > 40 \? 160const channel = fs.readFileSync(path.join(__dirname, '..', 'public', 'js', 'app-channel.js'), 'utf8');assert.match(channel, /img\.src = typeof ovImgW === 'function' \? ovImgW\(full, 160\) : full;/);assert.match(feed, /ovImgW\(url, 640\)/, 'feed pictures at 640');++assert.match(js('app-home.js'), /ovImgW\(item\.thumbnail, 320\)/, 'hero cards at 320 (a 2460 px paste was drawn at 129)');console.log('avatar widths: all checks passed');
@@ -674,7 +674,7 @@ let _heroCollageTimer = null;
@@ -674,7 +674,7 @@ let _heroCollageTimer = null;
function _heroFloatContent(item) {
function _heroFloatContent(item) {
const badge = `<span class="hero-float-badge">${_HERO_BADGE[item.kind] || ''}</span>`;
const badge = `<span class="hero-float-badge">${_HERO_BADGE[item.kind] || ''}</span>`;
if (item.thumbnail) {
if (item.thumbnail) {
- return `<img src="${esc(item.thumbnail)}" alt="" loading="lazy" onerror="this.remove()">`
+ return `<img src="${esc(ovImgW(item.thumbnail, 320))}" data-full="${esc(item.thumbnail)}" alt="" loading="lazy" onerror="${OV_IMG_RETRY}this.remove()">`
+ `<span class="hero-float-body">${badge}<span class="hero-float-title">${esc(item.title || '')}</span></span>`;
+ `<span class="hero-float-body">${badge}<span class="hero-float-title">${esc(item.title || '')}</span></span>`;
}
}
const snippet = item.text ? esc(item.text) : '';
const snippet = item.text ? esc(item.text) : '';
@@ -50,4 +50,5 @@ assert.match(recap, /ovImgW\(u\.avatar_url, size > 72 \? 320 : size > 40 \? 160
@@ -50,4 +50,5 @@ assert.match(recap, /ovImgW\(u\.avatar_url, size > 72 \? 320 : size > 40 \? 160
const channel = fs.readFileSync(path.join(__dirname, '..', 'public', 'js', 'app-channel.js'), 'utf8');
const channel = fs.readFileSync(path.join(__dirname, '..', 'public', 'js', 'app-channel.js'), 'utf8');
assert.match(channel, /img\.src = typeof ovImgW === 'function' \? ovImgW\(full, 160\) : full;/);
assert.match(channel, /img\.src = typeof ovImgW === 'function' \? ovImgW\(full, 160\) : full;/);
assert.match(feed, /ovImgW\(url, 640\)/, 'feed pictures at 640');
assert.match(feed, /ovImgW\(url, 640\)/, 'feed pictures at 640');
+assert.match(js('app-home.js'), /ovImgW\(item\.thumbnail, 320\)/, 'hero cards at 320 (a 2460 px paste was drawn at 129)');
console.log('avatar widths: all checks passed');
console.log('avatar widths: all checks passed');