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

View File

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

View File

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