Compare commits

..

No commits in common. "56d28046269c79d73c31520bcb1263e1888181f0" and "c0cdb3f7abccc2c2fe2084ce34e0ff3d8d7989f2" have entirely different histories.

25 changed files with 276 additions and 1243 deletions

View File

@ -0,0 +1,13 @@
package personalpropsroute
import (
"github.com/gin-gonic/gin"
)
func Route(route *gin.RouterGroup) {
// route.GET("/test", func(ctx *gin.Context) {
// test := persPropsApp.Render()
// ctx.HTML(http.StatusOK, "personal-properties.html", gin.H{"books": test})
// })
}

48
main.go
View File

@ -3,51 +3,33 @@ package main
import ( import (
"log" "log"
"net/http" "net/http"
personalpropsroute "personalwebsite/approutes/personalPropsRoute"
"personalwebsite/routewde" "personalwebsite/routewde"
"personalwebsite/websiteapp" "personalwebsite/websiteapp"
"personalwebsite/websiteapp/finder"
"personalwebsite/websiteapp/personalprops" "personalwebsite/websiteapp/personalprops"
"github.com/gin-gonic/gin" "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() { func main() {
// hostUrl := "http://localhost:8080/" // hostUrl := "http://192.168.88.10:8080/"
router := gin.New() router := gin.New()
// router.Use(rateLimit, gin.Recovery())
router.LoadHTMLGlob("resources/*.html")
router.LoadHTMLGlob("templates/**/*") // router.Static("/static", "resources/static")
router.Static("/res", "resources") router.Static("/res", "resources")
router.GET("/", index)
router.GET("/getmockapp", func(ctx *gin.Context) {
router.GET("/", func(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "index.tmpl", gin.H{})
}) })
persPropsApp := personalprops.NewPersPropsApp() persPropsApp := personalprops.NewPersPropsApp()
finderApp := finder.FinerApplication{}
appsStorage := websiteapp.ApplicationsStorage{ appsStorage := websiteapp.ApplicationsStorage{
Apps: map[string]websiteapp.WebDEApplication{}, Apps: map[string]websiteapp.WebDEApplication{},
} }
appsStorage.Apps["personal-properties"] = &persPropsApp appsStorage.Apps["personal-properties"] = &persPropsApp
appsStorage.Apps["finder"] = &finderApp
system := router.Group("system") system := router.Group("system")
{ {
wde := system.Group("wde") wde := system.Group("wde")
{ {
routewde.Route(wde) routewde.Route(wde)
@ -66,10 +48,12 @@ func main() {
switch method { switch method {
case "getmanifest": case "getmanifest":
ctx.JSON(http.StatusOK, app.GetManifest()) ctx.JSON(http.StatusOK, app.GetManifest())
case "gethtml":
ctx.HTML(http.StatusOK, appId+".html", nil)
case "app.js": case "app.js":
ctx.File("resources/sys/" + appId + "/" + appId + ".js") ctx.File("resources/applications/" + appId + "/" + appId + ".js")
case "app.css": case "app.css":
ctx.File("resources/sys/" + appId + "/" + appId + ".css") ctx.File("resources/applications/" + appId + "/" + appId + ".css")
default: default:
ctx.Status(http.StatusBadRequest) ctx.Status(http.StatusBadRequest)
} }
@ -77,7 +61,7 @@ func main() {
} }
websiteapp.Route(apps.Group("/storage"), &appsStorage) websiteapp.Route(apps.Group("/storage"), &appsStorage)
// personalpropsroute.Route(apps.Group("/personalproperties")) personalpropsroute.Route(apps.Group("/personalproperties"))
} }
app := router.Group("application") app := router.Group("application")
@ -87,15 +71,13 @@ func main() {
}) })
persPropApp := app.Group("personal-properties") persPropApp := app.Group("personal-properties")
{ {
persPropApp.GET("render", func(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "personal-properties/app.tmpl", persPropsApp.Render()) persPropApp.GET("getcontent", func(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "personal-properties.html", persPropsApp.Render())
}) })
} }
} }
router.GET("/test", func(ctx *gin.Context) {
ctx.HTML(200, "kek/kek.tmpl", gin.H{})
})
// router.GET("/room/:roomid", roomGET) // router.GET("/room/:roomid", roomGET)
// router.POST("/room-post/:roomid", roomPOST) // router.POST("/room-post/:roomid", roomPOST)
// router.GET("/stream/:roomid", streamRoom) // router.GET("/stream/:roomid", streamRoom)

View File

@ -1,35 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" dir="ltr">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Website</title>
<meta name="theme-color" content="#000000"> </head>
<body>
<link rel="stylesheet" href="../../packages/simplebar/dist/simplebar.min.css">
</body>
<script src="https://code.jquery.com/jquery-3.6.3.min.js"></script> </html>
<script src="../../packages/simplebar/dist/simplebar.min.js"></script>
<script>
$(document).ready(function() {
new SimpleBar($('#container')[0]);
});
</script>
<style>
#container {
background-color: lightgray;
max-height: 70px;
overflow: auto;
}
</style>
</head>
<body>
<div id="container">
<p>↓Scrollable!↓</p>
<p>↓Scrollable!↓</p>
<p>↓Scrollable!↓</p>
<p>↓Scrollable!↓</p>
<p>↓Scrollable!↓</p>
</div>
</body>
</html>

