diff --git a/base.css b/base.css index 3c4b34a..572eeb2 100644 --- a/base.css +++ b/base.css @@ -157,7 +157,7 @@ main{ border-width: 1px; margin: 2px; } -@media (min-width: 480px){ +@media (min-width: 540px){ .main-box > div{ margin: 5px; } @@ -165,13 +165,14 @@ main{ display: table-cell; vertical-align: middle; width: 360px; + overflow: hidden; } .image-box > a{ border-width: 4px; margin: 10px; } } -@media (min-width: 600px){ +@media (min-width: 640px){ .nav{ max-height: none; top: 0; diff --git a/dark.css b/dark.css index 65c7748..32609de 100644 --- a/dark.css +++ b/dark.css @@ -30,8 +30,14 @@ a{ .main-box{ background-color: #0f0f0f; } +.item-table{ + background-color: #3f3f3f; +} .item-table > div > div, .item-table-caption{ - border-color: #F5DEB3FF; + border-color: #f5deb3; +} +.image-box{ + background-color: #4f4f4f; } .image-box > a{ border-color: #b0b0f0; diff --git a/index.go.html b/index.go.html index 4514b09..7915dbb 100644 --- a/index.go.html +++ b/index.go.html @@ -42,7 +42,7 @@
#birth#
thumbnailLocation: "https://cityuni.captainalm.com/resources/assets/imageofyou.jpg" imageLocation: "https://cityuni.captainalm.com/resources/assets/imageofyou.jpg" + imageAltText: "Image of me." birthYear: 2002 contactEmail: "alfred@captainalm.com" entries: @@ -46,6 +47,10 @@ entries: - "https://cityuni.captainalm.com/resources/assets/pic1.png" - "https://cityuni.captainalm.com/resources/assets/pic2.png" - "https://cityuni.captainalm.com/resources/assets/pic3.png" + imageAltTexts: + - "Picture 1." + - "Picture 2." + - "Picture 3." - name: "City Game Project 2022: Ninjaformer (Alpha, Beta)" content: >@@ -76,3 +81,7 @@ entries: - "https://cityuni.captainalm.com/resources/assets/pic4.png" - "https://cityuni.captainalm.com/resources/assets/pic5.png" - "https://cityuni.captainalm.com/resources/assets/pic6.png" + imageAltTexts: + - "Picture 4." + - "Picture 5." + - "Picture 6." diff --git a/pageHandler/pages/index/about.go b/pageHandler/pages/index/about.go index fa31baa..7c1c834 100644 --- a/pageHandler/pages/index/about.go +++ b/pageHandler/pages/index/about.go @@ -12,6 +12,7 @@ type AboutYaml struct { Content string `yaml:"content"` ThumbnailLocation string `yaml:"thumbnailLocation"` ImageLocation string `yaml:"imageLocation"` + ImageAltText string `yaml:"imageAltText"` BirthYear int `yaml:"birthYear"` ContactEmail string `yaml:"contactEmail"` } diff --git a/pageHandler/pages/index/entry.go b/pageHandler/pages/index/entry.go index 9a72e8e..03d68be 100644 --- a/pageHandler/pages/index/entry.go +++ b/pageHandler/pages/index/entry.go @@ -18,11 +18,13 @@ type EntryYaml struct { VideoContentType string `yaml:"videoContentType"` ThumbnailLocations []string `yaml:"thumbnailLocations"` ImageLocations []string `yaml:"imageLocations"` + ImageAltTexts []string `yaml:"imageAltTexts"` } type ImageReference struct { ThumbnailLocation string ImageLocation string + ImageAltText string } func (ey EntryYaml) GetStartDate() string { @@ -54,15 +56,16 @@ func (ey EntryYaml) GetDuration() time.Duration { } func (ey EntryYaml) GetImageCount() int { - return int(math.Min(float64(len(ey.ThumbnailLocations)), float64(len(ey.ImageLocations)))) + return int(math.Min(math.Min(float64(len(ey.ThumbnailLocations)), float64(len(ey.ImageLocations))), float64(len(ey.ImageAltTexts)))) } func (ey EntryYaml) GetImages() []ImageReference { toReturn := make([]ImageReference, ey.GetImageCount()) - for i := 0; i < len(ey.ThumbnailLocations) && i < len(ey.ImageLocations); i++ { + for i := 0; i < len(ey.ThumbnailLocations) && i < len(ey.ImageLocations) && i < len(ey.ImageAltTexts); i++ { toReturn[i] = ImageReference{ ThumbnailLocation: ey.ThumbnailLocations[i], ImageLocation: ey.ImageLocations[i], + ImageAltText: ey.ImageAltTexts[i], } } return toReturn