translate comments into English

This commit is contained in:
tsumac 2025-06-15 21:54:28 +09:00
parent e6449ffdc6
commit 668bb8b01a
3 changed files with 37 additions and 37 deletions

View File

@ -8,13 +8,13 @@ function handleLinkCardImages() {
if (!container) return if (!container) return
// 画像が既に読み込みエラーの場合complete=true かつ naturalWidth=0 // If the image has already failed to load (complete=true and naturalWidth=0)
if (imgElement.complete && imgElement.naturalWidth === 0) { if (imgElement.complete && imgElement.naturalWidth === 0) {
container.classList.add('image-failed') container.classList.add('image-failed')
return return
} }
// 画像読み込みエラー時のイベントリスナー // Event listener for image load errors
const handleError = () => { const handleError = () => {
container.classList.add('image-failed') container.classList.add('image-failed')
} }
@ -24,6 +24,6 @@ function handleLinkCardImages() {
}) })
} }
// ページ読み込み時とナビゲーション時に実行 // Execute on page load and navigation events
document.addEventListener('nav', handleLinkCardImages) document.addEventListener('nav', handleLinkCardImages)
document.addEventListener('DOMContentLoaded', handleLinkCardImages) document.addEventListener('DOMContentLoaded', handleLinkCardImages)

View File

@ -76,10 +76,10 @@
background: var(--lightgray); background: var(--lightgray);
position: relative; position: relative;
overflow: hidden; overflow: hidden;
min-width: 120px; // 最小幅を設定 min-width: 120px; // set minimum width
max-width: 300px; // 最大幅を設定 max-width: 300px; // set maximum width
height: 120px; // 高さは固定 height: 120px; // fixed height
width: auto; // 幅は画像に応じて自動調整 width: auto; // width adjusts automatically to image
&.image-failed { &.image-failed {
display: none; display: none;
@ -109,7 +109,7 @@
width: 100%; width: 100%;
height: 160px; height: 160px;
order: -1; order: -1;
max-width: none; // モバイルでは最大幅制限を解除 max-width: none; // remove max-width restriction on mobile
&.image-failed { &.image-failed {
display: none; display: none;

View File

@ -76,10 +76,10 @@
background: var(--lightgray); background: var(--lightgray);
position: relative; position: relative;
overflow: hidden; overflow: hidden;
min-width: 120px; // 最小幅を設定 min-width: 120px; // set minimum width
max-width: 300px; // 最大幅を設定 max-width: 300px; // set maximum width
height: 120px; // 高さは固定 height: 120px; // fixed height
width: auto; // 幅は画像に応じて自動調整 width: auto; // width adjusts automatically to image
&.image-failed { &.image-failed {
display: none; display: none;
@ -91,7 +91,7 @@
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
object-position: center; object-position: center;
min-width: 100%; // コンテナの幅は最低限埋める min-width: 100%; // ensure container is at least filled
} }
} }
@ -109,7 +109,7 @@
width: 100%; width: 100%;
height: 160px; height: 160px;
order: -1; order: -1;
max-width: none; // モバイルでは最大幅制限を解除 max-width: none; // remove max-width restriction on mobile
&.image-failed { &.image-failed {
display: none; display: none;