View File

@ -0,0 +1,3 @@
.Pizda{
background-color: red;
}

View File

@ -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")
}

View File

@ -1,31 +1,15 @@
@font-face{ @font-face{
font-family: "Virtue"; font-family: "Ubuntu-LI";
src:url("./virtue.ttf"); src:url("./GnuUnifontFull-Pm9P.ttf")
} }
@font-face{
font-family: "Virtue";
src:url("./virtue.ttf")
}
*{ *{
font-family: Verdana, Geneva, sans-serif; font-family:"Ubuntu-LI";
font-size: 11px;
font-style: normal;
font-weight:initial;
} }
body{ body{
margin: 0px; margin: 0px;
/* font: normal 14px Summer Pixel 22, "res/SummerPixel22Regular.ttf"; */ /* font: normal 14px Summer Pixel 22, "res/SummerPixel22Regular.ttf"; */
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome, Edge, Opera and Firefox */
} }
/* @font-face { /* @font-face {
@ -38,7 +22,17 @@ body{
#WindowsLayer { #WindowsLayer {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: fixed; position: absolute;
}
.Application{
position: absolute;
/* background-color: antiquewhite; */
stroke: #000000;
stroke-width: 1px;
stroke-linecap: butt;
stroke-dasharray: 0;
} }
.Frame{ .Frame{
@ -72,72 +66,38 @@ body{
.WindowFrameTitle{ .WindowFrameTitle{
pointer-events: none;
white-space: nowrap white-space: nowrap
} }
.VisualFrame{ .WindowDragArea{
/* background-color: antiquewhite; */
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; /* background: repeating-linear-gradient(
/* overflow: scroll; */ to bottom,
/* overflow-x: hidden; */ rgb(255, 255, 255) 0px,
rgb(255, 255, 255) 1px,
#ffffff00 2px,
#ffffff00 3px
); */
/* box-shadow: 1px 1px ; */
}
.ContentFrame{
box-sizing: border-box;
/* Auto layout */
display: flex;
flex-direction: column;
align-items: center;
padding: 12px;
gap:10px;
/* Inside auto layout */ width: 100%;
height: 100%;
flex: none;
order: 1;
align-self: stretch;
flex-grow: 1;
background: #DDDDDD; background: #DDDDDD;
border: 1px solid #000000; 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;
/* Auto layout */
display: flex;
flex-direction: column;
align-items: center;
justify-content: start;
align-items: flex-start;
gap: 0px;
padding: 0px;
}
.ContentFrame{
width: 100%;
height: auto;
/* background-color: aquamarine; */
/* Auto layout */
display: flex;
flex-direction: column;
align-items: center;
padding: 12px;
padding-bottom: 0px;
gap:16px;
}
.Old {
box-sizing: border-box;
position: relative;
padding: 10px;
/* Auto layout */
display: flex;
flex-direction: column;
align-items: center;
padding: 12px;
gap:16px;
width: 100%;
height: auto;
/* Inside auto layout */ /* Inside auto layout */
@ -145,6 +105,100 @@ body{
order: 0; order: 0;
align-self: stretch; align-self: stretch;
flex-grow: 1; flex-grow: 1;
overflow: scroll;
} }
.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 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;
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%;
}

View File

@ -8,20 +8,11 @@
{{ range $props := .allprops }} {{ range $props := .allprops }}
<div id="prop" class="Personal-properties-prop"> <div id="prop" class="Personal-properties-prop">
<div class="Personal-properties-prop-header">
Test Title:
</div>
<div class="Personal-properties-prop-content"> <div class="Personal-properties-prop-content">
{{range $prop := $props}} {{range $prop := $props}}
<div class="Personal-properties-prop-row"> <div class="Personal-properties-prop-row">
<div class="Personal-properties-prop-key">{{.Key}}:</div> <div class="Personal-properties-prop-key">{{.Key}}:</div>
<div class="Personal-properties-prop-values"> <div class="Personal-properties-prop-prop">{{ .Prop }}</div>
{{ range $value := .Values }}
<div class="Personal-properties-prop-value">
{{ $value }}
</div>
{{ end }}
</div>
</div> </div>
{{ end }} {{ end }}
</div> </div>

View File

@ -1,40 +0,0 @@
class Finder{
appId = "finder"
/**
* @param {HTMLElement} appElem
*/
constructor(appElem){
this.appElem = appElem
}
Init(){
console.log("Init")
fetch(`http://localhost:8080/application/${this.appId}/render`) //TODO Move to wde func
.then((response) => response.text())
.then((html) => {
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Finder", 600, 500)
newWindow.innerHTML = html
let closeButton = newWindow.children[0].children[0]
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
})
.catch((error) => {
WebDesktopEnvironment.Alert(error);
});
}
CloseWindow(id){
console.log(id+"Close")
}
}
function reply_click(){
console.log("QQQQQQQQQQQQQQQQQQQ")
}

View File

@ -1,166 +0,0 @@
.ScrollContent {
width: 100%;
height: 100%;
overflow: scroll;
overflow-x: hidden;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* Internet Explorer 10+ */
/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-start;
padding: 0px;
}
.ScrollContent::-webkit-scrollbar { /* WebKit */
width: 0;
height: 0;
}
.PropertiesList{
/* width: 100%;
height: auto; */
/* Inside auto layout */
order: 0;
align-self: flex-start;
flex-grow: 0;
/* Auto layout */
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 12px;
gap:16px;
}
.Personal-properties-bio{
/* width: 100%;
height: auto; */
/* margin-right: -20px; */
/* Inside auto layout */
flex: none;
order: 0;
align-self: stretch;
flex-grow: 1;
/* Auto layout */
display: flex;
flex-direction: row;
align-items: center;
padding: 0px;
margin-right: 20;
gap:15px;
}
.Personal-properties-textbio{
/* width: 100%;
height: auto; */
/* Inside auto layout */
flex: none;
order: 0;
align-self: stretch;
flex-grow: 1;
/* 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 1px 1px 0px #FFFFFF;
padding-bottom: 10px;
/* Auto layout */
/* display: flex;
flex-direction: column;
align-items: center;
padding: 0px;
gap:1px; */
}
.Personal-properties-prop-title{
font-family: "Virtue";
letter-spacing: 0.35px;
position:relative;
display: inline-block;
max-width: 100%;
background-color: #DDDDDD;
left: 12px;
top: -9px;
}
.Personal-properties-prop-content{
width: 100%;
/* top: 0px; */
/* Auto layout */
display: flex;
flex-direction: column;
justify-content: center;
padding: 0px;
gap: 12px;
}
.Personal-properties-prop-row{
margin-left: 12px;
margin-right: 12px;
/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
padding: 0px;
gap: 5px;
}
.Personal-properties-prop-key{
position: relative;
font-family: "Virtue";
font-size: 11px;
letter-spacing: 0.35px;
text-align: end;
width: 34%;
white-space: nowrap;
top: -1.5px;
/* font-weight: bold; */
}
.Personal-properties-prop-key-comments{
/* color: rgb(129, 129, 129); TODO*/
color: #646464;
font-size: 9px;
font-style: italic;
text-align: end;
white-space:normal;
/* filter: drop-shadow(-.5px -.5px 0px #616161); */
}
.Personal-properties-prop-values{
width: 55%;
display: flex;
flex-direction: column;
justify-content: left;
padding: 0px;
gap: 5px;
}
.Personal-properties-prop-value{
/* width: 55%; */
}

View File

@ -1,55 +0,0 @@
// const simpleScrollbar = require("../wde/simple-scrollbar");
class PersonalProperties{
appId = "personal-properties"
/**
* @param {HTMLElement} appElem
*/
constructor(appElem){
this.appElem = appElem
}
Init(){
console.log("Init")
fetch("http://localhost:8080/application/personal-properties/render") //TODO Move to wde func
.then((response) => response.text())
.then((html) => {
//TODO Get ~70% of user screen height
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Personal Properties", 300, 500)
newWindow.innerHTML = html
let closeButton = newWindow.children[0].children[0]
let scrollDiv = newWindow.children[1]
// console.log(scrollDiv)
let scrollBar = new WdeScrollBar(scrollDiv.children[1].children[0])
console.log(scrollBar)
// scrollBar.BindHandler(scrollDiv.children[1].children[0])
// scrollBar.BindHandler(scrollDiv.children[1].children[0])
// SimpleScrollbar.initEl(scrollDiv)
// console.log("SimpleBar" + SimpleScrollbar)
// SimpleScrollbar.initAll();
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
})
.catch((error) => {
WebDesktopEnvironment.Alert(error);
});
}
CloseWindow(id){
console.log(id+"Close")
}
}
function reply_click(){
console.log("QQQQQQQQQQQQQQQQQQQ")
}

View File

@ -1,56 +0,0 @@
.ss-wrapper {
overflow: hidden;
width: 100%;
height: 100%;
position: relative;
z-index: 1;
float: left;
}
.ss-content {
height: 100%;
width: calc(100% + 18px);
padding: 0 0 0 0;
position: relative;
overflow: auto;
box-sizing: border-box;
}
.ss-content.rtl {
width: calc(100% + 18px);
right: auto;
}
.ss-scroll {
position: relative;
background: rgba(0, 0, 0, 0.1);
width: 14px;
height: 31px;
/* border-radius: 4px; */
top: 0;
z-index: 2;
cursor: pointer;
/* opacity: 0; */
/* transition: opacity 0.25s linear; */
background: #9999FF;
box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.5),
inset 1px 0px 0px rgba(255, 255, 255, 0.5),
inset -1px -1px 0px rgba(102, 102, 204, 0.91);
}
.ss-hidden {
display: none;
}
.ss-container:hover .ss-scroll,
.ss-container:active .ss-scroll {
opacity: 1;
}
.ss-grabbed {
-o-user-select: none;
-ms-user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
}

View File

@ -1,165 +0,0 @@
;(function(root, factory) {
if (typeof exports === 'object') {
module.exports = factory(window, document)
} else {
root.SimpleScrollbar = factory(window, document)
}
})(this, function(w, d) {
var raf = w.requestAnimationFrame || w.setImmediate || function(c) { return setTimeout(c, 0); };
function initEl(el) {
Object.defineProperty(el, 'data-simple-scrollbar', { value: new SimpleScrollbar(el), configurable: true });
}
function unbindEl(el) {
if (!Object.prototype.hasOwnProperty.call(el, 'data-simple-scrollbar')) return;
el['data-simple-scrollbar'].unBind();
//Remove the elements property
delete el['data-simple-scrollbar'];
}
// Mouse drag handler
function dragDealer(el, context) {
var lastPageY;
el.addEventListener('mousedown', function(e) {
lastPageY = e.pageY;
el.classList.add('ss-grabbed');
d.body.classList.add('ss-grabbed');
d.addEventListener('mousemove', drag);
d.addEventListener('mouseup', stop);
return false;
});
function drag(e) {
var delta = e.pageY - lastPageY;
lastPageY = e.pageY;
raf(function() {
context.el.scrollTop += delta / context.scrollRatio;
});
}
function stop() {
el.classList.remove('ss-grabbed');
d.body.classList.remove('ss-grabbed');
d.removeEventListener('mousemove', drag);
d.removeEventListener('mouseup', stop);
}
}
// Constructor
function ss(el) {
this.target = el;
this.content = el.firstElementChild;
this.direction = w.getComputedStyle(this.target).direction;
this.bar = '<div class="ss-scroll">';
//Create a reference to the function binding to remove the event listeners
this.mB = this.moveBar.bind(this);
this.wrapper = d.createElement('div');
this.wrapper.setAttribute('class', 'ss-wrapper');
this.el = d.createElement('div');
this.el.setAttribute('class', 'ss-content');
if (this.direction === 'rtl') {
this.el.classList.add('rtl');
}
this.wrapper.appendChild(this.el);
while (this.target.firstChild) {
this.el.appendChild(this.target.firstChild);
}
this.target.appendChild(this.wrapper);
this.target.insertAdjacentHTML('beforeend', this.bar);
this.bar = this.target.lastChild;
dragDealer(this.bar, this);
this.moveBar();
w.addEventListener('resize', this.mB);
this.el.addEventListener('scroll', this.mB);
this.el.addEventListener('mouseenter', this.mB);
this.target.classList.add('ss-container');
var css = w.getComputedStyle(el);
if (css['height'] === '0px' && css['max-height'] !== '0px') {
el.style.height = css['max-height'];
}
this.unBind = function() {
//Remove event listeners
w.removeEventListener('resize', this.mB);
this.el.removeEventListener('scroll', this.mB);
this.el.removeEventListener('mouseenter', this.mB);
this.target.classList.remove('ss-container');
//Unwrap the initial content and remove remaining wrappers
this.target.insertBefore(this.content, this.wrapper);
this.target.removeChild(this.wrapper);
//Remove the bar including its drag-dealer event listener
this.target.removeChild(this.bar);
this.bar = null; //make way for the garbage collector
}
}
ss.prototype = {
moveBar: function(e) {
var totalHeight = this.el.scrollHeight,
ownHeight = this.el.clientHeight,
_this = this;
this.scrollRatio = ownHeight / totalHeight;
var isRtl = _this.direction === 'rtl';
var right = isRtl ?
(_this.target.clientWidth - _this.bar.clientWidth + 18) :
(_this.target.clientWidth - _this.bar.clientWidth) * -1;
raf(function() {
// Hide scrollbar if no scrolling is possible
if(_this.scrollRatio >= 1) {
_this.bar.classList.add('ss-hidden')
} else {
_this.bar.classList.remove('ss-hidden')
_this.bar.style.cssText = 'height:' + Math.max(_this.scrollRatio * 100, 10) + '%; top:' + (_this.el.scrollTop / totalHeight ) * 100 + '%;right:' + right + 'px;';
}
});
}
}
function initAll() {
var nodes = d.querySelectorAll('*[ss-container]');
for (var i = 0; i < nodes.length; i++) {
initEl(nodes[i]);
}
}
function unbindAll() {
var nodes = d.querySelectorAll('.ss-container');
for (var i = 0; i < nodes.length; i++) {
unbindEl(nodes[i]);
}
}
d.addEventListener('DOMContentLoaded', initAll);
ss.initEl = initEl;
ss.initAll = initAll;
ss.unbindEl = unbindEl;
ss.unbindAll = unbindAll;
var SimpleScrollbar = ss;
return SimpleScrollbar;
});

View File

@ -1,83 +0,0 @@
class WdeScrollBar{
// max = 0
// isDragged = false
/**
* @param {HTMLElement} handler
*/
constructor(handler){
console.log( handler.clientHeight)
let max = handler.parentElement.clientHeight - handler.clientHeight
let yOffset = null
let yPosInit = 0
handler.addEventListener('mousedown', (event) => {
// yOffset = event.offsetY
yPosInit = event.clientY - Number(handler.style.top.replace('px','' ))
// console.log()
document.addEventListener('mousemove', drag);
document.addEventListener('mouseup', stop)
//TODO Document dissallow select
})
function drag() {
console.log(event.clientY - yPosInit, Number(handler.style.top.replace('px','' )))
let pos = event.clientY - yPosInit
let clampPos = Math.min(Math.max(pos, 0), max)
handler.style.top = clampPos + "px";
// let yPos = Number(handler.style.top.replace('px', 0))
// console.log(event)
// console.log(yOffset)
// console.log(event.movementY)
// let pos = event.clientY - handler.clientHeight
// console.log(pos)
// let pos2 = yPos + event.movementY
// console.log(event.clientY - yPosInit)
// console.log(event.offsetY)
// yPos += event.yOffset
// handler.style.top = event.clientY - yPosInit + 'px'
// console.log(handler.Y)
// let pos = yPosInit - event.clientY
// let newPos = Math.min(Math.max(pos, 0), max)
// console.log(handler.style.top , event.offsetY)
// handler.style.top = event.clientY+ "px";
}
function stop() {
console.log("stop")
document.removeEventListener('mousemove', drag);
document.removeEventListener('mouseup', stop)
}
}
// /**
// * @param {HTMLElement} element
// */
// BindHandler(element) {
// element.addEventListener('mousedown', (event) => {
// this.isDragged =
// element.addEventListener('mouseup', this.stop);
// });
// element.removeEventListener
// }
// drag(){
// }
// stop(doc){
// console.log("stop")
// doc.removeEventListener('mouseup', (event) => {
// this.stop(document)
// });
// }
// MoveHandler(param) {
// console.log("Move")
// }
}

BIN
resources/virtue.ttf (Stored with Git LFS)

Binary file not shown.

View File

@ -1,18 +1,19 @@
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
wde = new WebDesktopEnvironment wde = new WebDesktopEnvironment
}, false); }, false);
class WebDesktopEnvironment{ class WebDesktopEnvironment{
constructor(){ constructor(){
this.wc = new WindowsCompositor this.wc = new WindowsCompositor
//Get basic window ready frame //Get basic window ready frame
fetch("http://localhost:8080/system/wde/getbasicwindow") //TODO Move to wde func fetch("http://192.168.88.10:8080/system/wde/getbasicwindow") //TODO Move to wde func
.then((response) => response.text()) .then((response) => response.text())
.then((html) => { .then((html) => {
WebDesktopEnvironment.SetBasicWindow(html) WebDesktopEnvironment.SetBasicWindow(html)
let app = this.loadApp("personal-properties") let app = this.loadApp("personal-properties")
// let finder = this.loadApp("finder")
}) })
.catch((error) => { .catch((error) => {
WebDesktopEnvironment.Alert(error); WebDesktopEnvironment.Alert(error);
@ -26,12 +27,10 @@ class WebDesktopEnvironment{
loadApp(appId){ loadApp(appId){
let newApp = document.createElement("application") let newApp = document.createElement("application")
newApp.setAttribute("id", `application-${appId}`) newApp.setAttribute("id", `application-${appId}`)
let appElem = document.getElementById("WindowsLayer").appendChild(newApp) let appElem = document.getElementById("WindowsLayer").appendChild(newApp)
let script = document.createElement("script") let script = document.createElement("script")
script.setAttribute("src", `http://localhost:8080/system/applications/${appId}/app.js`) script.setAttribute("src", "http://192.168.88.10:8080/system/applications/personal-properties/app.js")
script.setAttribute("async", "false") script.setAttribute("async", "false")
appElem.appendChild(script) appElem.appendChild(script)
script.addEventListener("load", function () { script.addEventListener("load", function () {
@ -40,44 +39,16 @@ class WebDesktopEnvironment{
}, false) }, false)
} }
/**
* @param {string} appId
* @param {string} windowName
* @param {number} width
* @param {number} height
* @returns {HTMLElement}
*/
static CreateNewWindow(appId, windowName, width, height) {
let appElem = document.getElementById(`application-${appId}`)
let newWindow = document.createElement("div")
newWindow.setAttribute("class", "StandartApplicationWindow")
newWindow.style.position = "absolute"
newWindow.style.width = width.toString() + "px"
newWindow.style.height = height.toString() + "px"
return appElem.appendChild(newWindow)
}
/**
* @param {HTMLElement} window
*/
static CloseWindow(window) {
let app = window.parentElement
window.remove()
// console.log(app.childElementCount)
if (app.childElementCount < 2){
console.log(app)
app.remove()
}
}
static basicWindow static basicWindow
/** /**
*
* @param {string} html * @param {string} html
*/ */
static SetBasicWindow(html){ static SetBasicWindow(html){
this.basicWindow = html this.basicWindow = html
} }
/** /**
*
* @returns {string} * @returns {string}
*/ */
static GetBasicWindow(){ static GetBasicWindow(){
@ -85,10 +56,6 @@ class WebDesktopEnvironment{
return this.basicWindow return this.basicWindow
} }
/**
*
* @param {string} alertText
*/
static Alert(alertText){ static Alert(alertText){
console.log(alertText) console.log(alertText)
} }
@ -126,6 +93,7 @@ class WindowsCompositor{
} else { } else {
} }
}) })
} }
@ -133,11 +101,9 @@ class WindowsCompositor{
* @param {MouseEvent} event * @param {MouseEvent} event
*/ */
catchClick(event){ catchClick(event){
switch (true) { switch (true) {
case event.target.className == "WindowFrameTopBar": case event.target.className == "TestWindowHeader":
this.movingElement = event.target.parentElement this.movingElement = event.target.parentElement.parentElement.parentElement
// console.log(this.movingElement)
break; break;
default: default:
break; break;
@ -149,10 +115,9 @@ class WindowsCompositor{
* @param {number} posX * @param {number} posX
* @param {number} posY * @param {number} posY
*/ */
dragElement(element, posX, posY) { //TODO dragElement(element, posX, posY) {
console.log() element.style.left = posX + "px";
element.style.left = (posX - element.clientWidth*0.5)+ "px"; element.style.top = posY + "px";
element.style.top = (posY - element.children[0].clientHeight*0.5) + "px";
} }
} }

View File

@ -1,213 +1,24 @@
.StandartApplicationWindow{ .WindowFrameTopBarButton{
/* Auto layout */
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 4px;
padding-right: 6px;
gap: 4px;
position: relative;
background: #CCCCCC;
border: 1px solid #000000;
box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.25), inset -1px -1px 0px rgba(0, 0, 0, 0.27), inset 1px 1px 0px #FFFFFF;
/* Inside auto layout */
flex: none;
order: 1;
align-self: stretch;
flex-grow: 1;
/* width: 100%;
background-color: #CCCCCC;
border: 1px solid #000000;
box-shadow: 1px 1px 0px #000,
inset -1px -1px 0px rgba(0, 0, 0, 0.27),
inset 1px 1px 0px #FFFFFF;
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 4px;
gap:4px;
overflow: hidden; */
}
.ContentBorder {
width: 100%;
height: 100%;
background-color: #DDDDDD;
border: 1px solid #000000;
box-shadow: -1px -1px 0px rgba(0, 0, 0, 0.25),
1px 1px 0px #FFFFFF,
inset -1px -1px 0px rgba(0, 0, 0, 0.27),
inset 1px 1px 0px #FFFFFF;
overflow: hidden;
overflow-x: hidden;
/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-start;
padding: 0px;
}
.WindowFrameTopBarButton{
width: 11px; width: 11px;
height: 11px; height: 11px;
padding: 0%; padding: 0%;
background: linear-gradient(135deg, #999999 18.18%, #FFFFFF 81.82%); background: #D9D9D9;
border: 1px solid #222222; border: 1px solid #222222;
box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF,
-0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25), -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25),
inset 1px 1px 0px rgba(255, 255, 255, 0.5), inset 1px 1px 0px #FFFFFF,
inset -1px -1px 0px rgba(0, 0, 0, 0.27); inset -1px -1px 0px rgba(0, 0, 0, 0.25);
/* Inside auto layout */ /* Inside auto layout */
flex: none; flex: none;
order: 0; order: 0;
flex-grow: 0; flex-grow: 0;
} }
.WindowFrameTopBar{
width: 100%;
height: 13px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
gap: 5px;
padding: 0px;
/* Inside auto layout */
flex: none;
order: 0;
align-self: stretch;
flex-grow: 0;
}
.WindowFrameTopBar .WindowFrameTitle{
position: relative;
top:1px;
pointer-events: none;
white-space: nowrap;
font-family: "Virtue";
letter-spacing: 0.35px;
}
.WindowFrameTopBarButton:active { .WindowFrameTopBarButton:active {
background-color: rgba(0, 0, 0, 0.4); /* Green */ background-color: rgba(0, 0, 0, 0.4); /* Green */
box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF, box-shadow: 0.5px 0.5px 0px 0.5px #FFFFFF,
-0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25); -0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25);
}
.WindowDragArea{
pointer-events: none;
width: 100%;
height: 100%;
background: linear-gradient(transparent 0%,white 0%, white 50%, transparent 50%);
background-size: 2px 2px;
filter: drop-shadow(1px 1px 0px #777777);
}
.scroller {
overflow-y: scroll;
scrollbar-color: #0A4C95 #C2D2E4;
border-radius: 0px;
}
.scroll_content {
position: relative;
width: 400px;
height: 414px;
top: -17px;
padding: 20px 10px 20px 10px;
overflow-y: auto;
}
.ScrollbarPlace{
overflow: hidden;
border-left: 1px solid #000000;
width: 14px;
height: 100%;
bottom: 0px;
right: 0px;
width: 14px;
height: 100%;
background-color: #AAAAAA;
box-shadow: inset -1px 0px 0px rgba(255, 255, 255, 0.29), inset -2px 0px 0px rgba(255, 255, 255, 0.19), inset 1px 1px 0px rgba(0, 0, 0, 0.14), inset 2px 2px 0px rgba(0, 0, 0, 0.19);
/* Inside auto layout */
flex: none;
order: 0;
align-self: stretch;
flex-grow: 1;
}
.ScrollBarScrollElement{
position: relative;
width: 14px;
height: 31px;
background: #9999FF;
box-shadow: 0px -1px 0px #000000, 0px 1px 0px #000000, 0px 2px 0px rgba(0, 0, 0, 0.13), 0px 3px 0px rgba(0, 0, 0, 0.19), inset 0px 1px 0px rgba(255, 255, 255, 0.5), inset 1px 0px 0px rgba(255, 255, 255, 0.5), inset -1px -1px 0px rgba(102, 102, 204, 0.91);
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
gap: 5px;
padding: 0px;
}
.ScrollBarScrollElementDrag{
pointer-events: none;
/* background-color: #0A4C95; */
width: 7px;
height: 7px;
margin-left: -1px;
background: linear-gradient(transparent 0%,#CCCCFF 0%, #CCCCFF 50%, transparent 50%);
background-size: 2px 2px;
/* TODO white pixels in rows start */
filter: drop-shadow(1px 1px 0px #333399);
} }

View File

@ -1,22 +0,0 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<title>Greg Brzezinski</title>
<head>
<link rel="stylesheet" type="text/css" href="res/base.css">
<link rel="stylesheet" type="text/css" href="res/wdeUI.css">
<link rel="stylesheet" href="/res/sys/wde/simple-scrollbar.css">
<link rel="stylesheet" href="/res/sys/personal-properties/personal-properies.css">
<script src="/res/sys/wde/wde-scrollbar.js"></script>
<script src="res/wde.js"></script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> -->
<!-- <script src="res/decorat.js"></script> -->
<!-- TODO Load with app -->
<!-- <script src="res/personal-properties.js"></script> -->
</head>
<body>
<div id="WindowsLayer"></div>
<!-- <div id="TestWindow" style="width: 100px; height: 100px; background-color: darkkhaki; position: absolute;" >
<div id="TestWindowHeader" class="WindowDragArea" style="width: 100%;height: 15px; background-color: cornflowerblue;">
</div> -->
</body>
</html>

View File

@ -1,5 +0,0 @@
{{ define "finder/app.tmpl" }}
Test Finder
{{ end }}

View File

@ -1,113 +0,0 @@
{{ define "personal-properties/app.tmpl" }}
<!-- <div id="WindowBorder" class="PersonalPropertiesFrame"> -->
<div id="TestWindowHeader" class="WindowFrameTopBar">
<button id="closeWindowButton" class="WindowFrameTopBarButton" title="Close Window"></button>
<div id="Drag" class="WindowDragArea"></div>
<div class="WindowFrameTitle">
About me
</div>
<div id="Drag" class="WindowDragArea"></div>
</div>
<!-- <div class="ContentBorder"></div> -->
<div class="ContentBorder">
<div class="ScrollContent">
<div class="PropertiesList">
<div class="Personal-properties-bio">
<img src="res/img/default-avatar-photo-placeholder-profile-picture-vector.jpg" alt="My Photo" style="width: 48px;height: 48px;">
<div class="Personal-properties-textbio">
<div>{{ .Name }}</div>
<div>{{ .BasicBio }}</div>
</div>
</div>
{{ range $propIsland := .allprops }}
<div id="prop" class="Personal-properties-prop">
<div class="Personal-properties-prop-title">
{{$propIsland.Header}}:
</div>
<div class="Personal-properties-prop-content">
{{range $prop := $propIsland.Props}}
<div class="Personal-properties-prop-row">
<div class="Personal-properties-prop-key">
{{$prop.Key}}:
{{ range $value := $prop.KeyComments }}
<div class="Personal-properties-prop-key-comments">
{{ $value }}
</div>
{{ end }}
</div>
<div class="Personal-properties-prop-values">
{{ range $value := $prop.Values }}
<div class="Personal-properties-prop-value">
{{ $value }}
</div>
{{ end }}
</div>
</div>
{{ end }}
</div>
</div>
{{ end }}
</div>
</div>
<div class="ScrollbarPlace">
<div class="ScrollBarScrollElement">
<div class="ScrollBarScrollElementDrag">
</div>
</div>
</div>
<!-- <div class="TestContent" style="width: 100%; height: auto; background-color: aquamarine;">AAAAAAAAAAAAAA</div>
<div id="ContentFrame " class="ContentFrame">
<div class="Personal-properties-bio">
<img src="res/img/default-avatar-photo-placeholder-profile-picture-vector.jpg" alt="My Photo" style="width: 48px;height: 48px;">
<div class="Personal-properties-textbio">
<div>{{ .Name }}</div>
<div>{{ .BasicBio }}</div>
</div>
</div>
<div id="Test content" style="width: 100%; height: 1000px; background-color: aqua;">
</div>
{{ range $propIsland := .allprops }}
<div id="prop" class="Personal-properties-prop">
<div class="Personal-properties-prop-title">
{{$propIsland.Header}}:
</div>
<div class="Personal-properties-prop-content">
{{range $prop := $propIsland.Props}}
<div class="Personal-properties-prop-row">
<div class="Personal-properties-prop-key">
{{$prop.Key}}:
{{ range $value := $prop.KeyComments }}
<div class="Personal-properties-prop-key-comments">
{{ $value }}
</div>
{{ end }}
</div>
<div class="Personal-properties-prop-values">
{{ range $value := $prop.Values }}
<div class="Personal-properties-prop-value">
{{ $value }}
</div>
{{ end }}
</div>
</div>
{{ end }}
</div>
</div>
{{ end }}
</div>
<div class="ScrollbarPlace">
<div class="ScrollBarScrollElement">
<div class="ScrollBarScrollElementDrag">
</div>
</div>
</div> -->
</div>
<!-- </div> -->
{{ end }}

View File

@ -1,7 +0,0 @@
{{ define "posts/index.tmpl" }}
<html><h1>
{{ .title }}
</h1>
<p>Using posts/index.tmpl</p>
</html>
{{ end }}

View File

@ -1,7 +0,0 @@
{{ define "users/index.tmpl" }}
<html><h1>
{{ .title }}
</h1>
<p>Using users/index.tmpl</p>
</html>
{{ end }}

View File

@ -1,22 +0,0 @@
package finder
import (
"personalwebsite/websiteapp"
"github.com/gin-gonic/gin"
)
type FinerApplication struct {
manifest websiteapp.ApplicationManifest
}
func (f *FinerApplication) GetManifest() websiteapp.ApplicationManifest {
return f.manifest
}
func (f *FinerApplication) GetId() string {
return f.manifest.AppId
}
func (f *FinerApplication) Render() gin.H {
return gin.H{}
}

View File

@ -37,105 +37,57 @@ func (p *PersonalPropertiesApp) Render() gin.H {
// Title: "Title 2", // Title: "Title 2",
// Author: "Author 2", // Author: "Author 2",
// }) // })
allProps := make([]PropIsland, 0) allProps := make([][]Prop, 0)
// careerProps := make([]Prop, 0) basicInfo := make([]Prop, 0)
expertiseIsland := PropIsland{
Header: "Area Of Expertise", basicInfo = append(basicInfo, Prop{
Props: []PropElement{{ Key: "",
Key: "Programming", Prop: "Greg Brzezinski",
Values: []string{ })
"Creating tools and plugins for artists",
"Editor and basic gameplay scripting", basicInfo = append(basicInfo, Prop{
}, Key: "",
Prop: "Saint-Petersburg",
})
// careerkeys := make([]Prop, 0)
careerkeys := []Prop{
{
Key: "VR lab assistant",
Prop: "111",
}, },
{ {
Key: "Game Art", Key: "3d artist",
Values: []string{ Prop: "qweqwe",
"Professional modeling", },
"Complete knowledge in CG render theory", {
}, Key: "Jr. Techartist",
}, Prop: "qweqwaaae",
}, },
} }
eduIsland := PropIsland{ // careerkeys = append(careerkeys, Prop{
Header: "Education", // Key: "VR lab assistant ",
Props: []PropElement{ // Prop: "ALSK jlkJls kdfgjasdp jk sdf",
{ // })
Key: "Gymnasium 526", // careerkeys = append(careerkeys, Prop{
KeyComments: []string{"2005-2015"}, // Key: "3d artist",
Values: []string{"Extended natural sciences course", "Additional C++, media production and computer graphics courses", "Winner of conference “The future of a strong Russia is in high technology” in programming section"}, // Prop: "qweqwe",
}, // })
{ // careerkeys = append(careerkeys, Prop{})
Key: "Lyceum 281", testKeys := []Prop{}
KeyComments: []string{"2015-2016"}, testKeys = append(testKeys, Prop{
Values: []string{"Extended IT and Physical sciences course"}, Key: "Urrtt",
}, Prop: "BakaBaka",
{ })
Key: "University",
KeyComments: []string{"2017-2019"}, allProps = append(allProps, careerkeys, testKeys, testKeys, testKeys)
Values: []string{"Faculty: Info-communication Networks and Systems", "Specialty: Information Security"},
},
},
}
careerProps := PropIsland{
Header: "Career",
Props: []PropElement{
{
Key: "VR lab assistant",
KeyComments: []string{"Academy of Digital Technologies", "2019-2020"},
Values: []string{"Teaching lessons for students in Unreal Engine 4, Unity and Blender editor courses", "Training students for World Skills Russia"},
},
{
Key: "3d artist",
KeyComments: []string{"Space Time VR", "2020-2020"},
Values: []string{"Creating 3d assets for VR game"},
},
{
Key: "Jr. Techartist",
KeyComments: []string{"MP Games"},
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"},
},
},
}
volunteerProps := PropIsland{
Header: "Volunteer Experience",
Props: []PropElement{
{
Key: "Metrostroi Mod",
Values: []string{
"Help unite fragmented community on one social platform",
"Worked on social elements of official site, create ranking",
"Took a part on creating ranking system for players",
"Creating models and maps for Steam Workshop"},
},
{
Key: "Age of Silence",
Values: []string{
"Start as tech-artist, create naming system in big ue4 project",
"Promoted to chief of 3d Department",
"Project win Unreal Day 2019",
},
},
},
}
// testKeys := PropIsland{
// Header: "Test",
// Props: []PropElement{{
// Key: "Urtt",
// Values: []string{"BakaBaka"},
// }},
// }
allProps = append(allProps, expertiseIsland, careerProps, eduIsland, volunteerProps)
return gin.H{ return gin.H{
"Name": "Greg Brzezinski", "Name": "Greg Brzezinski",
"BasicBio": "Born 27.09.1998 at Saint-Petersburg", "BasicBio": "Born 27.09.1998 at Saint-Petersburg",
// "BasicInfo": basicInfo, "BasicInfo": basicInfo,
// "career": careerProps, // "books": books,
"career": careerkeys,
"allprops": allProps, "allprops": allProps,
} }
} }
@ -145,15 +97,9 @@ type Book struct {
Author string Author string
} }
type PropElement struct { type Prop struct {
Key string Key string
KeyComments []string Prop string
Values []string
}
type PropIsland struct {
Header string
Props []PropElement
} }
// func (p *PersonalPropertiesApp) GetContent(ctx *gin.Context) interface{} { // func (p *PersonalPropertiesApp) GetContent(ctx *gin.Context) interface{} {