diff --git a/.gitattributes b/.gitattributes index 24a8e87..2c1a7cc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ *.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.otf filter=lfs diff=lfs merge=lfs -text diff --git a/approutes/personalPropsRoute/personalPropsRoute.go b/approutes/personalPropsRoute/personalPropsRoute.go index 99f8618..38d3ab5 100644 --- a/approutes/personalPropsRoute/personalPropsRoute.go +++ b/approutes/personalPropsRoute/personalPropsRoute.go @@ -1,16 +1,13 @@ package personalpropsroute import ( - "net/http" - "personalwebsite/websiteapp/personalprops" - "github.com/gin-gonic/gin" ) func Route(route *gin.RouterGroup) { - persPropsApp := personalprops.NewPersPropsApp() - route.GET("/test", func(ctx *gin.Context) { - test := persPropsApp.Render() - ctx.HTML(http.StatusOK, "personal-properties.html", gin.H{"books": test}) - }) + + // route.GET("/test", func(ctx *gin.Context) { + // test := persPropsApp.Render() + // ctx.HTML(http.StatusOK, "personal-properties.html", gin.H{"books": test}) + // }) } diff --git a/main.go b/main.go index 8192d61..30f8f82 100644 --- a/main.go +++ b/main.go @@ -4,12 +4,15 @@ import ( "log" "net/http" personalpropsroute "personalwebsite/approutes/personalPropsRoute" + "personalwebsite/routewde" + "personalwebsite/websiteapp" + "personalwebsite/websiteapp/personalprops" "github.com/gin-gonic/gin" ) func main() { - + // hostUrl := "http://192.168.88.10:8080/" router := gin.New() // router.Use(rateLimit, gin.Recovery()) router.LoadHTMLGlob("resources/*.html") @@ -20,10 +23,61 @@ func main() { router.GET("/getmockapp", func(ctx *gin.Context) { }) - apps := router.Group("applications") + persPropsApp := personalprops.NewPersPropsApp() + appsStorage := websiteapp.ApplicationsStorage{ + Apps: map[string]websiteapp.WebDEApplication{}, + } + appsStorage.Apps["personal-properties"] = &persPropsApp + system := router.Group("system") { + wde := system.Group("wde") + { + routewde.Route(wde) + } + apps := system.Group("applications") + { + apps.GET("/:appid/:method", func(ctx *gin.Context) { + appId := ctx.Param("appid") + method := ctx.Param("method") + + app, isExist := appsStorage.Apps[appId] + if !isExist { + ctx.Status(http.StatusNoContent) + return + } + switch method { + case "getmanifest": + ctx.JSON(http.StatusOK, app.GetManifest()) + case "gethtml": + ctx.HTML(http.StatusOK, appId+".html", nil) + case "app.js": + ctx.File("resources/applications/" + appId + "/" + appId + ".js") + case "app.css": + ctx.File("resources/applications/" + appId + "/" + appId + ".css") + default: + ctx.Status(http.StatusBadRequest) + } + }) + } + + websiteapp.Route(apps.Group("/storage"), &appsStorage) personalpropsroute.Route(apps.Group("/personalproperties")) } + + app := router.Group("application") + { + app.GET("test", func(ctx *gin.Context) { + ctx.Status(http.StatusOK) + }) + persPropApp := app.Group("personal-properties") + { + + persPropApp.GET("getcontent", func(ctx *gin.Context) { + ctx.HTML(http.StatusOK, "personal-properties.html", persPropsApp.Render()) + }) + } + + } // router.GET("/room/:roomid", roomGET) // router.POST("/room-post/:roomid", roomPOST) // router.GET("/stream/:roomid", streamRoom) diff --git a/resources/EspySansRegular.ttf b/resources/EspySansRegular.ttf new file mode 100644 index 0000000..cdae33c --- /dev/null +++ b/resources/EspySansRegular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5803f892c50e2f011082f8cf6382b10cf0bbbdf2139c2a16325b3e4184d7a7a3 +size 27336 diff --git a/resources/GnuUnifontFull-Pm9P.ttf b/resources/GnuUnifontFull-Pm9P.ttf new file mode 100644 index 0000000..796af8e --- /dev/null +++ b/resources/GnuUnifontFull-Pm9P.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2aec371ce16b0150c39046a6124d4343e98138f09db297ead27808d6748be5aa +size 14767664 diff --git a/resources/JoganSoft-rgwKy.otf b/resources/JoganSoft-rgwKy.otf new file mode 100644 index 0000000..e7c5c29 --- /dev/null +++ b/resources/JoganSoft-rgwKy.otf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45ab18a7cab6044707d28a1c3bfe4ea245e69d05c3c846d269418d2a0a4b1fa2 +size 73156 diff --git a/resources/Pixel Sans Serif Condensed.ttf b/resources/Pixel Sans Serif Condensed.ttf new file mode 100644 index 0000000..d7e1d3c --- /dev/null +++ b/resources/Pixel Sans Serif Condensed.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9fe72469851f1f8cbae97a15f72b7ef9d4ac75bbf1d4ed5fcf73d16324560ad +size 37520 diff --git a/resources/Pixel Sans Serif.ttf b/resources/Pixel Sans Serif.ttf new file mode 100644 index 0000000..edcc5bd --- /dev/null +++ b/resources/Pixel Sans Serif.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b852728f63d3c26043c6b029ca79d7bb53eaf5c60039d11bf08b341a3259af8f +size 84972 diff --git a/resources/SummerPixel22Regular.ttf b/resources/SummerPixel22Regular.ttf new file mode 100644 index 0000000..ef64f94 --- /dev/null +++ b/resources/SummerPixel22Regular.ttf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18983f62b349d96a882605a2ab2bc0cb38046096e544fb93e3b157d6c93c5695 +size 52597 diff --git a/resources/application.js b/resources/application.js new file mode 100644 index 0000000..5d1f83e --- /dev/null +++ b/resources/application.js @@ -0,0 +1,5 @@ +export class Application{ + Init(){ + + } +} \ No newline at end of file diff --git a/resources/applications/personal-properties/personal-properies.css b/resources/applications/personal-properties/personal-properies.css new file mode 100644 index 0000000..8efa55f --- /dev/null +++ b/resources/applications/personal-properties/personal-properies.css @@ -0,0 +1,3 @@ +.Pizda{ + background-color: red; +} \ No newline at end of file diff --git a/resources/applications/personal-properties/personal-properties.js b/resources/applications/personal-properties/personal-properties.js new file mode 100644 index 0000000..720c2ff --- /dev/null +++ b/resources/applications/personal-properties/personal-properties.js @@ -0,0 +1,37 @@ + + +class PersonalProperties{ + /** + * @param {HTMLElement} appElem + */ + constructor(appElem){ + this.appElem = appElem + + } + + Init(){ + this.appElem.innerHTML = WebDesktopEnvironment.GetBasicWindow() + + let contentFrame = this.appElem.children[0].children[0].children[1] + fetch("http://192.168.88.10:8080/application/personal-properties/getcontent") //TODO Move to wde func + .then((response) => response.text()) + .then((html) => { + contentFrame.innerHTML = html + }) + .catch((error) => { + WebDesktopEnvironment.Alert(error); + }); + + // var link = document.createElement( "link" ); + // link.href = "http://192.168.88.10:8080/system/applications/personal-properties/app.css" + // link.type = "text/css"; + // link.rel = "stylesheet"; + // link.media = "screen,print"; + // document.getElementsByTagName( "head" )[0].appendChild(link); + + } +} + +document.onload = function (params) { + console.log("pizda") +} \ No newline at end of file diff --git a/resources/base.css b/resources/base.css index ed18c99..bb02687 100644 --- a/resources/base.css +++ b/resources/base.css @@ -1,6 +1,24 @@ +@font-face{ + font-family: "Ubuntu-LI"; + src:url("./GnuUnifontFull-Pm9P.ttf") +} + +*{ + font-family:"Ubuntu-LI"; +} + body{ margin: 0px; + /* font: normal 14px Summer Pixel 22, "res/SummerPixel22Regular.ttf"; */ } + +/* @font-face { + font-family: "EspySansRegular"; + src: url("res/EspySansRegular.ttf"); + font-weight: normal; + font-style: normal; +} */ + #WindowsLayer { width: 100%; height: 100%; @@ -40,30 +58,19 @@ body{ display: flex; flex-direction: row; align-items: center; + justify-content: space-between; gap: 5px; padding: 0px; } -.WindowFrameTopBarButton -{ - /* box-sizing: border-box; */ - - width: 11px; - height: 11px; - background: #D9D9D9; - border: 1px solid #222222; - 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 rgba(0, 0, 0, 0.25), inset -1px -1px 0px #FFFFFF; - /* Inside auto layout */ - - flex: none; - order: 0; - flex-grow: 0; +.WindowFrameTitle{ + white-space: nowrap } .WindowDragArea{ - background-color: antiquewhite; + /* background-color: antiquewhite; */ width: 100%; height: 100%; /* background: repeating-linear-gradient( @@ -100,25 +107,98 @@ body{ flex-grow: 1; } +.Personal-properties-bio{ + width: 100%; + height: auto; + + /* Auto layout */ + display: flex; + flex-direction: row; + align-items: center; + padding: 0px; + gap:15px; +} + +.Personal-properties-textbio{ + /* width: 100%; + height: auto; */ + + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: left; + padding: 0px; + gap:1px; +} + + .Personal-properties-prop{ width: 100%; height: auto; border: 1px solid #888888; - box-shadow: 1px 1px 0px #FFFFFF, inset 2px 2px 0px #FFFFFF; + box-shadow: 1px 1px 0px #FFFFFF, inset 1px 1px 0px #FFFFFF; + + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: center; + padding: 0px; + gap:1px; } + + .Personal-properties-prop-header{ /* width: 50px; */ - position: relative; + position:relative; display: inline-block; max-width: 100%; background-color: #DDDDDD; left: 12px; top: -10px; margin-left: 2px; + + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: center; + padding: 12px; + gap:10px; /* padding: 10px; */ /* border: 1px solid #888888; */ /* box-shadow: 1px 1px 0px #FFFFFF, inset 2px 2px 0px #FFFFFF; */ +} + +.Personal-properties-prop-content{ + width: 100%; + /* top: 0px; */ + /* Auto layout */ + display: flex; + flex-direction: column; + justify-content: center; + padding: 0px; + gap: 3px; +} + +.Personal-properties-prop-row{ + margin-left: 12px; + margin-right: 12px; + /* Auto layout */ + display: flex; + flex-direction: row; + justify-content: center; + padding: 0px; + gap: 1px; +} +.Personal-properties-prop-key{ + text-align: end; + width: 45%; + white-space: nowrap + /* font-weight: bold; */ +} +.Personal-properties-prop-prop{ + width: 55%; + } \ No newline at end of file diff --git a/resources/base.html b/resources/base.html index d6e4309..e67ee1d 100644 --- a/resources/base.html +++ b/resources/base.html @@ -2,10 +2,12 @@
+ + - + diff --git a/resources/basic-window.html b/resources/basic-window.html new file mode 100644 index 0000000..78d213b --- /dev/null +++ b/resources/basic-window.html @@ -0,0 +1,17 @@ + +