mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-17 03:29:31 -07:00
fix(stage.ts, collection.ts, gallery.ts, resources.ts): set the alt attribute of the image element to the value of the alt property in the ImageJSON object to improve accessibility and provide alternative text for images.
This commit is contained in:
@@ -267,7 +267,7 @@ function createStage(ijs: ImageJSON[]): void {
|
||||
e.dataset.loUrl = ij.loUrl
|
||||
e.dataset.loImgH = ij.loImgH.toString()
|
||||
e.dataset.loImgW = ij.loImgW.toString()
|
||||
e.alt = 'image'
|
||||
e.alt = ij.alt
|
||||
stage.append(e)
|
||||
}
|
||||
container.append(stage)
|
||||
|
||||
@@ -86,7 +86,7 @@ function createCollection(ijs: ImageJSON[]): void {
|
||||
e.dataset.src = ij.loUrl
|
||||
e.height = ij.loImgH
|
||||
e.width = ij.loImgW
|
||||
e.alt = 'image'
|
||||
e.alt = ij.alt
|
||||
e.style.transform = `translate3d(${x}%, ${y - 50}%, 0)`
|
||||
_collection.append(e)
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ function createGallery(ijs: ImageJSON[]): void {
|
||||
e.dataset.src = ij.hiUrl
|
||||
e.height = ij.hiImgH
|
||||
e.width = ij.hiImgW
|
||||
e.alt = 'image'
|
||||
e.alt = ij.alt
|
||||
// append
|
||||
_swiperSlide.append(e)
|
||||
_swiperWrapper.append(_swiperSlide)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// data structure for images info
|
||||
export interface ImageJSON {
|
||||
index: number
|
||||
alt: string
|
||||
loUrl: string
|
||||
loImgH: number
|
||||
loImgW: number
|
||||
|
||||
Reference in New Issue
Block a user