diff --git a/staff/angelzrc/unsocial/compo.js b/staff/angelzrc/unsocial/compo.js deleted file mode 100644 index e11ec78b..00000000 --- a/staff/angelzrc/unsocial/compo.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Constructs Compo instances - * - * @param {HTMLElement} container The Dom container of the Compo instance - */ -function Compo(container) { - this.children = [] - this.container = container -} - - -Compo.prototype.add = function (child) { - this.children.push(child) - this.container.appendChild(child.container) -} - -Compo.prototype.remove = function () { - this.container.remove() -} - -Compo.prototype.addBehavior = function (type, callback) { - this.container.addEventListener(type, callback) -} - -/**Constructs Form instances */ -function Form() { - Compo.call(this, document.createElement('form')) -} - -Form.prototype = Object.create(Compo.prototype) -Form.prototype.constructor = Form - -Form.prototype.reset = function () { - this.container.reset() -} - - -function Button(text, type) { - Compo.call(this, document.createElement('button')) - - this.container.innerText = text - this.container.type = type -} - -Button.prototype = Object.create(Compo.prototype) -Button.prototype.constructor = Button - -function Label(text, id) { - Compo.call(this, document.createElement('label')) - - this.container.innerText = text - this.container.htmlfor = id -} - -Label.prototype = Object.create(Compo.prototype) -Label.prototype.constructor = Label - -function Input(type, id) { - Compo.call(this, document.createElement('input')) - this.container.type = type - this.container.id = id -} - -Input.prototype = Object.create(Compo.prototype) -Input.prototype.constructor = Input - -Input.prototype.getValue = function (value) { - return this.container.value -} - -Input.prototype.setValue = function (value) { - this.container.value = value -} - -function Heading(text, level) { - Compo.call(this, document.createElement('h' + level)) - this.container.innerText = text -} - -Heading.prototype = Object.create(Compo.prototype) -Heading.prototype.constructor = Heading - -function Link(text) { - Compo.call(this, document.createElement('a')) - this.container.href = '' - this.container.innerText = text -} - -Link.prototype = Object.create(Compo.prototype) -Link.prototype.constructor = Link - diff --git a/staff/angelzrc/unsocial/data/posts.js b/staff/angelzrc/unsocial/data/posts.js new file mode 100644 index 00000000..ab99b59f --- /dev/null +++ b/staff/angelzrc/unsocial/data/posts.js @@ -0,0 +1,14 @@ +const posts = [ + { + image: 'https://i.pinimg.com/originals/8c/60/1a/8c601a25311a1a5098896f751a784b54.jpg', + text: 'here we are', + username: 'peterpan', + date: new Date + }, + { + image: 'https://pm1.aminoapps.com/8360/ad07e2d2cdf6e1733328d6e7b7848b87db38a2bbr1-1536-2048v2_hq.jpg', + text: 'here i am', + username: 'wendydarling', + date: new Date + } +] \ No newline at end of file diff --git a/staff/angelzrc/unsocial/data.js b/staff/angelzrc/unsocial/data/users.js similarity index 92% rename from staff/angelzrc/unsocial/data.js rename to staff/angelzrc/unsocial/data/users.js index 7478bdcb..702bf71f 100644 --- a/staff/angelzrc/unsocial/data.js +++ b/staff/angelzrc/unsocial/data/users.js @@ -1,4 +1,4 @@ -var users = [ +const users = [ { name: 'Peter Pan', email: 'peter@pan.com', username: 'peterpan', password: '123123123' }, { name: 'Wendy Darling', email: 'wendy@darling.com', username: 'wendydarling', password: '123123123' } ] \ No newline at end of file diff --git a/staff/angelzrc/unsocial/index.html b/staff/angelzrc/unsocial/index.html index 7134efac..4fae9185 100644 --- a/staff/angelzrc/unsocial/index.html +++ b/staff/angelzrc/unsocial/index.html @@ -5,20 +5,29 @@