forked from makesites/construct
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·39 lines (31 loc) · 853 Bytes
/
main.js
File metadata and controls
executable file
·39 lines (31 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(function() {
// Creates an object based in the HTML Element prototype
var el = Object.create(HTMLElement.prototype);
var $3d;
// Fires when an instance of the element is created
el.createdCallback = function() {
// gather options
var options = {};
// ...
options.el = this;
// init
$( this ).three(function( context ){
// save 3d context
$3d = context;
// create ShadowDOM
// ...
});
};
// Fires when an instance was inserted into the document
el.attachedCallback = function() {};
// Fires when an instance was removed from the document
el.detachedCallback = function() {
view.destroy();
};
// Fires when an attribute was added, removed, or updated
el.attributeChangedCallback = function(attr, oldVal, newVal) {};
document.registerElement('construct-3d', {
prototype: el,
extends: 'div'
});
}());