diff --git a/main.go b/main.go index 30f8f82..eb0cfa1 100644 --- a/main.go +++ b/main.go @@ -11,11 +11,27 @@ import ( "github.com/gin-gonic/gin" ) +// func main() { +// router := gin.Default() +// router.LoadHTMLGlob("templates/**/*") +// router.GET("/posts/index", func(c *gin.Context) { +// c.HTML(http.StatusOK, "posts/index.tmpl", gin.H{ +// "title": "Posts", +// }) +// }) +// router.GET("/users/index", func(c *gin.Context) { +// c.HTML(http.StatusOK, "users/index.tmpl", gin.H{ +// "title": "Users", +// }) +// }) +// router.Run(":8080") +// } + func main() { - // hostUrl := "http://192.168.88.10:8080/" + // hostUrl := "http://localhost:8080/" router := gin.New() // router.Use(rateLimit, gin.Recovery()) - router.LoadHTMLGlob("resources/*.html") + router.LoadHTMLGlob("templates/**/*") // router.Static("/static", "resources/static") router.Static("/res", "resources") @@ -49,7 +65,7 @@ func main() { case "getmanifest": ctx.JSON(http.StatusOK, app.GetManifest()) case "gethtml": - ctx.HTML(http.StatusOK, appId+".html", nil) + ctx.HTML(http.StatusOK, "resources/"+appId+"/"+appId+".tmpl", nil) case "app.js": ctx.File("resources/applications/" + appId + "/" + appId + ".js") case "app.css": @@ -73,11 +89,14 @@ func main() { { persPropApp.GET("getcontent", func(ctx *gin.Context) { - ctx.HTML(http.StatusOK, "personal-properties.html", persPropsApp.Render()) + ctx.HTML(http.StatusOK, "personal-properties/app.tmpl", persPropsApp.Render()) }) } } + router.GET("/test", func(ctx *gin.Context) { + ctx.HTML(200, "kek/kek.tmpl", gin.H{}) + }) // router.GET("/room/:roomid", roomGET) // router.POST("/room-post/:roomid", roomPOST) // router.GET("/stream/:roomid", streamRoom) diff --git a/resources/base.css b/resources/base.css index bb02687..ad1de5d 100644 --- a/resources/base.css +++ b/resources/base.css @@ -66,10 +66,12 @@ body{ .WindowFrameTitle{ + pointer-events: none; white-space: nowrap } .WindowDragArea{ + pointer-events: none; /* background-color: antiquewhite; */ width: 100%; height: 100%; @@ -90,14 +92,14 @@ body{ flex-direction: column; align-items: center; padding: 12px; - gap:10px; + gap:16px; width: 100%; height: 100%; background: #DDDDDD; border: 1px solid #000000; - box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), inset 1px 1px 0px #FFFFFF; + box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), inset 1px 1px 0px #FFFFFF; /* Inside auto layout */ @@ -119,6 +121,8 @@ body{ gap:15px; } + + .Personal-properties-textbio{ /* width: 100%; height: auto; */ @@ -155,16 +159,17 @@ body{ display: inline-block; max-width: 100%; background-color: #DDDDDD; - left: 12px; - top: -10px; + /* left: 12px; */ + right: 30%; + top: -12px; margin-left: 2px; /* Auto layout */ - display: flex; + /* display: flex; flex-direction: column; align-items: center; padding: 12px; - gap:10px; + gap:10px; */ /* padding: 10px; */ /* border: 1px solid #888888; */ @@ -198,7 +203,17 @@ body{ white-space: nowrap /* font-weight: bold; */ } -.Personal-properties-prop-prop{ +.Personal-properties-prop-values{ width: 55%; + display: flex; + flex-direction: column; + justify-content: left; + padding: 0px; + gap: 5px; + +} + +.Personal-properties-prop-value{ + /* width: 55%; */ } \ No newline at end of file diff --git a/resources/kek/kek.tmpl b/resources/kek/kek.tmpl new file mode 100644 index 0000000..d5f836a --- /dev/null +++ b/resources/kek/kek.tmpl @@ -0,0 +1 @@ +
Using posts/index.tmpl
+ +{{ end }} \ No newline at end of file diff --git a/templates/posts/index.tmpl b/templates/posts/index.tmpl new file mode 100644 index 0000000..88f493d --- /dev/null +++ b/templates/posts/index.tmpl @@ -0,0 +1,7 @@ +{{ define "posts/index.tmpl" }} +Using posts/index.tmpl
+ +{{ end }} \ No newline at end of file diff --git a/templates/users/index.tmpl b/templates/users/index.tmpl new file mode 100644 index 0000000..1d76b6e --- /dev/null +++ b/templates/users/index.tmpl @@ -0,0 +1,7 @@ +{{ define "users/index.tmpl" }} +Using users/index.tmpl
+ +{{ end }} \ No newline at end of file diff --git a/websiteapp/personalprops/personalprops.go b/websiteapp/personalprops/personalprops.go index f17d72a..5e48121 100644 --- a/websiteapp/personalprops/personalprops.go +++ b/websiteapp/personalprops/personalprops.go @@ -37,33 +37,37 @@ func (p *PersonalPropertiesApp) Render() gin.H { // Title: "Title 2", // Author: "Author 2", // }) - allProps := make([][]Prop, 0) + allProps := make([][]PropElement, 0) - basicInfo := make([]Prop, 0) + basicInfo := make([]PropElement, 0) - basicInfo = append(basicInfo, Prop{ - Key: "", - Prop: "Greg Brzezinski", + basicInfo = append(basicInfo, PropElement{ + Key: "", + Values: []string{"Greg Brzezinski"}, }) - basicInfo = append(basicInfo, Prop{ - Key: "", - Prop: "Saint-Petersburg", + basicInfo = append(basicInfo, PropElement{ + Key: "", + Values: []string{"Saint-Petersburg"}, }) // careerkeys := make([]Prop, 0) - careerkeys := []Prop{ + careerkeys := []PropElement{ { - Key: "VR lab assistant", - Prop: "111", + Key: "VR lab assistant", + Values: []string{"February 2019 - March 2020", "Teaching lessons for students in Unreal Engine 4, Unity and Blender editor courses", "Training students for World Skills Russia"}, }, { - Key: "3d artist", - Prop: "qweqwe", + Key: "3d artist", + Values: []string{"March 2020 - June 2020", "Creating 3d assets for VR game"}, }, { - Key: "Jr. Techartist", - Prop: "qweqwaaae", + Key: "Jr. Techartist", + Values: []string{"Game content integration and production", "Shader coding", "Optimization asset production in artists pipeline"}, + }, + { + Key: "Techartist", + Values: []string{"Game content optimization and production", "Profiling and debugging render pipeline", "Creating in-house tools for pipeline software", "Working process pipeline integration and maintenance", "Linux servers administration"}, }, } // careerkeys = append(careerkeys, Prop{ @@ -75,10 +79,10 @@ func (p *PersonalPropertiesApp) Render() gin.H { // Prop: "qweqwe", // }) // careerkeys = append(careerkeys, Prop{}) - testKeys := []Prop{} - testKeys = append(testKeys, Prop{ - Key: "Urrtt", - Prop: "BakaBaka", + testKeys := []PropElement{} + testKeys = append(testKeys, PropElement{ + Key: "Urrtt", + Values: []string{"BakaBaka"}, }) allProps = append(allProps, careerkeys, testKeys, testKeys, testKeys) @@ -97,9 +101,9 @@ type Book struct { Author string } -type Prop struct { - Key string - Prop string +type PropElement struct { + Key string + Values []string } // func (p *PersonalPropertiesApp) GetContent(ctx *gin.Context) interface{} {