From 0b2ba868a34a7c876050be8728971348be8543bc Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Mon, 25 Jul 2022 15:39:05 +0100 Subject: [PATCH 01/64] Initial edge commit. Update page handling system. Update Makefile and .gitignore . --- .gitignore | 8 ++ Makefile | 3 + base.css | 112 ++++++++++++++++++++ dark.css | 29 +++++ goinfo.go.html | 5 - index.go.html | 32 ++++++ index.go.yml | 11 ++ index.js | 0 pageHandler/pages/index/data.go | 35 ++++-- pageHandler/pages/index/entry.go | 21 ++-- pageHandler/pages/index/index-page.go | 4 +- pageHandler/pages/index/template-marshal.go | 4 +- utils/yaml/date-type.go | 31 ++++++ 13 files changed, 269 insertions(+), 26 deletions(-) create mode 100644 base.css create mode 100644 dark.css create mode 100644 index.go.html create mode 100644 index.go.yml create mode 100644 index.js create mode 100644 utils/yaml/date-type.go diff --git a/.gitignore b/.gitignore index f2ec00d..e7770f8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,11 @@ dist/ # Test data and logs folders .data/ .idea/dataSources.xml + +# CDN link +cdn/ +cdn + +# Config Link +cnf/ +cnf diff --git a/Makefile b/Makefile index 2074b0c..f9d1b66 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,7 @@ clean: deploy: build sudo systemctl stop wappcityuni sudo cp "${BIN}" /usr/local/bin + sudo cp *.go.html cnf + sudo cp *.css cdn + sudo cp *.js cdn sudo systemctl start wappcityuni diff --git a/base.css b/base.css new file mode 100644 index 0000000..aafc438 --- /dev/null +++ b/base.css @@ -0,0 +1,112 @@ +*{ + margin: 0; + padding: 0; + box-sizing: border-box; +} +main{ + padding-top: 90px; + padding-left: 6px; +} +.no-dec{ + text-decoration: none; +} +.no-lst-style{ + list-style: none; +} +.header{ + box-shadow: 1px 1px 5px 0px; + position: fixed; + top: 0; + width: 100%; +} +.home-button{ + display: inline-block; + font-size: 60px; + padding: 7px 10px 6px; +} +.nav{ + width: 100%; + height: 100%; + overflow: hidden; + max-height: 0; +} +.nav-menu{ + display: none; +} +.menu a{ + display: block; + padding: 32px 30px; +} +.hmb{ + cursor: pointer; + float: right; + background-color: transparent; + padding: 40px 20px; +} +.hmb-line{ + display: block; + height: 2px; + position: relative; + width: 24px; + +} +.hmb-line::before, .hmb-line::after{ + content: ''; + display: block; + height: 100%; + position: absolute; + transition: all .1s ease-out; + width: 100%; +} +.hmb-line::before{ + top: 5px; +} +.hmb-line::after{ + top: -5px; +} +.nav-menu:checked ~ nav{ + max-height: 100%; +} +.nav-menu:checked ~ .hmb .hmb-line{ + background: transparent; +} +.nav-menu:checked ~ .hmb .hmb-line::before{ + transform: rotate(-45deg); + top:0; +} +.nav-menu:checked ~ .hmb .hmb-line::after{ + transform: rotate(45deg); + top:0; +} +.flex-main{ + display: flex; + flex-direction: column; +} +.box-main{ + display: table; + width: 100%; + margin: 1px; + align-self: center; +} +@media (min-width: 480px){ + .nav{ + max-height: none; + top: 0; + position: relative; + float: right; + width: fit-content; + } + .menu li{ + float: left; + } + .menu a:hover{ + background-color: transparent; + + } + .hmb{ + display: none; + } + .box-main{ + margin: 5px 10px; + } +} \ No newline at end of file diff --git a/dark.css b/dark.css new file mode 100644 index 0000000..bd03de0 --- /dev/null +++ b/dark.css @@ -0,0 +1,29 @@ +body{ + color: #f9f9f9; + background-color: #050506; + border-color: #696969; +} +.header, .nav{ + background-color: #1d1d1e; +} +.home-button{ + color: #e0e0e0; +} +.home-button:hover{ + background-color: #606061; +} +.header{ + box-shadow-color: #696969; +} +.menu a{ + color: #e0e0e0; +} +.menu a:hover{ + background-color: #606061; +} +.hmb:hover{ + background-color: #606061; +} +.hmb-line, .hmb-line::before, .hmb-line::after{ + background: #e0e0e0; +} \ No newline at end of file diff --git a/goinfo.go.html b/goinfo.go.html index 5b299fb..4ab075d 100644 --- a/goinfo.go.html +++ b/goinfo.go.html @@ -13,7 +13,6 @@ text-align: center; background-color: mediumslateblue; } - table, th, td { margin: auto; text-align: left; @@ -21,20 +20,16 @@ border-collapse: collapse; word-break: break-word; } - table, td { background-color: lightgray; } - table { width: 80%; } - th { background-color: lightsteelblue; width: 25%; } - td { width: 75%; } diff --git a/index.go.html b/index.go.html new file mode 100644 index 0000000..70e44d2 --- /dev/null +++ b/index.go.html @@ -0,0 +1,32 @@ + + + + + + + City University Portfolio + + {{ if .Light }} + + {{ else }} + + {{ end }} + + + +
+ + + + +
+
+
+ + \ No newline at end of file diff --git a/index.go.yml b/index.go.yml new file mode 100644 index 0000000..27b69ff --- /dev/null +++ b/index.go.yml @@ -0,0 +1,11 @@ +cssBaseURL: "http://192.168.1.193:8081/test/base.css" +cssDarkURL: "http://192.168.1.193:8081/test/dark.css" +cssLightURL: "http://192.168.1.193:8081/test/light.css" +jScriptURL: "http://192.168.1.193:8081/test/index.js" +headerLinks: + Main Portfolio: "https://portfolio.captainalm.com/" + Root Site Home: "https://www.captainalm.com/" + Github: "https://github.com/Captain-ALM/" +about: + title: "Alfred Manville (Captain ALM)" +entries: diff --git a/index.js b/index.js new file mode 100644 index 0000000..e69de29 diff --git a/pageHandler/pages/index/data.go b/pageHandler/pages/index/data.go index 81afea0..bac0b4c 100644 --- a/pageHandler/pages/index/data.go +++ b/pageHandler/pages/index/data.go @@ -1,12 +1,31 @@ package index type DataYaml struct { - HomeLink string `yaml:"homeLink"` - PortfolioLink string `yaml:"portfolioLink"` - CSSBaseURL string `yaml:"cssBaseURL"` - CSSLightURL string `yaml:"cssLightURL"` - CSSDarkURL string `yaml:"cssDarkURL"` - JScriptURL string `yaml:"jScriptURL"` - About AboutYaml `yaml:"about"` - Entries []EntryYaml `yaml:"entries"` + HeaderLinks map[string]string `yaml:"headerLinks"` + CSSBaseURL string `yaml:"cssBaseURL"` + CSSLightURL string `yaml:"cssLightURL"` + CSSDarkURL string `yaml:"cssDarkURL"` + JScriptURL string `yaml:"jScriptURL"` + About AboutYaml `yaml:"about"` + Entries []EntryYaml `yaml:"entries"` +} + +func (dy DataYaml) GetHeaderLabels() []string { + if dy.HeaderLinks == nil { + return []string{} + } + toReturn := make([]string, len(dy.HeaderLinks)) + i := 0 + for key := range dy.HeaderLinks { + toReturn[i] = key + i++ + } + return toReturn +} + +func (dy DataYaml) GetHeaderLink(headerLabel string) string { + if dy.HeaderLinks == nil { + return "" + } + return dy.HeaderLinks[headerLabel] } diff --git a/pageHandler/pages/index/entry.go b/pageHandler/pages/index/entry.go index 06c85bd..749707c 100644 --- a/pageHandler/pages/index/entry.go +++ b/pageHandler/pages/index/entry.go @@ -1,6 +1,7 @@ package index import ( + "golang.captainalm.com/cityuni-webserver/utils/yaml" "html/template" "time" ) @@ -8,14 +9,14 @@ import ( const dateFormat = "2006-01-02" type EntryYaml struct { - Name string `yaml:"name"` - Content string `yaml:"content"` - StartDate time.Time `yaml:"startDate"` - EndDate time.Time `yaml:"endDate"` - VideoLocation string `yaml:"videoLocation"` - VideoContentType string `yaml:"videoContentType"` - ThumbnailLocations []string `yaml:"thumbnailLocations"` - ImageLocations []string `yaml:"imageLocations"` + Name string `yaml:"name"` + Content string `yaml:"content"` + StartDate yaml.DateType `yaml:"startDate"` + EndDate yaml.DateType `yaml:"endDate"` + VideoLocation string `yaml:"videoLocation"` + VideoContentType string `yaml:"videoContentType"` + ThumbnailLocations []string `yaml:"thumbnailLocations"` + ImageLocations []string `yaml:"imageLocations"` } func (ey EntryYaml) GetStartDate() string { @@ -34,7 +35,7 @@ func (ey EntryYaml) GetEndTime() time.Time { if ey.EndDate.IsZero() { return time.Now() } else { - return ey.EndDate + return ey.EndDate.Time } } @@ -43,5 +44,5 @@ func (ey EntryYaml) GetContent() template.HTML { } func (ey EntryYaml) GetDuration() time.Duration { - return ey.GetEndTime().Sub(ey.StartDate).Truncate(time.Second) + return ey.GetEndTime().Sub(ey.StartDate.Time).Truncate(time.Second) } diff --git a/pageHandler/pages/index/index-page.go b/pageHandler/pages/index/index-page.go index bb73fe4..213a12a 100644 --- a/pageHandler/pages/index/index-page.go +++ b/pageHandler/pages/index/index-page.go @@ -17,12 +17,14 @@ const yamlName = "index.go.yml" func NewPage(dataStore string, cacheTemplates bool) *Page { var ptm *sync.Mutex + var sdm *sync.Mutex if cacheTemplates { ptm = &sync.Mutex{} + sdm = &sync.Mutex{} } pageToReturn := &Page{ DataStore: dataStore, - StoredDataMutex: &sync.Mutex{}, + StoredDataMutex: sdm, PageTemplateMutex: ptm, } return pageToReturn diff --git a/pageHandler/pages/index/template-marshal.go b/pageHandler/pages/index/template-marshal.go index afc91a0..82fd730 100644 --- a/pageHandler/pages/index/template-marshal.go +++ b/pageHandler/pages/index/template-marshal.go @@ -15,12 +15,12 @@ func (m Marshal) GetEntries() (toReturn []EntryYaml) { toReturn = m.Data.Entries if m.OrderStartDate > 0 { sort.Slice(toReturn, func(i, j int) bool { - return toReturn[i].StartDate.Before(toReturn[j].StartDate) + return toReturn[i].StartDate.Before(toReturn[j].StartDate.Time) }) } if m.OrderStartDate < 0 { sort.Slice(toReturn, func(i, j int) bool { - return toReturn[i].StartDate.After(toReturn[j].StartDate) + return toReturn[i].StartDate.After(toReturn[j].StartDate.Time) }) } if m.OrderEndDate > 0 { diff --git a/utils/yaml/date-type.go b/utils/yaml/date-type.go new file mode 100644 index 0000000..910cd12 --- /dev/null +++ b/utils/yaml/date-type.go @@ -0,0 +1,31 @@ +package yaml + +import ( + "gopkg.in/yaml.v3" + "strings" + "time" +) + +const dateFormat = "02/01/2006" + +type DateType struct { + time.Time +} + +func (dt *DateType) MarshalYAML() (interface{}, error) { + return dt.Time.Format(dateFormat), nil +} + +func (dt *DateType) UnmarshalYAML(value *yaml.Node) error { + var stringIn string + err := value.Decode(&stringIn) + if err != nil { + return nil + } + pt, err := time.Parse(dateFormat, strings.TrimSpace(stringIn)) + if err != nil { + return err + } + dt.Time = pt + return nil +} -- 2.45.2 From 3d4b229d2dd4cdd4c2720229bb096f5090a8e3a8 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Mon, 25 Jul 2022 15:49:23 +0100 Subject: [PATCH 02/64] Fix edge config. --- Makefile | 1 + index.go.yml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f9d1b66..f487c3b 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ deploy: build sudo systemctl stop wappcityuni sudo cp "${BIN}" /usr/local/bin sudo cp *.go.html cnf + sudo cp *.go.yml cnf sudo cp *.css cdn sudo cp *.js cdn sudo systemctl start wappcityuni diff --git a/index.go.yml b/index.go.yml index 27b69ff..3e580f6 100644 --- a/index.go.yml +++ b/index.go.yml @@ -1,7 +1,7 @@ -cssBaseURL: "http://192.168.1.193:8081/test/base.css" -cssDarkURL: "http://192.168.1.193:8081/test/dark.css" -cssLightURL: "http://192.168.1.193:8081/test/light.css" -jScriptURL: "http://192.168.1.193:8081/test/index.js" +cssBaseURL: "https://cityuni.captainalm.com/resources/assets/base.css" +cssDarkURL: "https://cityuni.captainalm.com/resources/assets/dark.css" +cssLightURL: "https://cityuni.captainalm.com/resources/assets/light.css" +jScriptURL: "https://cityuni.captainalm.com/resources/assets/index.js" headerLinks: Main Portfolio: "https://portfolio.captainalm.com/" Root Site Home: "https://www.captainalm.com/" -- 2.45.2 From 19fca1a26f289804f91aa9587c31abf7ed0e7fc8 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Mon, 25 Jul 2022 21:10:29 +0100 Subject: [PATCH 03/64] Update handling to support internal redirects for index. --- pageHandler/page-handler.go | 83 ++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 34 deletions(-) diff --git a/pageHandler/page-handler.go b/pageHandler/page-handler.go index 87f269a..c222118 100644 --- a/pageHandler/page-handler.go +++ b/pageHandler/page-handler.go @@ -7,13 +7,14 @@ import ( "mime/multipart" "net/http" "net/textproto" - "net/url" "strconv" "strings" "sync" "time" ) +const indexName = "index.go" + type PageHandler struct { PageContentsCache map[string]*CachedPage PageProviders map[string]PageProvider @@ -50,7 +51,16 @@ func NewPageHandler(config conf.ServeYaml) *PageHandler { } func (ph *PageHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { - actualPagePath := strings.TrimRight(request.URL.Path, "/") + actualPagePath := "" + if strings.HasSuffix(request.URL.Path, "/") { + if strings.HasSuffix(request.URL.Path, ".go/") { + actualPagePath = strings.TrimRight(request.URL.Path, "/") + } else { + actualPagePath = request.URL.Path + indexName + } + } else { + actualPagePath = request.URL.Path + } var currentProvider PageProvider canCache := false @@ -64,7 +74,7 @@ func (ph *PageHandler) ServeHTTP(writer http.ResponseWriter, request *http.Reque actualQueries = currentProvider.GetCacheIDExtension(queryValues) if ph.CacheSettings.EnableContentsCaching { - cached := ph.getPageFromCache(request.URL, actualQueries) + cached := ph.getPageFromCache(request.URL.Path, actualQueries) if cached != nil { pageContent = cached.Content pageContentType = cached.ContentType @@ -76,7 +86,7 @@ func (ph *PageHandler) ServeHTTP(writer http.ResponseWriter, request *http.Reque pageContentType, pageContent, canCache = currentProvider.GetContents(queryValues) lastMod = currentProvider.GetLastModified() if pageContentType != "" && canCache && ph.CacheSettings.EnableContentsCaching { - ph.setPageToCache(request.URL, actualQueries, &CachedPage{ + ph.setPageToCache(request.URL.Path, actualQueries, &CachedPage{ Content: pageContent, ContentType: pageContentType, LastMod: lastMod, @@ -143,7 +153,7 @@ func (ph *PageHandler) ServeHTTP(writer http.ResponseWriter, request *http.Reque } } case http.MethodDelete: - ph.PurgeTemplateCache(actualPagePath) + ph.PurgeTemplateCache(actualPagePath, request.URL.Path == "/") ph.PurgeContentsCache(request.URL.Path, actualQueries) utils.SetNeverCacheHeader(writer.Header()) utils.WriteResponseHeaderCanWriteBody(request.Method, writer, http.StatusOK, "") @@ -167,12 +177,12 @@ func (ph *PageHandler) ServeHTTP(writer http.ResponseWriter, request *http.Reque func (ph *PageHandler) PurgeContentsCache(path string, query string) { if ph.CacheSettings.EnableContentsCaching && ph.CacheSettings.EnableContentsCachePurge { - if path == "" { + if path == "/" { ph.pageContentsCacheRWMutex.Lock() ph.PageContentsCache = make(map[string]*CachedPage) ph.pageContentsCacheRWMutex.Unlock() } else { - if strings.HasSuffix(path, "/") { + if strings.HasSuffix(path, ".go/") { ph.pageContentsCacheRWMutex.RLock() toDelete := make([]string, len(ph.PageContentsCache)) theSize := 0 @@ -189,22 +199,24 @@ func (ph *PageHandler) PurgeContentsCache(path string, query string) { delete(ph.PageContentsCache, toDelete[i]) } ph.pageContentsCacheRWMutex.Unlock() - } else { - ph.pageContentsCacheRWMutex.Lock() - if query == "" { - delete(ph.PageContentsCache, path) - } else { - delete(ph.PageContentsCache, path+"?"+query) - } - ph.pageContentsCacheRWMutex.Unlock() + return + } else if strings.HasSuffix(path, "/") { + path += indexName } + ph.pageContentsCacheRWMutex.Lock() + if query == "" { + delete(ph.PageContentsCache, path) + } else { + delete(ph.PageContentsCache, path+"?"+query) + } + ph.pageContentsCacheRWMutex.Unlock() } } } -func (ph *PageHandler) PurgeTemplateCache(path string) { +func (ph *PageHandler) PurgeTemplateCache(path string, all bool) { if ph.CacheSettings.EnableTemplateCaching && ph.CacheSettings.EnableTemplateCachePurge { - if path == "" { + if all { for _, pageProvider := range ph.PageProviders { pageProvider.PurgeTemplate() } @@ -215,36 +227,39 @@ func (ph *PageHandler) PurgeTemplateCache(path string) { } } } -func (ph *PageHandler) getPageFromCache(urlIn *url.URL, cleanedQueries string) *CachedPage { +func (ph *PageHandler) getPageFromCache(pathIn string, cleanedQueries string) *CachedPage { ph.pageContentsCacheRWMutex.RLock() defer ph.pageContentsCacheRWMutex.RUnlock() - if strings.HasSuffix(urlIn.Path, "/") { - return ph.PageContentsCache[strings.TrimRight(urlIn.Path, "/")] + if strings.HasSuffix(pathIn, ".go/") { + return ph.PageContentsCache[strings.TrimRight(pathIn, "/")] + } else if strings.HasSuffix(pathIn, "/") { + pathIn += indexName + } + if cleanedQueries == "" { + return ph.PageContentsCache[pathIn] } else { - if cleanedQueries == "" { - return ph.PageContentsCache[urlIn.Path] - } else { - return ph.PageContentsCache[urlIn.Path+"?"+cleanedQueries] - } + return ph.PageContentsCache[pathIn+"?"+cleanedQueries] } } -func (ph *PageHandler) setPageToCache(urlIn *url.URL, cleanedQueries string, newPage *CachedPage) { +func (ph *PageHandler) setPageToCache(pathIn string, cleanedQueries string, newPage *CachedPage) { ph.pageContentsCacheRWMutex.Lock() defer ph.pageContentsCacheRWMutex.Unlock() - if strings.HasSuffix(urlIn.Path, "/") { - ph.PageContentsCache[strings.TrimRight(urlIn.Path, "/")] = newPage + if strings.HasSuffix(pathIn, ".go/") { + ph.PageContentsCache[strings.TrimRight(pathIn, "/")] = newPage + return + } else if strings.HasSuffix(pathIn, "/") { + pathIn += indexName + } + if cleanedQueries == "" { + ph.PageContentsCache[pathIn] = newPage } else { - if cleanedQueries == "" { - ph.PageContentsCache[urlIn.Path] = newPage - } else { - ph.PageContentsCache[urlIn.Path+"?"+cleanedQueries] = newPage - } + ph.PageContentsCache[pathIn+"?"+cleanedQueries] = newPage } } func (ph *PageHandler) getAllowedMethodsForPath(pathIn string) []string { - if strings.HasSuffix(pathIn, "/") { + if pathIn == "/" || strings.HasSuffix(pathIn, ".go/") { if (ph.CacheSettings.EnableTemplateCaching && ph.CacheSettings.EnableTemplateCachePurge) || (ph.CacheSettings.EnableContentsCaching && ph.CacheSettings.EnableContentsCachePurge) { return []string{http.MethodHead, http.MethodGet, http.MethodOptions, http.MethodDelete} -- 2.45.2 From fe6340e6df5ee15736cef11cc7d15cdbb2e5dad9 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 13:39:26 +0100 Subject: [PATCH 04/64] Add about displaying support. --- base.css | 53 +++++++++++++++++++++++--------- dark.css | 13 ++++++-- index.go.html | 24 ++++++++++++++- pageHandler/pages/index/about.go | 4 ++- 4 files changed, 75 insertions(+), 19 deletions(-) diff --git a/base.css b/base.css index aafc438..12f33ef 100644 --- a/base.css +++ b/base.css @@ -14,7 +14,6 @@ main{ list-style: none; } .header{ - box-shadow: 1px 1px 5px 0px; position: fixed; top: 0; width: 100%; @@ -48,7 +47,6 @@ main{ height: 2px; position: relative; width: 24px; - } .hmb-line::before, .hmb-line::after{ content: ''; @@ -78,15 +76,43 @@ main{ transform: rotate(45deg); top:0; } -.flex-main{ - display: flex; - flex-direction: column; +.main-table{ + display: table; + width: 100%; } -.box-main{ - display: table; - width: 100%; - margin: 1px; - align-self: center; +.main-table > div{ + display: table-row; + background-color: transparent; +} +.main-table > div > div{ + display: table-cell; + padding: 3px 0; + border-style: solid; + border-width: 1px; +} +.item-table{ + display: table; + width: 100%; + background-color: transparent; +} +.item-table > div{ + display: table-row; + background-color: transparent; +} +.item-table-full, .item-table-half, .item-table-480{ + display: table-cell; + border-style: solid; + border-width: 1px; + background-color: transparent; +} +.item-table-full{ + width: 100%; +} +.item-table-half{ + width: 50%; +} +.item-table-480{ + width: 480px; } @media (min-width: 480px){ .nav{ @@ -101,12 +127,11 @@ main{ } .menu a:hover{ background-color: transparent; - } .hmb{ display: none; } - .box-main{ - margin: 5px 10px; - } + .main-table > div > div{ + padding: 5px; + } } \ No newline at end of file diff --git a/dark.css b/dark.css index bd03de0..3d1b1a8 100644 --- a/dark.css +++ b/dark.css @@ -12,9 +12,6 @@ body{ .home-button:hover{ background-color: #606061; } -.header{ - box-shadow-color: #696969; -} .menu a{ color: #e0e0e0; } @@ -26,4 +23,14 @@ body{ } .hmb-line, .hmb-line::before, .hmb-line::after{ background: #e0e0e0; +} +.main-table{ + border-color: wheat; + background-color: #1d1d1e; +} +.main-table > div > div{ + border-color: wheat; +} +.item-table > div > div{ + border-color: whitesmoke; } \ No newline at end of file diff --git a/index.go.html b/index.go.html index 70e44d2..4386a12 100644 --- a/index.go.html +++ b/index.go.html @@ -26,7 +26,29 @@ -
+
+
+
+
+
+
+

{{ .Data.About.Title }}

+
+ +
+
+
+ {{ .Data.About.GetContent }} +
+
+ Image of Me. +
+
+
+
+
\ No newline at end of file diff --git a/pageHandler/pages/index/about.go b/pageHandler/pages/index/about.go index 4379299..fa31baa 100644 --- a/pageHandler/pages/index/about.go +++ b/pageHandler/pages/index/about.go @@ -2,6 +2,8 @@ package index import ( "html/template" + "strconv" + "strings" "time" ) @@ -15,7 +17,7 @@ type AboutYaml struct { } func (ay AboutYaml) GetContent() template.HTML { - return template.HTML(ay.Content) + return template.HTML(strings.ReplaceAll(strings.ReplaceAll(ay.Content, "#age#", strconv.Itoa(ay.GetAge())), "#birth#", strconv.Itoa(ay.BirthYear))) } func (ay AboutYaml) GetAge() int { -- 2.45.2 From f70b826e517375538c38345b0c88eb9b565812e2 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 13:42:11 +0100 Subject: [PATCH 05/64] Add yml data. --- index.go.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.go.yml b/index.go.yml index 3e580f6..a37300d 100644 --- a/index.go.yml +++ b/index.go.yml @@ -8,4 +8,12 @@ headerLinks: Github: "https://github.com/Captain-ALM/" about: title: "Alfred Manville (Captain ALM)" + content: > +

test

+

#age#

+

#birth#

+ thumbnailLocation: "https://cityuni.captainalm.com/resources/assets/imageofyou.jpg" + imageLocation: "https://cityuni.captainalm.com/resources/assets/imageofyou.jpg" + birthYear: 2002 + contactEmail: "alfred@captainalm.com" entries: -- 2.45.2 From 4dc4abf229adc0e759c8c435f73362ebd3ddd390 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 14:59:09 +0100 Subject: [PATCH 06/64] . --- base.css | 2 ++ index.go.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base.css b/base.css index 12f33ef..54e0348 100644 --- a/base.css +++ b/base.css @@ -89,6 +89,7 @@ main{ padding: 3px 0; border-style: solid; border-width: 1px; + vertical-align: top; } .item-table{ display: table; @@ -104,6 +105,7 @@ main{ border-style: solid; border-width: 1px; background-color: transparent; + vertical-align: top; } .item-table-full{ width: 100%; diff --git a/index.go.html b/index.go.html index 4386a12..3ffe482 100644 --- a/index.go.html +++ b/index.go.html @@ -35,7 +35,7 @@

{{ .Data.About.Title }}

-- 2.45.2 From cf0e2186e509f8c89c01d6ac8b1b55ced1d13c27 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 15:02:07 +0100 Subject: [PATCH 07/64] . --- base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base.css b/base.css index 54e0348..a563e8e 100644 --- a/base.css +++ b/base.css @@ -89,7 +89,7 @@ main{ padding: 3px 0; border-style: solid; border-width: 1px; - vertical-align: top; + vertical-align: middle; } .item-table{ display: table; -- 2.45.2 From 0212c870c4fb5d308eca41339ef5fc2df69a6031 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 15:06:26 +0100 Subject: [PATCH 08/64] . --- base.css | 10 +++++----- dark.css | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base.css b/base.css index a563e8e..a122cef 100644 --- a/base.css +++ b/base.css @@ -86,7 +86,7 @@ main{ } .main-table > div > div{ display: table-cell; - padding: 3px 0; + margin: 3px 0; border-style: solid; border-width: 1px; vertical-align: middle; @@ -113,9 +113,6 @@ main{ .item-table-half{ width: 50%; } -.item-table-480{ - width: 480px; -} @media (min-width: 480px){ .nav{ max-height: none; @@ -134,6 +131,9 @@ main{ display: none; } .main-table > div > div{ - padding: 5px; + margin: 5px; + } + .item-table-480{ + width: 480px; } } \ No newline at end of file diff --git a/dark.css b/dark.css index 3d1b1a8..c7165ce 100644 --- a/dark.css +++ b/dark.css @@ -26,7 +26,7 @@ body{ } .main-table{ border-color: wheat; - background-color: #1d1d1e; + background-color: #4f4f4f; } .main-table > div > div{ border-color: wheat; -- 2.45.2 From 764b9d3239b832c630a789167304c7417417acdf Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 15:11:19 +0100 Subject: [PATCH 09/64] . --- base.css | 11 +++++------ index.go.html | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/base.css b/base.css index a122cef..deb3a1f 100644 --- a/base.css +++ b/base.css @@ -87,6 +87,7 @@ main{ .main-table > div > div{ display: table-cell; margin: 3px 0; + padding: 3px 0; border-style: solid; border-width: 1px; vertical-align: middle; @@ -100,7 +101,7 @@ main{ display: table-row; background-color: transparent; } -.item-table-full, .item-table-half, .item-table-480{ +.item-table-full, .item-table-half, .item-table-240{ display: table-cell; border-style: solid; border-width: 1px; @@ -110,8 +111,8 @@ main{ .item-table-full{ width: 100%; } -.item-table-half{ - width: 50%; +.item-table-240{ + width: 240px; } @media (min-width: 480px){ .nav{ @@ -131,9 +132,7 @@ main{ display: none; } .main-table > div > div{ + padding: 5px; margin: 5px; } - .item-table-480{ - width: 480px; - } } \ No newline at end of file diff --git a/index.go.html b/index.go.html index 3ffe482..78982ae 100644 --- a/index.go.html +++ b/index.go.html @@ -42,8 +42,8 @@
{{ .Data.About.GetContent }}
-
- Image of Me. +
+ Image of Me.
-- 2.45.2 From 1df8a6646eb103d4a6c3a9d20b4fc905a6ad220b Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 15:15:21 +0100 Subject: [PATCH 10/64] . --- base.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/base.css b/base.css index deb3a1f..1ad7f64 100644 --- a/base.css +++ b/base.css @@ -78,7 +78,6 @@ main{ } .main-table{ display: table; - width: 100%; } .main-table > div{ display: table-row; @@ -94,7 +93,6 @@ main{ } .item-table{ display: table; - width: 100%; background-color: transparent; } .item-table > div{ -- 2.45.2 From 42a239ddd4953ddf43437cc3f5cbb79c07758be3 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 16:41:11 +0100 Subject: [PATCH 11/64] . --- base.css | 19 +++++++++++++++---- dark.css | 2 +- index.go.html | 30 ++++++++++++++++-------------- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/base.css b/base.css index 1ad7f64..b810273 100644 --- a/base.css +++ b/base.css @@ -78,26 +78,33 @@ main{ } .main-table{ display: table; + box-sizing: content-box; } .main-table > div{ display: table-row; background-color: transparent; + box-sizing: inherit; } .main-table > div > div{ display: table-cell; - margin: 3px 0; - padding: 3px 0; border-style: solid; border-width: 1px; vertical-align: middle; + box-sizing: inherit; +} +.main-table > div > div > div{ + margin: 3px 0; + box-sizing: inherit; } .item-table{ display: table; + box-sizing: content-box; background-color: transparent; } .item-table > div{ display: table-row; background-color: transparent; + box-sizing: inherit; } .item-table-full, .item-table-half, .item-table-240{ display: table-cell; @@ -105,10 +112,14 @@ main{ border-width: 1px; background-color: transparent; vertical-align: top; + box-sizing: inherit; } .item-table-full{ width: 100%; } +.item-table-half{ + width: 100%; +} .item-table-240{ width: 240px; } @@ -129,8 +140,8 @@ main{ .hmb{ display: none; } - .main-table > div > div{ - padding: 5px; + .main-table > div > div > div{ margin: 5px; + box-sizing: inherit; } } \ No newline at end of file diff --git a/dark.css b/dark.css index c7165ce..58b218c 100644 --- a/dark.css +++ b/dark.css @@ -26,7 +26,7 @@ body{ } .main-table{ border-color: wheat; - background-color: #4f4f4f; + background-color: #0f0f0f; } .main-table > div > div{ border-color: wheat; diff --git a/index.go.html b/index.go.html index 78982ae..fe10c41 100644 --- a/index.go.html +++ b/index.go.html @@ -29,21 +29,23 @@
-
-
-
-

{{ .Data.About.Title }}

+
+
+
+
+

{{ .Data.About.Title }}

+
+
- -
-
-
- {{ .Data.About.GetContent }} -
-
- Image of Me. +
+
+
{{ .Data.About.GetContent }}
+
+
+
Image of Me.
+
-- 2.45.2 From f7e19d597b8e5826594a5b50e9d608658e7f41d7 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 16:42:32 +0100 Subject: [PATCH 12/64] . --- base.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base.css b/base.css index b810273..8922e3f 100644 --- a/base.css +++ b/base.css @@ -78,6 +78,7 @@ main{ } .main-table{ display: table; + width: 100%; box-sizing: content-box; } .main-table > div{ @@ -98,6 +99,7 @@ main{ } .item-table{ display: table; + width: 100%; box-sizing: content-box; background-color: transparent; } @@ -118,7 +120,7 @@ main{ width: 100%; } .item-table-half{ - width: 100%; + width: 50%; } .item-table-240{ width: 240px; -- 2.45.2 From b9fd027a9f80f0779bf49dc23b2f16097617ca63 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 16:51:26 +0100 Subject: [PATCH 13/64] . --- base.css | 2 +- dark.css | 3 +++ index.go.html | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/base.css b/base.css index 8922e3f..7421340 100644 --- a/base.css +++ b/base.css @@ -99,7 +99,7 @@ main{ } .item-table{ display: table; - width: 100%; + width: 90%; box-sizing: content-box; background-color: transparent; } diff --git a/dark.css b/dark.css index 58b218c..627f2ea 100644 --- a/dark.css +++ b/dark.css @@ -3,6 +3,9 @@ body{ background-color: #050506; border-color: #696969; } +a{ + color: #9090f0; +} .header, .nav{ background-color: #1d1d1e; } diff --git a/index.go.html b/index.go.html index fe10c41..7a48da3 100644 --- a/index.go.html +++ b/index.go.html @@ -36,7 +36,7 @@

{{ .Data.About.Title }}

-- 2.45.2 From c45ad785606cfb193db676619ec7673d5fbefda3 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 16:55:17 +0100 Subject: [PATCH 14/64] . --- base.css | 4 ++-- dark.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base.css b/base.css index 7421340..c4aee04 100644 --- a/base.css +++ b/base.css @@ -78,7 +78,7 @@ main{ } .main-table{ display: table; - width: 100%; + width: 95%; box-sizing: content-box; } .main-table > div{ @@ -99,7 +99,7 @@ main{ } .item-table{ display: table; - width: 90%; + width: 95%; box-sizing: content-box; background-color: transparent; } diff --git a/dark.css b/dark.css index 627f2ea..d8ee208 100644 --- a/dark.css +++ b/dark.css @@ -4,7 +4,7 @@ body{ border-color: #696969; } a{ - color: #9090f0; + color: #b0b0f0; } .header, .nav{ background-color: #1d1d1e; -- 2.45.2 From a41b07c58c20610fdcdbc2a4ae516bfafd654004 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 16:58:24 +0100 Subject: [PATCH 15/64] . --- base.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base.css b/base.css index c4aee04..152481b 100644 --- a/base.css +++ b/base.css @@ -78,7 +78,7 @@ main{ } .main-table{ display: table; - width: 95%; + width: 100%; box-sizing: content-box; } .main-table > div{ @@ -95,11 +95,12 @@ main{ } .main-table > div > div > div{ margin: 3px 0; + padding: 2px; box-sizing: inherit; } .item-table{ display: table; - width: 95%; + width: 100%; box-sizing: content-box; background-color: transparent; } @@ -144,6 +145,5 @@ main{ } .main-table > div > div > div{ margin: 5px; - box-sizing: inherit; } } \ No newline at end of file -- 2.45.2 From 3ffbee52af972848c6597e8b4ecf9fe669132596 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 17:05:24 +0100 Subject: [PATCH 16/64] . --- base.css | 6 ++++++ index.go.html | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/base.css b/base.css index 152481b..91c1cc7 100644 --- a/base.css +++ b/base.css @@ -13,6 +13,12 @@ main{ .no-lst-style{ list-style: none; } +.centered{ + text-align: center; +} +.padded-2px{ + padding: 2px; +} .header{ position: fixed; top: 0; diff --git a/index.go.html b/index.go.html index 7a48da3..8c4bf76 100644 --- a/index.go.html +++ b/index.go.html @@ -32,16 +32,16 @@
-
-

{{ .Data.About.Title }}

+
+

{{ .Data.About.Title }}

-
-
{{ .Data.About.GetContent }}
+
{{ .Data.About.GetContent }}
Image of Me.
-- 2.45.2 From d8d509c0016e8ced0dd9528b9bb506cd523d1411 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 17:29:22 +0100 Subject: [PATCH 17/64] Add entries. --- base.css | 21 ++++++++++++--------- index.go.html | 28 ++++++++++++++++++++++++++++ index.go.yml | 29 +++++++++++++++++++++++++++++ pageHandler/pages/index/entry.go | 2 +- 4 files changed, 70 insertions(+), 10 deletions(-) diff --git a/base.css b/base.css index 91c1cc7..26e6769 100644 --- a/base.css +++ b/base.css @@ -115,8 +115,7 @@ main{ background-color: transparent; box-sizing: inherit; } -.item-table-full, .item-table-half, .item-table-240{ - display: table-cell; +.item-table-full, .item-table-240{ border-style: solid; border-width: 1px; background-color: transparent; @@ -124,13 +123,20 @@ main{ box-sizing: inherit; } .item-table-full{ + display: table-cell; width: 100%; } -.item-table-half{ - width: 50%; -} .item-table-240{ - width: 240px; + display: none; +} +@media (min-width: 320px){ + .main-table > div > div > div{ + margin: 5px; + } + .item-table-240{ + display: table-cell; + width: 240px; + } } @media (min-width: 480px){ .nav{ @@ -149,7 +155,4 @@ main{ .hmb{ display: none; } - .main-table > div > div > div{ - margin: 5px; - } } \ No newline at end of file diff --git a/index.go.html b/index.go.html index 8c4bf76..5d0808b 100644 --- a/index.go.html +++ b/index.go.html @@ -51,6 +51,34 @@
+ {{ range .Data.Entries }} +
+
+
+
+
+
+

{{ .Name }}

+
+
+

{{ .GetStartDate }} - {{ .GetEndDate }}

+
+
+
+
+
{{ .GetContent }}
+
+
+
+
+
+
+
+
+
+ {{ end }}
\ No newline at end of file diff --git a/index.go.yml b/index.go.yml index a37300d..1dbd51c 100644 --- a/index.go.yml +++ b/index.go.yml @@ -17,3 +17,32 @@ about: birthYear: 2002 contactEmail: "alfred@captainalm.com" entries: + - name: "Bootcamp 2021: Ninjaformer GUI" + content: > +

+ My first programming task at City, concluding the 2 week 2021 Programming Bootcamp, + although I have only spent 3 days programming this and was a tad bit too ambitious. + This Processing project show that I can use arrays, loops, mouse and keyboard interaction and geometric transforms. + The project contains a GUI library that I made to create the menu system for my ninjaformer game, + unfortunately, while the code for loading tile, sprite and level information exists (JSON, sprite sheet support), + I ran out of time before the submission to actually even start on the game. But you can play around with the main code and build your own GUIs too so... +

+ startDate: "01/10/2021" + endDate: "31/10/2021" + videoLocation: "https://cityuni.captainalm.com/resources/stream/vid1.mp4" + videoContentType: "video/mp4" + - name: "City Game Project 2022: Ninjaformer (Alpha, Beta)" + content: > +

+ My third programming task and first major project at City, concluding 2.2 Months of programming. + Looking back on this, I wish I started earlier (Like January) that way I could have implemented all the features I wanted. + This project allows for levels to be designed within the program and allows them to be edited as XML outside the program. + The code is extensible and it is relatively straight forward to impliment new features. There are a few bugs that can crop up + (Such as sticking to surfaces due to ground body updates) but I already know ways to fix them. + This project relies on part of a GUI library I built in it and I had to modify the CityGame library by extending it. + The audio and assets were also created by me. +

+ startDate: "25/02/2021" + endDate: "08/05/2022" + videoLocation: "https://cityuni.captainalm.com/resources/stream/vid2.mp4" + videoContentType: "video/mp4" diff --git a/pageHandler/pages/index/entry.go b/pageHandler/pages/index/entry.go index 749707c..e11b9a1 100644 --- a/pageHandler/pages/index/entry.go +++ b/pageHandler/pages/index/entry.go @@ -6,7 +6,7 @@ import ( "time" ) -const dateFormat = "2006-01-02" +const dateFormat = "2006-01" type EntryYaml struct { Name string `yaml:"name"` -- 2.45.2 From 8f35dc92cf3595ad8ec8d2ab699a462ddc961e91 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 17:35:13 +0100 Subject: [PATCH 18/64] . --- base.css | 15 ++++++++------- index.go.html | 16 ++++++++++------ pageHandler/pages/index/entry.go | 2 +- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/base.css b/base.css index 26e6769..096ccf1 100644 --- a/base.css +++ b/base.css @@ -115,30 +115,31 @@ main{ background-color: transparent; box-sizing: inherit; } -.item-table-full, .item-table-240{ +.item-table-full, .item-table-360{ border-style: solid; border-width: 1px; background-color: transparent; - vertical-align: top; box-sizing: inherit; } .item-table-full{ display: table-cell; + vertical-align: top; width: 100%; } -.item-table-240{ +.item-table-360{ display: none; } -@media (min-width: 320px){ +@media (min-width: 360px){ .main-table > div > div > div{ margin: 5px; } - .item-table-240{ + .item-table-360{ display: table-cell; - width: 240px; + vertical-align: middle; + width: 360px; } } -@media (min-width: 480px){ +@media (min-width: 570px){ .nav{ max-height: none; top: 0; diff --git a/index.go.html b/index.go.html index 5d0808b..30ba6c4 100644 --- a/index.go.html +++ b/index.go.html @@ -35,7 +35,7 @@

{{ .Data.About.Title }}

- @@ -43,8 +43,8 @@
{{ .Data.About.GetContent }}
-
-
Image of Me.
+
+
Image of Me.
@@ -60,16 +60,20 @@

{{ .Name }}

-
+
+ {{ if eq .GetStartDate .GetEndDate }} +

{{ .GetStartDate }}

+ {{ else }}

{{ .GetStartDate }} - {{ .GetEndDate }}

+ {{ end }}
{{ .GetContent }}
-
-
+
+
+
{{ .GetContent }}
+
+
-- 2.45.2 From f6711bd7f322e43e84b7c4f842fc5050c4414482 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 18:00:40 +0100 Subject: [PATCH 21/64] . --- base.css | 11 +++++++++++ index.go.html | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/base.css b/base.css index 1285c12..3baf2d5 100644 --- a/base.css +++ b/base.css @@ -127,6 +127,17 @@ main{ .item-table-360{ display: none; } +.item-table-span{ + position: absolute; + left: 0; +} +.item-table-dummy{ + display: table-cell; + vertical-align: top; + border-color: transparent; + background-color: transparent; + box-sizing: inherit; +} @media (min-width: 480px){ .main-table > div > div > div{ margin: 5px; diff --git a/index.go.html b/index.go.html index 7be5c8d..ef9c5a9 100644 --- a/index.go.html +++ b/index.go.html @@ -79,7 +79,8 @@
-
+
+
{{ .GetContent }}
-- 2.45.2 From c148e71e7dcc8ab6f0603b17fa46214c09049b08 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 19:49:32 +0100 Subject: [PATCH 22/64] . --- base.css | 27 +++++++++++++++++---------- index.go.html | 17 +++++++++++------ index.go.yml | 16 ++++++++++++++++ pageHandler/pages/index/entry.go | 21 +++++++++++++++++++++ 4 files changed, 65 insertions(+), 16 deletions(-) diff --git a/base.css b/base.css index 3baf2d5..663ade6 100644 --- a/base.css +++ b/base.css @@ -127,16 +127,23 @@ main{ .item-table-360{ display: none; } -.item-table-span{ - position: absolute; - left: 0; -} -.item-table-dummy{ - display: table-cell; - vertical-align: top; - border-color: transparent; - background-color: transparent; - box-sizing: inherit; +.image-box{ + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-box-orient: horizontal; + -moz-box-orient: horizontal; + -webkit-box-direction: normal; + -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){ .main-table > div > div > div{ diff --git a/index.go.html b/index.go.html index ef9c5a9..ee286a1 100644 --- a/index.go.html +++ b/index.go.html @@ -78,16 +78,21 @@
-
-
-
-
{{ .GetContent }}
-
-
+ {{ if not (eq .GetImageCount 0) }} +
+
+
+ {{ range .GetImages }} + + {{ end }} +
+
+
+ {{ end }} {{ end }}
diff --git a/index.go.yml b/index.go.yml index 5042352..8bced32 100644 --- a/index.go.yml +++ b/index.go.yml @@ -38,6 +38,14 @@ entries: endDate: "31/10/2021" videoLocation: "https://cityuni.captainalm.com/resources/stream/vid1.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)" content: >

@@ -60,3 +68,11 @@ entries: endDate: "08/05/2022" videoLocation: "https://cityuni.captainalm.com/resources/stream/vid2.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" diff --git a/pageHandler/pages/index/entry.go b/pageHandler/pages/index/entry.go index 8104f86..9a72e8e 100644 --- a/pageHandler/pages/index/entry.go +++ b/pageHandler/pages/index/entry.go @@ -3,6 +3,7 @@ package index import ( "golang.captainalm.com/cityuni-webserver/utils/yaml" "html/template" + "math" "time" ) @@ -19,6 +20,11 @@ type EntryYaml struct { ImageLocations []string `yaml:"imageLocations"` } +type ImageReference struct { + ThumbnailLocation string + ImageLocation string +} + func (ey EntryYaml) GetStartDate() string { return ey.StartDate.Format(dateFormat) } @@ -46,3 +52,18 @@ func (ey EntryYaml) GetContent() template.HTML { func (ey EntryYaml) GetDuration() time.Duration { 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 +} -- 2.45.2 From 24278e6e08f33b4d46ed4d5e0cacc1db64f66552 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 19:50:32 +0100 Subject: [PATCH 23/64] Fix index config. --- index.go.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.go.yml b/index.go.yml index 8bced32..1337c89 100644 --- a/index.go.yml +++ b/index.go.yml @@ -72,7 +72,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" - 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" + 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" -- 2.45.2 From 6edc487643c8c0caa0aab7d2242d5c8f47ff693e Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 20:45:37 +0100 Subject: [PATCH 24/64] . --- base.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/base.css b/base.css index 663ade6..7ab5dad 100644 --- a/base.css +++ b/base.css @@ -143,7 +143,11 @@ main{ -ms-flex-wrap: wrap; -webkit-flex-wrap: wrap; flex-wrap: wrap; - align-items: center; + -webkit-justify-content: center; + justify-content: center; +} +.image-box > a{ + margin: 2px; } @media (min-width: 480px){ .main-table > div > div > div{ @@ -154,6 +158,9 @@ main{ vertical-align: middle; width: 360px; } + .image-box > a{ + margin: 10px; + } } @media (min-width: 600px){ .nav{ -- 2.45.2 From e8aeb2c1f7716a6502e355f0fc60e3d1ef3b38c7 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 21:11:53 +0100 Subject: [PATCH 25/64] . --- base.css | 9 ++++++++- dark.css | 5 ++++- index.go.html | 20 +++++++++----------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/base.css b/base.css index 7ab5dad..ba6e6b1 100644 --- a/base.css +++ b/base.css @@ -113,6 +113,10 @@ main{ background-color: transparent; box-sizing: inherit; } +.item-table-caption{ + display: table-caption; + caption-side: bottom; +} .item-table-full, .item-table-360{ border-style: solid; border-width: 1px; @@ -147,6 +151,8 @@ main{ justify-content: center; } .image-box > a{ + border-style: solid; + border-width: 1px; margin: 2px; } @media (min-width: 480px){ @@ -159,6 +165,7 @@ main{ width: 360px; } .image-box > a{ + border-width: 4px; margin: 10px; } } @@ -168,7 +175,7 @@ main{ top: 0; position: relative; float: right; - width: fit-content; + width: auto; } .menu li{ float: left; diff --git a/dark.css b/dark.css index 37e7e46..b1a210c 100644 --- a/dark.css +++ b/dark.css @@ -31,5 +31,8 @@ a{ background-color: #0f0f0f; } .item-table > div > div{ - border-color: wheat; + border-color: #F5DEB3FF; +} +.image-box > a{ + border-color: #b0b0f0; } \ No newline at end of file diff --git a/index.go.html b/index.go.html index ee286a1..bd7e2f5 100644 --- a/index.go.html +++ b/index.go.html @@ -78,21 +78,19 @@ + {{ if not (eq .GetImageCount 0) }} +

+
+ {{ range .GetImages }} + + {{ end }} +
+
+ {{ end }} - {{ if not (eq .GetImageCount 0) }} -
-
-
- {{ range .GetImages }} - - {{ end }} -
-
-
- {{ end }} {{ end }} -- 2.45.2 From eee1530ca64f0911b33f306415396001e72cf99f Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 21:15:37 +0100 Subject: [PATCH 26/64] . --- base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base.css b/base.css index ba6e6b1..ba99b36 100644 --- a/base.css +++ b/base.css @@ -117,7 +117,7 @@ main{ display: table-caption; caption-side: bottom; } -.item-table-full, .item-table-360{ +.item-table-full, .item-table-360, .item-table-caption{ border-style: solid; border-width: 1px; background-color: transparent; -- 2.45.2 From 1fce0a6cf458bac999e0b0c4bfeec415ad34806c Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 21:23:15 +0100 Subject: [PATCH 27/64] . --- base.css | 6 +++--- dark.css | 2 +- index.go.html | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/base.css b/base.css index ba99b36..0270cbd 100644 --- a/base.css +++ b/base.css @@ -16,9 +16,6 @@ main{ .centered{ text-align: center; } -.padded-2px{ - padding: 2px; -} .header{ position: fixed; top: 0; @@ -113,6 +110,9 @@ main{ background-color: transparent; box-sizing: inherit; } +.item-table > div > div > div{ + padding: 2px; +} .item-table-caption{ display: table-caption; caption-side: bottom; diff --git a/dark.css b/dark.css index b1a210c..cabd55b 100644 --- a/dark.css +++ b/dark.css @@ -30,7 +30,7 @@ a{ .main-table{ background-color: #0f0f0f; } -.item-table > div > div{ +.item-table > div > div, .item-table-caption{ border-color: #F5DEB3FF; } .image-box > a{ diff --git a/index.go.html b/index.go.html index bd7e2f5..ddef6ce 100644 --- a/index.go.html +++ b/index.go.html @@ -33,15 +33,15 @@
-

{{ .Data.About.Title }}

+

{{ .Data.About.Title }}

-
{{ .Data.About.GetContent }}
+
{{ .Data.About.GetContent }}
Image of Me.
@@ -58,19 +58,19 @@
-

{{ .Name }}

+

{{ .Name }}

{{ if eq .GetStartDate .GetEndDate }} -

{{ .GetStartDate }}

+

{{ .GetStartDate }}

{{ else }} -

{{ .GetStartDate }} - {{ .GetEndDate }}

+

{{ .GetStartDate }} - {{ .GetEndDate }}

{{ end }}
-
{{ .GetContent }}
+
{{ .GetContent }}
{{ end }} +
+

+ Looking for the old static HTML page, here's the link. +

+
\ No newline at end of file diff --git a/light.css b/light.css new file mode 100644 index 0000000..3871dea --- /dev/null +++ b/light.css @@ -0,0 +1,35 @@ +body{ + color: #060606; + background-color: #fafaf9; + border-color: #969696; +} +a{ + color: #4f4fff; +} +.header, .nav, footer{ + background-color: #e2e2e1; +} +.home-button, .menu a{ + color: #1f1f1f; +} +.home-button:hover, .menu a:hover, .hmb:hover{ + background-color: #9f9f9e; +} +.hmb-line, .hmb-line::before, .hmb-line::after{ + background: #1f1f1f; +} +.main-box{ + background-color: #f0f0f0; +} +.item-table{ + background-color: #c0c0c0; +} +.item-table > div > div, .item-table-caption{ + border-color: #0a214c; +} +.image-box{ + background-color: #b0b0b0; +} +.image-box > a{ + border-color: #4f4f0f; +} \ No newline at end of file -- 2.45.2 From eecf2e9a70828088f5d203e8dbba310042f45839 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 27 Jul 2022 00:34:40 +0100 Subject: [PATCH 32/64] Add theme switch. --- index.go.html | 10 ++++++++++ pageHandler/pages/index/index-page.go | 21 +++++++++++++++------ pageHandler/pages/index/template-marshal.go | 1 + 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/index.go.html b/index.go.html index 57aa812..31a19ec 100644 --- a/index.go.html +++ b/index.go.html @@ -15,7 +15,17 @@
+ {{ if .Light }} + + + {{ else }} + {{ if eq .Parameters "" }} + + {{ else }} + + {{ end }} + {{ end }}
{{ end }}
+
{{ .GetInt64Duration }}
{{ end }} diff --git a/light.css b/light.css index 26825a8..982c14c 100644 --- a/light.css +++ b/light.css @@ -12,7 +12,7 @@ a{ .home-button > div, .menu a{ color: #1f1f1f; } -.home-button:hover, .menu a:hover, .hmb:hover{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button div, .sort-menu:checked ~ .sort-button div{ background-color: #9f9f9e; } .hmb-line, .hmb-line::before, .hmb-line::after{ diff --git a/pageHandler/pages/index/entry.go b/pageHandler/pages/index/entry.go index 881db5a..f129589 100644 --- a/pageHandler/pages/index/entry.go +++ b/pageHandler/pages/index/entry.go @@ -55,6 +55,10 @@ func (ey EntryYaml) GetDuration() time.Duration { return ey.GetEndTime().Sub(ey.StartDate.Time).Truncate(time.Second) } +func (ey EntryYaml) GetInt64Duration() int64 { + return int64(ey.GetDuration()) +} + func (ey EntryYaml) GetImageCount() int { return int(math.Min(math.Min(float64(len(ey.ThumbnailLocations)), float64(len(ey.ImageLocations))), float64(len(ey.ImageAltTexts)))) } -- 2.45.2 From 8b4b3b5ff029b98cb5f61115f9421c5b6c5e7a9c Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 27 Jul 2022 12:00:32 +0100 Subject: [PATCH 42/64] . --- dark.css | 4 ++-- light.css | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dark.css b/dark.css index f408aa8..a0f44e5 100644 --- a/dark.css +++ b/dark.css @@ -9,10 +9,10 @@ a{ .header, .nav, footer{ background-color: #1d1d1e; } -.home-button > div, .menu a{ +.home-button > div, .sort-button > div, .menu a{ color: #e0e0e0; } -.home-button:hover, .menu a:hover, .hmb:hover, .sort-button div, .sort-menu:checked ~ .sort-button div{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button{ background-color: #606061; } .hmb-line, .hmb-line::before, .hmb-line::after{ diff --git a/light.css b/light.css index 982c14c..993aabe 100644 --- a/light.css +++ b/light.css @@ -9,10 +9,10 @@ a{ .header, .nav, footer{ background-color: #e2e2e1; } -.home-button > div, .menu a{ +.home-button > div, .sort-button > div, .menu a{ color: #1f1f1f; } -.home-button:hover, .menu a:hover, .hmb:hover, .sort-button div, .sort-menu:checked ~ .sort-button div{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button{ background-color: #9f9f9e; } .hmb-line, .hmb-line::before, .hmb-line::after{ -- 2.45.2 From 560650644b202f2def4444d8d169b405f2607693 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 27 Jul 2022 12:11:34 +0100 Subject: [PATCH 43/64] . --- base.css | 7 +++++++ index.go.html | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/base.css b/base.css index 1df1e06..456cfb7 100644 --- a/base.css +++ b/base.css @@ -16,6 +16,10 @@ main{ .centered{ text-align: center; } +.content > p{ + margin-top: 0.5em; + margin-bottom: 0.5em; +} .header{ position: fixed; top: 0; @@ -28,6 +32,9 @@ main{ overflow: hidden; text-align: center; } +.sort-button{ + cursor: pointer; +} .home-button > div, .sort-button > div{ display: inline; font-size: 60px; diff --git a/index.go.html b/index.go.html index f61034e..fe84abf 100644 --- a/index.go.html +++ b/index.go.html @@ -50,7 +50,7 @@
-
+
{{ .Data.About.GetContent }}
@@ -75,7 +75,7 @@
-
+
{{ .GetContent }}
-- 2.45.2 From a9b224026ceb2d7a258347eca543ba6204644cad Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 27 Jul 2022 12:14:33 +0100 Subject: [PATCH 44/64] . --- index.go.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.go.html b/index.go.html index fe84abf..7fc3bb9 100644 --- a/index.go.html +++ b/index.go.html @@ -50,8 +50,8 @@
-
-
{{ .Data.About.GetContent }}
+
+
{{ .Data.About.GetContent }}
{{ .Data.About.ImageAltText }}
@@ -75,8 +75,8 @@
-
-
{{ .GetContent }}
+
+
{{ .GetContent }}
-
+
+ {{ if eq .VideoLocation "" }} + No Video + {{ else }} + + {{ end } +
{{ if not (eq .GetImageCount 0) }} diff --git a/index.go.yml b/index.go.yml index b4d9924..8730a80 100644 --- a/index.go.yml +++ b/index.go.yml @@ -2,6 +2,7 @@ cssBaseURL: "https://cityuni.captainalm.com/resources/assets/base.css" cssDarkURL: "https://cityuni.captainalm.com/resources/assets/dark.css" cssLightURL: "https://cityuni.captainalm.com/resources/assets/light.css" jScriptURL: "https://cityuni.captainalm.com/resources/assets/index.js" +noVideoImageLocation: "https://cityuni.captainalm.com/resources/assets/novideo.png" headerLinks: Main Portfolio: "https://portfolio.captainalm.com/" Root Site Home: "https://www.captainalm.com/" @@ -9,10 +10,37 @@ headerLinks: about: title: "Alfred Manville (Captain ALM)" content: > -

test

-

#age#

-

#birth#

- thumbnailLocation: "https://cityuni.captainalm.com/resources/assets/imageofyou.jpg" +

+ Hello, I'm Alfred Manville (#age# Years Old). + I'm a free and open-source developer who enjoys networking my laptops together, + writes network software to communicate between them and then tries to break said software. + I also have a Youtube Channel which is in the process of being resumed from a hiatus. +

+

+ On the programming side, I know Visual Basic .net, C# .net, C, Java, Go, Javascript (Circa. 2000), Processing and Microsoft Smallbasic + (I have also dabbled in C++, Python and Bash/Batch). + I am currently in the progress of writing infrastructure software in Go, in the past, I wrote a command console in VB .net for my own + pluggable libraries (I created a CMD emulator to get past the school disabling interactive CMD) and some network communication applications + (Including a peer-to-peer VOIP client using NAudio as the audio library and my own network wrapper library). +

+

+ On the cracking / hacking side, I've used virtual machines a lot (Mainly infrastructure testing + but I did at one point try creating and breaking into a test windows domain network I had setup). + I've also used VMs to pull perform a PXE boot off a network and analyse the partially deployed image + (And this is why the deployment servers should be switched off when unneeded, especially since PXE + auto-domain-join would store its credentials in the image). + I also played around with accessing the RDP servers when I was in secondary school (Turns out remote apps + is just a glorified application auto-launcher with window size detection). +

+

+ I also bake bread although this sub-site is still under construction (Mostly learnt from my grandma). + I also play video-games and am an expert at using lower-end hardware. +

+

+ I used to do Karate (Kyokushin Brown Belt) and I wish I could still fit my bike. + My GPG Key for my email address. +

+ thumbnailLocation: "https://cityuni.captainalm.com/resources/assets/imageofyou_t.jpg" imageLocation: "https://cityuni.captainalm.com/resources/assets/imageofyou.jpg" imageAltText: "Image of me." birthYear: 2002 @@ -23,6 +51,7 @@ entries:

My first programming task at City, concluding the 2 week 2021 Programming Bootcamp, although I have only spent 3 days programming this and was a tad bit too ambitious. + (I could have started earlier though)

This Processing project show that I can use arrays, loops, mouse and keyboard interaction and geometric transforms. @@ -33,55 +62,93 @@ entries: I ran out of time before the submission to actually even start on the game. But you can play around with the main code and build your own GUIs too so...

- https://github.com/Captain-ALM/Ninjaformer-Processing + Here is the repo: https://github.com/Captain-ALM/Ninjaformer-Processing

startDate: "01/10/2021" endDate: "31/10/2021" videoLocation: "https://cityuni.captainalm.com/resources/stream/vid1.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" + - "https://cityuni.captainalm.com/resources/assets/pic1_t.png" + - "https://cityuni.captainalm.com/resources/assets/pic2_t.png" + - "https://cityuni.captainalm.com/resources/assets/pic3_t.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" imageAltTexts: - - "Picture 1." - - "Picture 2." - - "Picture 3." + - "Level select screen." + - "Empty content interface (Gameplay)." + - "Level editor screen." - name: "City Game Project 2022: Ninjaformer (Alpha, Beta)" content: >

- My third programming task and first major project at City, concluding 2.2 Months of programming. + My first major project at City (A Java Game), concluding 2.2 Months of programming. + This game uses the University provided game library (Which is just JBox2D extended).

Looking back on this, I wish I started earlier (Like January) that way I could have implemented all the features I wanted. This project allows for levels to be designed within the program and allows them to be edited as XML outside the program.

- The code is extensible and it is relatively straight forward to impliment new features. There are a few bugs that can crop up + The code is extensible and it is relatively straight forward to implement new features. There are a few bugs that can crop up (Such as sticking to surfaces due to ground body updates) but I already know ways to fix them. This project relies on part of a GUI library I built in it and I had to modify the CityGame library by extending it. - The audio and assets were also created by me. + The audio and assets were also created by me, although they're a bit amateurish as I'm a computer scientist not an artist!

- Not public due to university anti-plagiarism policy. + This game is designed to be a story based game... The tutorial level at the beginning of the game is the dream in which the main + character dreams of being a ninja, this allows for the player to learn the controls and basic mechanics of the game. + The next level is the training level in which the ninja trains within a monastery. + The final level allows the ninja to "complete" the game while exploring a set of caves. +

+

+ Here is the repo: Not public due to university anti-plagiarism policy.

startDate: "25/02/2022" endDate: "08/05/2022" videoLocation: "https://cityuni.captainalm.com/resources/stream/vid2.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" + - "https://cityuni.captainalm.com/resources/assets/pic4_t.png" + - "https://cityuni.captainalm.com/resources/assets/pic5_t.png" + - "https://cityuni.captainalm.com/resources/assets/pic6_t.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" imageAltTexts: - - "Picture 4." - - "Picture 5." - - "Picture 6." + - "Cave level." + - "Tutorial level." + - "Training level." + - name: "Global Game Jam January 2022 : Shadow work" + content: > +

+ I may have not done any programming for this (Even though I know C#) but I helped write a good chunk of the background story + (I also helped with the level design although it turns out 48 hours is hard to get polished stuff done in, so some stuff had to be axed). +

+

+ Read about and get the game files from: https://globalgamejam.org/2022/games/shadow-work-8 +

+

+ Download the windows executable from: https://cdn.captainalm.com/download/ShadowWorkExecutable.zip +

+ startDate: "20/01/2022" + endDate: "30/01/2022" + #videoLocation: "https://cityuni.captainalm.com/resources/stream/vid3.mp4" + #videoContentType: "video/mp4" + - name: "City-University Portfolio" + content: > +

+ This project is what's outputting this page at the moment! The backend is written in Go and there is both custom front-end Javascript and CSS! + The pages support theming and the entries can be sorted through Javascript or on the backend through GET parameters. +

+

+ This project is under the BSD-3-Clause License, so if reusing, you must scrub references to me, the yml file this is written in is under + Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International + License. +

+

+ Find the source code here: https://code.mrmelon54.xyz/alfred/cityuni-webserver +

+ startDate: "13/07/2022" diff --git a/pageHandler/pages/index/data.go b/pageHandler/pages/index/data.go index 45d31da..f697ff2 100644 --- a/pageHandler/pages/index/data.go +++ b/pageHandler/pages/index/data.go @@ -3,13 +3,14 @@ package index import "html/template" type DataYaml struct { - HeaderLinks map[string]template.URL `yaml:"headerLinks"` - CSSBaseURL template.URL `yaml:"cssBaseURL"` - CSSLightURL template.URL `yaml:"cssLightURL"` - CSSDarkURL template.URL `yaml:"cssDarkURL"` - JScriptURL template.URL `yaml:"jScriptURL"` - About AboutYaml `yaml:"about"` - Entries []EntryYaml `yaml:"entries"` + HeaderLinks map[string]template.URL `yaml:"headerLinks"` + CSSBaseURL template.URL `yaml:"cssBaseURL"` + CSSLightURL template.URL `yaml:"cssLightURL"` + CSSDarkURL template.URL `yaml:"cssDarkURL"` + JScriptURL template.URL `yaml:"jScriptURL"` + NoVideoImageLocation template.URL `yaml:"noVideoImageLocation"` + About AboutYaml `yaml:"about"` + Entries []EntryYaml `yaml:"entries"` } func (dy DataYaml) GetHeaderLabels() []string { -- 2.45.2 From 798d771a48035e1f51388ee3f68e41df4b720b3e Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 27 Jul 2022 13:47:10 +0100 Subject: [PATCH 46/64] . --- index.go.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.go.html b/index.go.html index 7f1d5f5..82763eb 100644 --- a/index.go.html +++ b/index.go.html @@ -87,7 +87,7 @@ The Video - {{ end } + {{ end }}
-- 2.45.2 From 8d37f854767a11307d2a262e76c3f7fe2748c8ad Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 27 Jul 2022 13:48:04 +0100 Subject: [PATCH 47/64] . --- index.go.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.go.yml b/index.go.yml index 8730a80..42fc6b6 100644 --- a/index.go.yml +++ b/index.go.yml @@ -1,3 +1,5 @@ +#This file is (C) Captain ALM +#Under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License cssBaseURL: "https://cityuni.captainalm.com/resources/assets/base.css" cssDarkURL: "https://cityuni.captainalm.com/resources/assets/dark.css" cssLightURL: "https://cityuni.captainalm.com/resources/assets/light.css" -- 2.45.2 From 63bd03014ab4f77a9a78841cc0a8275cceddc085 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Wed, 27 Jul 2022 13:53:38 +0100 Subject: [PATCH 48/64] . --- index.go.html | 2 +- index.go.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.go.html b/index.go.html index 82763eb..e4aea8a 100644 --- a/index.go.html +++ b/index.go.html @@ -81,7 +81,7 @@
{{ if eq .VideoLocation "" }} - No Video + No Video {{ else }}
{{ end }} diff --git a/index.go.yml b/index.go.yml index 3583d8a..2c557a4 100644 --- a/index.go.yml +++ b/index.go.yml @@ -5,6 +5,9 @@ cssDarkURL: "https://cityuni.captainalm.com/resources/assets/dark.css" cssLightURL: "https://cityuni.captainalm.com/resources/assets/light.css" jScriptURL: "https://cityuni.captainalm.com/resources/assets/index.js" noVideoImageLocation: "https://cityuni.captainalm.com/resources/assets/novideo.png" +logoImageLocation: "https://cityuni.captainalm.com/resources/assets/logo.png" +moonImageLocation: "https://cityuni.captainalm.com/resources/assets/moon.png" +sunImageLocation: "https://cityuni.captainalm.com/resources/assets/sun.png" headerLinks: Main Portfolio: "https://portfolio.captainalm.com/" Root Site Home: "https://www.captainalm.com/" diff --git a/light.css b/light.css index 993aabe..db3374e 100644 --- a/light.css +++ b/light.css @@ -1,4 +1,4 @@ -body{ +body, .so-pane > *{ color: #060606; background-color: #fafaf9; border-color: #969696; @@ -6,7 +6,7 @@ body{ a{ color: #4f4fff; } -.header, .nav, footer{ +.header, .nav, footer, .so-pane{ background-color: #e2e2e1; } .home-button > div, .sort-button > div, .menu a{ @@ -24,6 +24,9 @@ a{ .item-table{ background-color: #c0c0c0; } +.so-pane{ + border-color: #c0c0c0; +} .item-table > div > div, .item-table-caption{ border-color: #0a214c; } diff --git a/pageHandler/pages/index/entry.go b/pageHandler/pages/index/entry.go index f129589..5da2b29 100644 --- a/pageHandler/pages/index/entry.go +++ b/pageHandler/pages/index/entry.go @@ -4,6 +4,7 @@ import ( "golang.captainalm.com/cityuni-webserver/utils/yaml" "html/template" "math" + "net/http" "time" ) @@ -31,6 +32,10 @@ func (ey EntryYaml) GetStartDate() string { return ey.StartDate.Format(dateFormat) } +func (ey EntryYaml) GetStartDateHTML() string { + return ey.StartDate.Format(http.TimeFormat) +} + func (ey EntryYaml) GetEndDate() string { if ey.EndDate.IsZero() { return "" @@ -39,6 +44,10 @@ func (ey EntryYaml) GetEndDate() string { } } +func (ey EntryYaml) GetEndDateHTML() string { + return ey.GetEndTime().Format(http.TimeFormat) +} + func (ey EntryYaml) GetEndTime() time.Time { if ey.EndDate.IsZero() { return time.Now() -- 2.45.2 From 03b3c03f4f04c4fb50aa7c36f5aa5dd59a8a5feb Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 00:34:25 +0100 Subject: [PATCH 53/64] . --- index.go.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.go.html b/index.go.html index 2730ff1..7f5f3ff 100644 --- a/index.go.html +++ b/index.go.html @@ -73,6 +73,7 @@ {{ end }} + -- 2.45.2 From b8f3d12399afb05d0f8200e1004d3d914ecdb243 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 00:38:19 +0100 Subject: [PATCH 54/64] . --- base.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base.css b/base.css index 38b71d2..9b160e9 100644 --- a/base.css +++ b/base.css @@ -59,7 +59,7 @@ main{ .so-pane > *{ font-size: 24px; text-align: center; - width: 90px; + width: 180px; padding: 0 1px; } .nav-menu, .sort-menu, .data-hold{ @@ -114,9 +114,9 @@ main{ box-sizing: content-box; position: fixed; top: 85px; - max-height: 48px; + max-height: 96px; width: 360px; - height: 32px; + height: 96px; padding: 4px; text-align: center; vertical-align: middle; -- 2.45.2 From 9876cbd64c81f1510e1947f1cc858fcf4068a516 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 00:48:24 +0100 Subject: [PATCH 55/64] . --- base.css | 7 +++++-- dark.css | 6 +++--- index.go.html | 10 ++++++++-- light.css | 6 +++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/base.css b/base.css index 9b160e9..6cc0029 100644 --- a/base.css +++ b/base.css @@ -58,10 +58,13 @@ main{ } .so-pane > *{ font-size: 24px; - text-align: center; + text-align: left; width: 180px; padding: 0 1px; } +.so-pane > label{ + background-color: transparent; +} .nav-menu, .sort-menu, .data-hold{ display: none; } @@ -121,7 +124,7 @@ main{ text-align: center; vertical-align: middle; border-style: solid; - border-width: 1px; + border-width: 2px; } .main-box{ display: -webkit-box; diff --git a/dark.css b/dark.css index 7675139..181b20b 100644 --- a/dark.css +++ b/dark.css @@ -1,4 +1,4 @@ -body, .so-pane > *{ +body{ color: #f9f9f9; background-color: #050506; border-color: #696969; @@ -9,10 +9,10 @@ a{ .header, .nav, footer, .so-pane{ background-color: #1d1d1e; } -.home-button > div, .sort-button > div, .menu a{ +.home-button > div, .sort-button > div, .menu a, .so-pane > *{ color: #e0e0e0; } -.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > input, .so-pane > select{ background-color: #606061; } .hmb-line, .hmb-line::before, .hmb-line::after{ diff --git a/index.go.html b/index.go.html index 7f5f3ff..b759015 100644 --- a/index.go.html +++ b/index.go.html @@ -33,6 +33,7 @@ {{ end }} {{ $sort := 0 }} +

+

+

+

+

+

diff --git a/light.css b/light.css index db3374e..5c608bb 100644 --- a/light.css +++ b/light.css @@ -1,4 +1,4 @@ -body, .so-pane > *{ +body{ color: #060606; background-color: #fafaf9; border-color: #969696; @@ -9,10 +9,10 @@ a{ .header, .nav, footer, .so-pane{ background-color: #e2e2e1; } -.home-button > div, .sort-button > div, .menu a{ +.home-button > div, .sort-button > div, .menu a, .so-pane > *{ color: #1f1f1f; } -.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > input, .so-pane > select{ background-color: #9f9f9e; } .hmb-line, .hmb-line::before, .hmb-line::after{ -- 2.45.2 From 77e97a68bb687758de2999425029c57471016320 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 00:53:24 +0100 Subject: [PATCH 56/64] . --- base.css | 4 ++-- dark.css | 4 ++-- light.css | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base.css b/base.css index 6cc0029..e1f6a4b 100644 --- a/base.css +++ b/base.css @@ -56,13 +56,13 @@ main{ position: fixed; max-height: 0; } -.so-pane > *{ +.so-pane > p > *{ font-size: 24px; text-align: left; width: 180px; padding: 0 1px; } -.so-pane > label{ +.so-pane > p > label{ background-color: transparent; } .nav-menu, .sort-menu, .data-hold{ diff --git a/dark.css b/dark.css index 181b20b..b275bef 100644 --- a/dark.css +++ b/dark.css @@ -9,10 +9,10 @@ a{ .header, .nav, footer, .so-pane{ background-color: #1d1d1e; } -.home-button > div, .sort-button > div, .menu a, .so-pane > *{ +.home-button > div, .sort-button > div, .menu a, .so-pane > p > *{ color: #e0e0e0; } -.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > input, .so-pane > select{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > p > input, .so-pane > p > select{ background-color: #606061; } .hmb-line, .hmb-line::before, .hmb-line::after{ diff --git a/light.css b/light.css index 5c608bb..f0462d0 100644 --- a/light.css +++ b/light.css @@ -9,10 +9,10 @@ a{ .header, .nav, footer, .so-pane{ background-color: #e2e2e1; } -.home-button > div, .sort-button > div, .menu a, .so-pane > *{ +.home-button > div, .sort-button > div, .menu a, .so-pane > p > *{ color: #1f1f1f; } -.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > input, .so-pane > select{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > p > input, .so-pane > p > select{ background-color: #9f9f9e; } .hmb-line, .hmb-line::before, .hmb-line::after{ -- 2.45.2 From 76cbb19317095aa741687aa86567a1c2d1ecfcb2 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 01:01:53 +0100 Subject: [PATCH 57/64] . --- base.css | 11 +++++------ dark.css | 4 ++-- index.go.html | 6 ------ light.css | 4 ++-- pageHandler/pages/index/entry.go | 2 +- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/base.css b/base.css index e1f6a4b..1584bd6 100644 --- a/base.css +++ b/base.css @@ -56,13 +56,12 @@ main{ position: fixed; max-height: 0; } -.so-pane > p > *{ - font-size: 24px; +.so-pane > *{ + font-size: 16px; text-align: left; - width: 180px; padding: 0 1px; } -.so-pane > p > label{ +.so-pane > label{ background-color: transparent; } .nav-menu, .sort-menu, .data-hold{ @@ -117,9 +116,9 @@ main{ box-sizing: content-box; position: fixed; top: 85px; - max-height: 96px; + max-height: 24px; width: 360px; - height: 96px; + height: 24px; padding: 4px; text-align: center; vertical-align: middle; diff --git a/dark.css b/dark.css index b275bef..181b20b 100644 --- a/dark.css +++ b/dark.css @@ -9,10 +9,10 @@ a{ .header, .nav, footer, .so-pane{ background-color: #1d1d1e; } -.home-button > div, .sort-button > div, .menu a, .so-pane > p > *{ +.home-button > div, .sort-button > div, .menu a, .so-pane > *{ color: #e0e0e0; } -.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > p > input, .so-pane > p > select{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > input, .so-pane > select{ background-color: #606061; } .hmb-line, .hmb-line::before, .hmb-line::after{ diff --git a/index.go.html b/index.go.html index b759015..c095f06 100644 --- a/index.go.html +++ b/index.go.html @@ -33,7 +33,6 @@ {{ end }} {{ $sort := 0 }} -

-

-

-

-

-

diff --git a/light.css b/light.css index f0462d0..5c608bb 100644 --- a/light.css +++ b/light.css @@ -9,10 +9,10 @@ a{ .header, .nav, footer, .so-pane{ background-color: #e2e2e1; } -.home-button > div, .sort-button > div, .menu a, .so-pane > p > *{ +.home-button > div, .sort-button > div, .menu a, .so-pane > *{ color: #1f1f1f; } -.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > p > input, .so-pane > p > select{ +.home-button:hover, .menu a:hover, .hmb:hover, .sort-button:hover, .sort-menu:checked ~ .sort-button, .so-pane > input, .so-pane > select{ background-color: #9f9f9e; } .hmb-line, .hmb-line::before, .hmb-line::after{ diff --git a/pageHandler/pages/index/entry.go b/pageHandler/pages/index/entry.go index 5da2b29..bcf6d7b 100644 --- a/pageHandler/pages/index/entry.go +++ b/pageHandler/pages/index/entry.go @@ -8,7 +8,7 @@ import ( "time" ) -const dateFormat = "01-2006" +const dateFormat = "01/2006" type EntryYaml struct { Name string `yaml:"name"` -- 2.45.2 From ed254b47c6ee8290b7f99ac77ea9c8d3dcfb93cf Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 01:08:25 +0100 Subject: [PATCH 58/64] . --- base.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base.css b/base.css index 1584bd6..d479390 100644 --- a/base.css +++ b/base.css @@ -57,9 +57,10 @@ main{ max-height: 0; } .so-pane > *{ + vertical-align: middle; font-size: 16px; text-align: left; - padding: 0 1px; + padding: 0 2px; } .so-pane > label{ background-color: transparent; @@ -117,11 +118,10 @@ main{ position: fixed; top: 85px; max-height: 24px; - width: 360px; + width: 400px; height: 24px; padding: 4px; text-align: center; - vertical-align: middle; border-style: solid; border-width: 2px; } -- 2.45.2 From 940402661028d5ede12077f9b6917b425fdd6711 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 01:17:10 +0100 Subject: [PATCH 59/64] . --- base.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base.css b/base.css index d479390..434ebd1 100644 --- a/base.css +++ b/base.css @@ -117,8 +117,7 @@ main{ box-sizing: content-box; position: fixed; top: 85px; - max-height: 24px; - width: 400px; + width: auto; height: 24px; padding: 4px; text-align: center; -- 2.45.2 From 493f73c8d254c289c5fbb576cb5e234f99e03d26 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 01:20:29 +0100 Subject: [PATCH 60/64] . --- base.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base.css b/base.css index 434ebd1..459d6de 100644 --- a/base.css +++ b/base.css @@ -117,8 +117,9 @@ main{ box-sizing: content-box; position: fixed; top: 85px; + max-height: 100%; width: auto; - height: 24px; + height: auto; padding: 4px; text-align: center; border-style: solid; -- 2.45.2 From c649064ae36220bc95e5f9b34448bf0a88ed049b Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 01:28:05 +0100 Subject: [PATCH 61/64] . --- base.css | 5 ++++- index.go.html | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/base.css b/base.css index 459d6de..44a7e5a 100644 --- a/base.css +++ b/base.css @@ -60,7 +60,7 @@ main{ vertical-align: middle; font-size: 16px; text-align: left; - padding: 0 2px; + padding: 2px; } .so-pane > label{ background-color: transparent; @@ -217,6 +217,9 @@ main{ border-width: 4px; margin: 10px; } + .small-only-row{ + display: none !important; + } } @media (min-width: 640px){ .nav{ diff --git a/index.go.html b/index.go.html index c095f06..d27ef7a 100644 --- a/index.go.html +++ b/index.go.html @@ -96,6 +96,11 @@
+
{{ .Data.About.GetContent }}
@@ -104,6 +109,11 @@
{{ .Data.About.ImageAltText }}
+
+
+
{{ .Data.About.ImageAltText }}
+
+
{{ range .GetEntries }} -- 2.45.2 From 04f2f1105b78a68e16fd5036494455106b7d750b Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 01:33:51 +0100 Subject: [PATCH 62/64] . --- index.go.html | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/index.go.html b/index.go.html index d27ef7a..754b0a2 100644 --- a/index.go.html +++ b/index.go.html @@ -111,7 +111,7 @@
-
{{ .Data.About.ImageAltText }}
+
{{ .Data.About.ImageAltText }}
@@ -131,6 +131,15 @@ {{ end }} +
+
+ {{ if eq .GetStartDate .GetEndDate }} +

{{ .GetStartDate }}

+ {{ else }} +

{{ .GetStartDate }} - {{ .GetEndDate }}

+ {{ end }} +
+
{{ .GetContent }}
@@ -148,6 +157,20 @@
+
+
+
+ {{ if eq .VideoLocation "" }} + No Video + {{ else }} + + {{ end }} +
+
+
{{ if not (eq .GetImageCount 0) }}
-- 2.45.2 From 41c5e37a071ce2f688692769ab32258fc88bc764 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 01:36:58 +0100 Subject: [PATCH 63/64] . --- index.go.html | 2 +- pageHandler/pages/index/data.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.go.html b/index.go.html index 754b0a2..ab8ef3f 100644 --- a/index.go.html +++ b/index.go.html @@ -27,7 +27,7 @@ {{ end }} {{ end }} - +
{{ if .Light }} diff --git a/pageHandler/pages/index/data.go b/pageHandler/pages/index/data.go index 649234c..acd977a 100644 --- a/pageHandler/pages/index/data.go +++ b/pageHandler/pages/index/data.go @@ -12,6 +12,7 @@ type DataYaml struct { LogoImageLocation template.URL `yaml:"logoImageLocation"` SunImageLocation template.URL `yaml:"sunImageLocation"` MoonImageLocation template.URL `yaml:"moonImageLocation"` + SortImageLocation template.URL `yaml:"sortImageLocation"` About AboutYaml `yaml:"about"` Entries []EntryYaml `yaml:"entries"` } -- 2.45.2 From a58f9fae3aaa0f7e3ae7a74872f5b1f6087b87ce Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Thu, 28 Jul 2022 01:40:45 +0100 Subject: [PATCH 64/64] . --- index.go.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/index.go.yml b/index.go.yml index 2c557a4..4dc0873 100644 --- a/index.go.yml +++ b/index.go.yml @@ -8,6 +8,7 @@ noVideoImageLocation: "https://cityuni.captainalm.com/resources/assets/novideo.p logoImageLocation: "https://cityuni.captainalm.com/resources/assets/logo.png" moonImageLocation: "https://cityuni.captainalm.com/resources/assets/moon.png" sunImageLocation: "https://cityuni.captainalm.com/resources/assets/sun.png" +sortImageLocation: "https://cityuni.captainalm.com/resources/assets/sort.png" headerLinks: Main Portfolio: "https://portfolio.captainalm.com/" Root Site Home: "https://www.captainalm.com/" -- 2.45.2