Merge Edge with sort and resize #2
27
base.css
27
base.css
@ -127,16 +127,23 @@ main{
|
|||||||
.item-table-360{
|
.item-table-360{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.item-table-span{
|
.image-box{
|
||||||
position: absolute;
|
display: -webkit-box;
|
||||||
left: 0;
|
display: -moz-box;
|
||||||
}
|
display: -ms-flexbox;
|
||||||
.item-table-dummy{
|
display: -webkit-flex;
|
||||||
display: table-cell;
|
display: flex;
|
||||||
vertical-align: top;
|
-webkit-box-orient: horizontal;
|
||||||
border-color: transparent;
|
-moz-box-orient: horizontal;
|
||||||
background-color: transparent;
|
-webkit-box-direction: normal;
|
||||||
box-sizing: inherit;
|
-moz-box-direction: normal;
|
||||||
|
-webkit-flex-direction: row;
|
||||||
|
-ms-flex-direction: row;
|
||||||
|
flex-direction: row;
|
||||||
|
-ms-flex-wrap: wrap;
|
||||||
|
-webkit-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
@media (min-width: 480px){
|
@media (min-width: 480px){
|
||||||
.main-table > div > div > div{
|
.main-table > div > div > div{
|
||||||
|
@ -78,17 +78,22 @@
|
|||||||
</video></div>
|
</video></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ if not (eq .GetImageCount 0) }}
|
||||||
<div>
|
<div>
|
||||||
<div class="item-table-dummy"></div>
|
<div>
|
||||||
<div class="item-table-full item-table-span">
|
<div class="image-box">
|
||||||
<div class="padded-2px">{{ .GetContent }}</div>
|
{{ range .GetImages }}
|
||||||
</div>
|
<a href="{{ .ImageLocation }}"><img src="{{ .ThumbnailLocation }}" width="144"></a>
|
||||||
</div>
|
{{ end }}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
16
index.go.yml
16
index.go.yml
@ -38,6 +38,14 @@ entries:
|
|||||||
endDate: "31/10/2021"
|
endDate: "31/10/2021"
|
||||||
videoLocation: "https://cityuni.captainalm.com/resources/stream/vid1.mp4"
|
videoLocation: "https://cityuni.captainalm.com/resources/stream/vid1.mp4"
|
||||||
videoContentType: "video/mp4"
|
videoContentType: "video/mp4"
|
||||||
|
thumbnailLocations:
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic1.png"
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic2.png"
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic3.png"
|
||||||
|
imageLocations:
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic1.png"
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic2.png"
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic3.png"
|
||||||
- name: "City Game Project 2022: Ninjaformer (Alpha, Beta)"
|
- name: "City Game Project 2022: Ninjaformer (Alpha, Beta)"
|
||||||
content: >
|
content: >
|
||||||
<p>
|
<p>
|
||||||
@ -60,3 +68,11 @@ entries:
|
|||||||
endDate: "08/05/2022"
|
endDate: "08/05/2022"
|
||||||
videoLocation: "https://cityuni.captainalm.com/resources/stream/vid2.mp4"
|
videoLocation: "https://cityuni.captainalm.com/resources/stream/vid2.mp4"
|
||||||
videoContentType: "video/mp4"
|
videoContentType: "video/mp4"
|
||||||
|
thumbnailLocations:
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic4.png"
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic5.png"
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic6.png"
|
||||||
|
imageLocations:
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic4.png"
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic5.png"
|
||||||
|
- "https://cityuni.captainalm.com/resources/assets/pic6.png"
|
||||||
|
@ -3,6 +3,7 @@ package index
|
|||||||
import (
|
import (
|
||||||
"golang.captainalm.com/cityuni-webserver/utils/yaml"
|
"golang.captainalm.com/cityuni-webserver/utils/yaml"
|
||||||
"html/template"
|
"html/template"
|
||||||
|
"math"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,6 +20,11 @@ type EntryYaml struct {
|
|||||||
ImageLocations []string `yaml:"imageLocations"`
|
ImageLocations []string `yaml:"imageLocations"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ImageReference struct {
|
||||||
|
ThumbnailLocation string
|
||||||
|
ImageLocation string
|
||||||
|
}
|
||||||
|
|
||||||
func (ey EntryYaml) GetStartDate() string {
|
func (ey EntryYaml) GetStartDate() string {
|
||||||
return ey.StartDate.Format(dateFormat)
|
return ey.StartDate.Format(dateFormat)
|
||||||
}
|
}
|
||||||
@ -46,3 +52,18 @@ func (ey EntryYaml) GetContent() template.HTML {
|
|||||||
func (ey EntryYaml) GetDuration() time.Duration {
|
func (ey EntryYaml) GetDuration() time.Duration {
|
||||||
return ey.GetEndTime().Sub(ey.StartDate.Time).Truncate(time.Second)
|
return ey.GetEndTime().Sub(ey.StartDate.Time).Truncate(time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ey EntryYaml) GetImageCount() int {
|
||||||
|
return int(math.Min(float64(len(ey.ThumbnailLocations)), float64(len(ey.ImageLocations))))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ey EntryYaml) GetImages() []ImageReference {
|
||||||
|
toReturn := make([]ImageReference, ey.GetImageCount())
|
||||||
|
for i := 0; i < len(ey.ThumbnailLocations) && i < len(ey.ImageLocations); i++ {
|
||||||
|
toReturn[i] = ImageReference{
|
||||||
|
ThumbnailLocation: ey.ThumbnailLocations[i],
|
||||||
|
ImageLocation: ey.ImageLocations[i],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return toReturn
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user