Browse Source

init test

lateri 4 years ago
parent
commit
5f9eefd47a
7 changed files with 52825 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 1 0
      app.min.js
  3. 51018 0
      js/three.module.js
  4. 885 0
      js/tvSysBtnBind.v2.1.js
  5. 793 0
      js/tween.esm.js
  6. 127 0
      pano3.html
  7. 0 0
      test.md

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+panos

File diff suppressed because it is too large
+ 1 - 0
app.min.js


File diff suppressed because it is too large
+ 51018 - 0
js/three.module.js


+ 885 - 0
js/tvSysBtnBind.v2.1.js

@@ -0,0 +1,885 @@
+try {
+    (function(arr) {
+        arr.forEach(function(item) {
+            if (item.hasOwnProperty('remove')) {
+                return
+            }
+            Object.defineProperty(item, 'remove', {
+                configurable: true,
+                enumerable: true,
+                writable: true,
+                value: function remove() {
+                    this.parentNode.removeChild(this)
+                }
+            })
+        })
+    })([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
+    if (!("classList" in document.documentElement)) {
+        Object.defineProperty(HTMLElement.prototype, 'classList', {
+            get: function() {
+                var self = this;
+
+                function update(fn) {
+                    return function(value) {
+                        var classes = self.className.split(/\s+/g),
+                            index = classes.indexOf(value);
+                        fn(classes, index, value);
+                        self.className = classes.join(" ")
+                    }
+                }
+                return {
+                    add: update(function(classes, index, value) {
+                        if (!~index) classes.push(value)
+                    }),
+                    remove: update(function(classes, index) {
+                        if (~index) classes.splice(index, 1)
+                    }),
+                    toggle: update(function(classes, index, value) {
+                        if (~index) classes.splice(index, 1);
+                        else classes.push(value)
+                    }),
+                    contains: function(value) {
+                        return !!~self.className.split(/\s+/g).indexOf(value)
+                    },
+                    item: function(i) {
+                        return self.className.split(/\s+/g)[i] || null
+                    }
+                }
+            }
+        })
+    }
+
+    function fireKeyEvent(el, evtType, keyCode) {
+        var doc = el.ownerDocument,
+            win = doc.defaultView || doc.parentWindow,
+            evtObj;
+        if (doc.createEvent) {
+            if (win.KeyEvent) {
+                evtObj = doc.createEvent('KeyEvents');
+                evtObj.initKeyEvent(evtType, true, true, win, false, false, false, false, keyCode, 0)
+            } else {
+                evtObj = doc.createEvent('UIEvents');
+                Object.defineProperty(evtObj, 'keyCode', {
+                    get: function() {
+                        return this.keyCodeVal
+                    }
+                });
+                Object.defineProperty(evtObj, 'which', {
+                    get: function() {
+                        return this.keyCodeVal
+                    }
+                });
+                evtObj.initUIEvent(evtType, true, true, win, 1);
+                evtObj.keyCodeVal = keyCode;
+                if (evtObj.keyCode !== keyCode) {}
+            }
+            el.dispatchEvent(evtObj)
+        } else if (doc.createEventObject) {
+            evtObj = doc.createEventObject();
+            evtObj.keyCode = keyCode;
+            el.fireEvent('on' + evtType, evtObj)
+        }
+    }
+} catch (e) {}
+
+function addClass(ele, cls) {
+    if (ele.classList) {
+        ele.classList.add(cls)
+    } else {
+        if (!this.hasClass(ele, cls)) ele.className += " " + cls
+    }
+}
+
+function arrIndexOf(arr, v) {
+    for (var i = 0; i < arr.length; i++) {
+        if (arr[i] == v) {
+            return i
+        }
+    }
+    return -1
+}
+
+function removeClass(ele, cls) {
+    if (ele.classList) {
+        ele.classList.remove(cls)
+    } else {
+        if (ele.className != '' && hasClass(ele, cls)) {
+            var arrClassName = ele.className.split(' ');
+            var classIndex = arrIndexOf(arrClassName, cls);
+            if (classIndex !== -1) {
+                arrClassName.splice(classIndex, 1);
+                ele.className = arrClassName.join(' ')
+            }
+        }
+    }
+}
+
+function toggleClass(ele, cls) {
+    if (hasClass(ele, cls)) {
+        removeClass(ele, cls)
+    } else {
+        addClass(ele, cls)
+    }
+}
+
+function hasClass(element, cls) {
+    return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1
+}
+
+function getClassNames(classStr, target, tagName) {
+    target = target ? target : document;
+    tagName = tagName ? tagName : "*";
+    if (document.getElementsByClassName) {
+        return target.getElementsByClassName(classStr)
+    } else {
+        var nodes = target.getElementsByTagName(tagName),
+            ret = [];
+        for (i = 0; i < nodes.length; i++) {
+            if (hasClass(nodes[i], classStr)) {
+                ret.push(nodes[i])
+            }
+        }
+        return ret
+    }
+}
+
+function getElementLeft(ele) {
+    var actualLeft = ele.offsetLeft;
+    var current = ele.offsetParent;
+    while (current !== null) {
+        actualLeft += current.offsetLeft;
+        current = current.offsetParent
+    }
+    return actualLeft
+}
+
+function getElementTop(ele) {
+    var actualTop = ele.offsetTop;
+    var current = ele.offsetParent;
+    while (current !== null) {
+        actualTop += current.offsetTop;
+        current = current.offsetParent
+    }
+    return actualTop
+}
+var contains = document.documentElement.contains ? function(parent, node) {
+    if (parent) {
+        return parent !== node && parent.contains(node)
+    }
+
+} : function(parent, node) {
+    if (parent) {
+        while (node && (node = node.parentNode))
+            if (node === parent) return true
+        return false
+    }
+
+}
+
+function getBoundingClientRect(ele) {
+    var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
+    var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
+    if (ele.getBoundingClientRect) {
+        if (typeof arguments.callee.offset !== 'number') {
+            var temp = document.createElement('div');
+            temp.style.cssText = "position:absolute;top:0;left:0";
+            document.body.appendChild(temp);
+            arguments.callee.offset = -temp.getBoundingClientRect().top - scrollTop;
+            document.body.removeChild(temp);
+            temp = null
+        }
+        var rect = ele.getBoundingClientRect();
+        var offset = arguments.callee.offset;
+        return {
+            left: rect.left + offset,
+            right: rect.right + offset,
+            top: rect.top + offset,
+            bottom: rect.bottom + offset,
+            width: (rect.right + offset) - (rect.left + offset),
+            height: (rect.bottom + offset) - (rect.top + offset)
+        }
+    } else {
+        var actualLeft = getElementLeft(ele);
+        var actualTop = getElementTop(ele);
+        var offsetWidth = ele.offsetWidth;
+        var offsetHeight = ele.offsetHeight;
+        return {
+            left: actualLeft - scrollLeft,
+            right: actualLeft + offsetWidth - scrollLeft,
+            top: actualTop - scrollTop,
+            bottom: actualTop + offsetHeight - scrollTop,
+            width: (actualLeft + offsetWidth - scrollLeft) - (actualLeft - scrollLeft),
+            height: (actualTop + offsetHeight - scrollTop) - (actualTop - scrollTop)
+        }
+    }
+}
+
+(function(window) {
+    var tvSysBtnBind = function(init) {
+        var _this = this,
+            _self = self;
+        var id = init.id ? init.id : null,
+            keyRemoveDefault = typeof init.keyRemoveDefault == "undefined" ? false : init.keyRemoveDefault,
+            currentIndex = init.currentIndex ? parseInt(init.currentIndex) : 0,
+            btnLeft = init.btnLeft ? init.btnLeft : 37,
+            btnUp = init.btnUp ? init.btnUp : 38,
+            btnRight = init.btnRight ? init.btnRight : 39,
+            btnDown = init.btnDown ? init.btnDown : 40,
+            btnEnter = init.btnEnter ? init.btnEnter : 13,
+            btnBack = init.btnBack ? init.btnBack : 27,
+            history = typeof init.history == "undefined" ? true : init.history,
+            doublePress = typeof init.doublePress == "undefined" ? false : init.doublePress,
+            isFloatLast = typeof init.isFloatLast == "undefined" ? false : init.isFloatLast,
+            isCentered = typeof init.isCentered == "undefined" ? true : init.isCentered,
+            currentClass = init.currentClass ? init.currentClass : "current",
+            effect = init.effect ? init.effect : "slide1",
+            element = new Array(),
+            rules = init.rules ? init.rules : { hotbutton: {} },
+            direction = "y";
+        _this.className = init.className ? init.className : "hotbutton";
+        this.event = {};
+        var _tempElem;
+        this.currentIndex = parseInt(currentIndex);
+        this.defaultIndex = parseInt(currentIndex);
+        this.currentClass = currentClass;
+        this.historyFocus = {};
+        if (!window.focusobj) window.focusobj = document.createElement("span");
+        (typeof init.onLoad) == "function" ? init.onLoad: init.onLoad = function() {};
+        (typeof init.onBack) == "function" ? init.onLoad: init.onBack = function() {};
+        (typeof init.onCommPress) == "function" ? init.onCommPress: init.onCommPress = function() {};
+        this.onLoad = function() {
+            focusobj.innerHTML = '<div class="cssbk"><b class="lt"></b><b class="t"></b><b class="rt"></b><b class="r"></b><b class="rb"></b><b class="b"></b><b class="lb"></b> <b class="l"></b></div>';
+            addClass(focusobj, "focusobj");
+            addClass(focusobj, "current");
+            focusobj.style.display = "none";
+            _this.target = init.id ? document.getElementById(init.id) : document.body;
+            _this.defaultTarget = _this.target;
+            _this.currentId = init.id ? init.id : "Jdoc";
+            self.getCurRule();
+            _this.reLoad();
+            _this.sourceClassName = _this.className;
+            _this.sourceLength = element.length;
+            _this.prev = element[currentIndex];
+            _this.prevIndex = currentIndex;
+            _this.current = element[currentIndex];
+            _this.currentIndex = currentIndex;
+            _this.target.appendChild(focusobj);
+            init.onLoad.call(_this);
+            window.focus();
+        }
+        self.getCurRule = function(item) {
+            var obj = {};
+            if (rules) {
+                obj = rules["#" + _this.currentId + ">." + _this.className];
+                if (typeof obj == "undefined") {
+                    if (rules[_this.className]) {
+                        obj = rules[_this.className]
+                    }
+                }
+                if (item && typeof rules[item] == "undefined") {
+                    // rules[item]={};
+                }
+            }
+            return obj
+        }
+        this.reSetClass = function(item, index, curClass) {
+            var obj = _self.getCurRule(item);
+            if (!obj) {
+                console.log("初始化" + _this.className + "失败");
+                return
+            }
+            if (typeof obj["history"] == "undefined") obj["history"] = history;
+            if (obj["history"]) _this.historyFocus[_this.currentId + _this.className] = _this.currentIndex;
+            _this.prevCurrentClass = _this.currentClass;
+            if (curClass) {
+                _this.currentClass = curClass
+            }
+            var arr = item.split(">");
+            for (var i = 0; i < arr.length; i++) {
+                if (arr[i] == "") arr.splice(i)
+            }
+            for (var i = 0; i < arr.length; i++) {
+                if (arr[i].indexOf("#") != -1) {
+                    _this.currentId = arr[i].replace("#", "");
+                    if (document.getElementById(_this.currentId)) _this.target = document.getElementById(_this.currentId)
+                }
+                if (arr[i].indexOf(".") != -1) {
+                    item = arr[i].replace(".", "")
+                }
+                if (arr[i].indexOf(".") == -1 && arr[i].indexOf("#") == -1) {
+                    item = arr[i]
+                }
+            }
+            if (getClassNames(item, _this.target).length > 0) {
+                _self.newItem(item, index)
+            } else {
+                _this.target = _this.defaultTarget;
+                if (getClassNames(item, _this.target).length > 0) _self.newItem(item, index)
+            }
+        }
+        this.onCommPress = function(e) {
+            init.onCommPress.call(_this)
+        }
+        self.newItem = function(item, index) {
+            var obj = _self.getCurRule();
+            if (_this.prev) removeClass(_this.prev, _this.currentClass);
+            if (typeof _this.historyFocus[_this.currentId + item] == "undefined") _this.historyFocus[_this.currentId + item] = 0;
+            _this.className = item;
+            var idx = obj["savelastIndex"] ? _this.currentIndex : 0;
+            index = index > getClassNames(item, _this.target).length - 1 ? getClassNames(item, _this.target).length - 1 : index;
+            idx = _this.historyFocus[_this.currentId + item] ? _this.historyFocus[_this.currentId + item] : idx;
+            _this.currentIndex = typeof index != "undefined" ? index : idx;
+            _this.prevIndex = _this.currentIndex;
+            _this.reLoad()
+        }
+        self.readFn = function() {
+            if ((typeof init.onEnterPress) == "function") {
+                init.onEnterPress
+            } else {
+                init.onEnterPress = function() {}
+            }
+            if ((typeof init.onPress) == "function") {
+                init.onPress
+            } else {
+                init.onPress = function() {}
+            }
+        }
+        this.reLoad = function() {
+            self.readFn();
+            element = getClassNames(_this.className, _this.target);
+            if (element.length <= 0) {
+                console.log("初始化" + _this.className + "失败");
+                return
+            }
+            this.hotbtn = element;
+            if (element.length <= 0) return false;
+            if (_this.currentIndex || _this.currentIndex == 0) {
+                _this.currentIndex = parseInt(_this.currentIndex)
+            } else {
+                _this.currentIndex = parseInt(init.currentIndex)
+            }
+            if (isload >= 2 && _this.sourceClass == _this.className && _this.sourceLength != element.length && !isSet) {
+                if (hasClass(_this.prev, _this.className) && _this.sourceLength > element.length) {
+                    _this.currentIndex = _this.currentIndex - (_this.sourceLength - element.length);
+                    _this.prevIndex = _this.prevIndex - (_this.sourceLength - element.length);
+                    _this.sourceLength = element.length
+                } else if (hasClass(_this.prev, _this.className) && _this.sourceLength < element.length) {
+                    _this.currentIndex = _this.currentIndex + (element.length - _this.sourceLength);
+                    _this.prevIndex = _this.prevIndex + (element.length - _this.sourceLength);
+                    _this.sourceLength = element.length
+                }
+            }
+            isSet = false;
+            self.overIndex();
+            _this.current = element[_this.currentIndex];
+            _this.currentIndex = _this.currentIndex;
+            _self.render(_this.currentIndex);
+            for (var i = 0; i < this.hotbtn.length; i++) {
+                this.hotbtn[i].setAttribute("data-id", i)
+            }
+        }
+
+        function keydefault(e) {
+            try {
+                e.preventDefault()
+            } catch (e) {}
+        }
+        var isSet = false;
+        this.setCurrentIndex = function(index) {
+            isSet = true;
+            index = parseInt(index);
+            _this.currentIndex = index;
+            _this.current = element[index]
+        }
+        this.pageScroll = function(ele, Scroll, direction) {
+            if (!ele["data-sum"]) ele["data-sum"] = 0;
+            if (!ele["data-sumx"]) ele["data-sumx"] = 0;
+            ele.style.position = "relative";
+            ele.children[0].style.position = "absolute";
+            if (direction == "up") {
+                if (ele["data-sum"] - Scroll > 0) {
+                    ele["data-sum"] = parseInt(ele["data-sum"]) - Scroll
+                } else {
+                    ele["data-sum"] = 0
+                }
+                ele.children[0].style.left = "0";
+                ele.children[0].style.top = "-" + ele["data-sum"] + "px"
+            } else if (direction == "down") {
+                var clientHeight = ele.children[0].clientHeight;
+                if (ele["data-sum"] + Scroll < clientHeight - ele.clientHeight / 2) {
+                    ele["data-sum"] = parseInt(ele["data-sum"]) + Scroll
+                } else {
+                    ele["data-sum"] = clientHeight - ele.clientHeight
+                }
+                ele.children[0].style.left = "0";
+                ele.children[0].style.top = "-" + ele["data-sum"] + "px"
+            } else if (direction == "left") {
+                if (ele["data-sumx"] - Scroll > 0) {
+                    ele["data-sumx"] = parseInt(ele["data-sumx"]) - Scroll
+                } else {
+                    ele["data-sumx"] = clientWidth - ele.clientWidth
+                }
+                ele.children[0].style.top = "0";
+                ele.children[0].style.left = "-" + ele["data-sumx"] + "px"
+            } else if (direction == "right") {
+                var clientWidth = ele.children[0].clientWidth;
+                if (ele["data-sumx"] + Scroll < clientWidth - ele.clientWidth / 2) {
+                    ele["data-sumx"] = parseInt(ele["data-sum"]) + Scroll
+                } else {
+                    ele["data-sumx"] = 0;
+                }
+                ele.children[0].style.top = "0";
+                ele.children[0].style.left = "-" + ele["data-sumx"] + "px"
+            }
+        }
+        this.viewScrollY = function(y, view) {
+            var maxTop = view.children[0].clientHeight - view.clientHeight;
+            var obj = self.getCurRule();
+            var sumtop = view.children[0]["ScrollY"] ? view.children[0]["ScrollY"] : 0;
+            var top = sumtop + y;
+            middle = getBoundingClientRect(view).height / 2 - getBoundingClientRect(_this.current).height / 2;
+            top = top + middle;
+            if (top > 0 || maxTop < 0) top = 0;
+            else if (Math.abs(top) > Math.abs(maxTop)) {
+                top = -maxTop;
+                //view.children[0]["ScrollY"] == 0 这个句忘记干嘛的了 留着
+            }
+            top = obj["customTop"] != undefined ? obj["customTop"] : top;
+            view.children[0].style.top = top + "px";
+            view.children[0]["ScrollY"] = top
+        }
+        var maxLeft = 0;
+        this.viewScrollX = function(x, view, viewWidth) {
+            var maxLeft = viewWidth - view.clientWidth;
+            var obj = self.getCurRule();
+            var sumleft = view.children[0]["ScrollX"] ? view.children[0]["ScrollX"] : 0;
+            var left = sumleft + x;
+            middle = getBoundingClientRect(view).width / 2 - getBoundingClientRect(_this.current).width / 2;
+            left = left + middle;
+            if (left > 0 || maxLeft < 0) left = 0;
+            else if (Math.abs(left) > Math.abs(maxLeft)) {
+                left = -maxLeft;
+            }
+            left = obj["customLeft"] != undefined ? obj["customLeft"] : left;
+            view.children[0].style.left = left + "px";
+            view.children[0]["ScrollX"] = left
+        }
+        this.onPress = function(e) {
+            init.onPress.call(_this)
+        }
+        this.onEnterPress = function() {
+            init.onEnterPress.call(_this)
+        }
+        window.onBackEvent = this.onBack = function() {
+            init.onBack.call(_this)
+        }
+        self.getScrollTop = function() {
+            var scrollTop = 0;
+            if (document.documentElement && document.documentElement.scrollTop) {
+                scrollTop = document.documentElement.scrollTop
+            } else if (document.body) {
+                scrollTop = document.body.scrollTop
+            }
+            return scrollTop
+        }
+        this.scroll = function(view, direction) {
+            var obj = self.getCurRule();
+            if (obj == undefined || !obj["direction"]) return;
+
+            direction = direction ? direction : obj["direction"];
+            var viewX = view ? view : obj["directionParentX"] ? obj["directionParentX"] : obj["directionParent"] ? obj["directionParent"] : _this.current.parentNode.parentNode;
+            var viewY = view ? view : obj["directionParentY"] ? obj["directionParentY"] : obj["directionParent"] ? obj["directionParent"] : _this.current.parentNode.parentNode;
+            var sum = 0;
+            if (direction.indexOf("x") > -1) {
+                if (viewX instanceof Array) {
+                    for (var i = 0; i < viewX.length; i++) {
+
+                        if (contains(viewX[i], _this.current)) {
+                            viewX = viewX[i];
+                        }
+                    }
+                }
+
+                if (viewX instanceof Array || !contains(viewX, _this.current)) return;
+                for (var i = 0; i < _this.hotbtn.length; i++) {
+                    sum = getBoundingClientRect(_this.hotbtn[i]).width + sum
+                }
+                if (_this.hotbtn.length > 1) {
+                    if (!obj["scrollWidth"])
+                        sum = sum + Math.ceil(getBoundingClientRect(_this.hotbtn[1]).left - getBoundingClientRect(_this.hotbtn[0]).right) * (_this.hotbtn.length);
+                    else {
+                        sum = _this.hotbtn.length * obj["scrollWidth"]; //因为样式多样性,宽度获取并不准确 所以可以自定义
+                    }
+
+                } else {
+                    sum = sum;
+                }
+                viewX.style.position = "relative";
+                viewX.children[0].style.position = "absolute";
+                viewX.children[0].style.width = (sum + 30) + "px";
+                _this.viewScrollX(-(getBoundingClientRect(_this.current).left - getBoundingClientRect(viewX).left), viewX, sum)
+            }
+            if (direction.indexOf("y") > -1) {
+                if (viewY instanceof Array) {
+                    for (var i = 0; i < viewY.length; i++) {
+
+                        if (contains(viewY[i], _this.current)) {
+                            viewY = viewY[i];
+                        }
+                    }
+                }
+                if (viewY instanceof Array || !contains(viewY, _this.current)) return;
+                viewY.style.position = "relative";
+                viewY.children[0].style.position = "absolute";
+
+                _this.viewScrollY(-(getBoundingClientRect(_this.current).top - getBoundingClientRect(viewY).top), viewY)
+            }
+        }
+        var isload = 0;
+        self.render = function(index) {
+            if (_this.renderType == "self") return;
+            isload = isload + 1;
+            if (isload == 2) {
+                _this.sourceLength = element.length
+            }
+            if (_this.prevCurrentClass) {
+                var ele = getClassNames(_this.prevCurrentClass, _this.target);
+                for (var i = 0; i < ele.length; i++) {
+                    if (hasClass(ele[i], _this.prevCurrentClass)) {
+                        removeClass(ele[i], _this.prevCurrentClass)
+                    }
+                }
+            }
+            if (element[index]) addClass(element[index], _this.currentClass);
+            else return;
+            for (var i = 0; i < element.length; i++) {
+                if (i != index && hasClass(element[i], _this.currentClass)) {
+                    removeClass(element[i], _this.currentClass)
+                }
+            }
+            _this.scroll();
+            var effect = element[index].getAttribute("data-effect");
+            if (effect) {
+                focusobj.setAttribute("style", "  position: fixed; z-index: 19;width:" + (getBoundingClientRect(element[index]).width) + "px ;height:" + (getBoundingClientRect(element[index]).height) + "px; left:" + getBoundingClientRect(element[index]).left + "px;top:" + getBoundingClientRect(element[index]).top + "px;");
+                focusobj.setAttribute("class", "focusobj current " + effect);
+                focusobj.style.display = "list-item"
+            } else {
+                focusobj.setAttribute("style", "");
+                focusobj.style.display = "none"
+            }
+        }
+        self.EventUtil = {
+            add: function(obj, callback) {
+                if (typeof(obj.onkeypress) == "null") {
+                    obj.onkeypress = function(e) {
+                        callback && callback(e)
+                    }
+                } else {
+                    obj.onkeydown = function(e) {
+                        callback && callback(e)
+                    }
+                }
+            }
+        }
+        var _t, sum = 0;
+        EventUtil.add(document, function(e) {
+            _this.renderType = "self";
+            if (doublePress) {
+                if (sum < 2)
+                    clearTimeout(_t);
+                sum++;
+                _t = setTimeout(function() {
+                    _self.onPressFn(e)
+                    sum = 0;
+                }, 100)
+            } else {
+                _self.onPressFn(e);
+            }
+
+
+        });
+        self.overIndex = function() {
+            if (_this.currentIndex >= element.length - 1) {
+                _this.currentIndex = element.length - 1
+            }
+            if (_this.currentIndex < 0) {
+                _this.currentIndex = 0
+            }
+        }
+        self.isNumber = function(val) {
+            var regPos = /^\d+(\.\d+)?$/;
+            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;
+            if (regPos.test(val) || regNeg.test(val)) {
+                return true
+            } else {
+                return false
+            }
+        }
+        var distance = function(pointA, pointB, type) {
+            var P1 = getBoundingClientRect(pointA),
+                P2 = getBoundingClientRect(pointB);
+            var dist = 0;
+            switch (type) {
+                case "AA":
+                    dist = Math.sqrt(((P1.left - P2.left) * (P1.left - P2.left)) + ((P1.top - P2.top) * (P1.top - P2.top)))
+                    break;
+                case "AB":
+                    dist = Math.sqrt(((P1.left - P2.right) * (P1.left - P2.right)) + ((P1.top - P2.top) * (P1.top - P2.top)))
+                    break;
+                case "AC":
+                    dist = Math.sqrt(((P1.left - P2.right) * (P1.left - P2.right)) + ((P1.top - P2.bottom) * (P1.top - P2.bottom)))
+                    break;
+                case "AD":
+                    dist = Math.sqrt(((P1.left - P2.left) * (P1.left - P2.left)) + ((P1.top - P2.bottom) * (P1.top - P2.bottom)))
+                    break;
+                case "BA":
+                    dist = Math.sqrt(((P1.right - P2.left) * (P1.right - P2.left)) + ((P1.top - P2.top) * (P1.top - P2.top)))
+                    break;
+                case "BB":
+                    dist = Math.sqrt(((P1.right - P2.right) * (P1.right - P2.right)) + ((P1.top - P2.top) * (P1.top - P2.top)))
+                    break;
+                case "BC":
+                    dist = Math.sqrt(((P1.right - P2.right) * (P1.right - P2.right)) + ((P1.top - P2.bottom) * (P1.top - P2.bottom)))
+                    break;
+                case "BD":
+                    dist = Math.sqrt(((P1.right - P2.left) * (P1.right - P2.left)) + ((P1.top - P2.bottom) * (P1.top - P2.bottom)))
+                    break;
+                case "CA":
+                    dist = Math.sqrt(((P1.left - P2.left) * (P1.left - P2.left)) + ((P1.bottom - P2.top) * (P1.bottom - P2.top)))
+                    break;
+                case "CB":
+                    dist = Math.sqrt(((P1.left - P2.right) * (P1.left - P2.right)) + ((P1.bottom - P2.top) * (P1.bottom - P2.top)))
+                    break;
+                case "CC":
+                    dist = Math.sqrt(((P1.left - P2.left) * (P1.left - P2.left)) + ((P1.bottom - P2.bottom) * (P1.bottom - P2.bottom)))
+                    break;
+                case "CD":
+                    dist = Math.sqrt(((P1.right - P2.left) * (P1.right - P2.left)) + ((P1.bottom - P2.bottom) * (P1.bottom - P2.bottom)))
+                    break;
+                case "DA":
+                    dist = Math.sqrt(((P1.left - P2.left) * (P1.left - P2.left)) + ((P1.bottom - P2.top) * (P1.bottom - P2.top)))
+                    break;
+                case "DB":
+                    dist = Math.sqrt(((P1.right - P2.right) * (P1.right - P2.right)) + ((P1.bottom - P2.top) * (P1.bottom - P2.top)))
+                    break;
+                case "DC":
+                    dist = Math.sqrt(((P1.right - P2.left) * (P1.right - P2.left)) + ((P1.bottom - P2.bottom) * (P1.bottom - P2.bottom)))
+                    break;
+                case "DD":
+                    dist = Math.sqrt(((P1.right - P2.right) * (P1.right - P2.right)) + ((P1.bottom - P2.bottom) * (P1.bottom - P2.bottom)))
+                    break
+            }
+            return dist
+        }
+        self.ruleFn = function(index, direction) {
+            var obj = {};
+            if (rules) {
+                obj = _self.getCurRule()
+            }
+            if (obj && typeof obj == "object" && typeof obj["line"] != "undefined") {
+                var line = obj["line"]
+            } else {
+                var line = _this.hotbtn.length
+            }
+            line = parseInt(line);
+            if (obj && typeof obj == "object" && typeof obj[_this.currentIndex] != "undefined" && typeof obj[_this.currentIndex][index] != "undefined") {
+                var objRules = obj[_this.currentIndex];
+                if (self.isNumber(objRules[index])) {
+                    _this.currentIndex = parseInt(_this.currentIndex) + parseInt(objRules[index])
+                } else if (Array.isArray(objRules[index])) {
+                    _this.reSetClass(objRules[index][0], objRules[index][1], objRules[index][2])
+                } else if (typeof objRules[index] == "function") {
+                    objRules[index].call(_this)
+                } else if (typeof obj["line"] != "undefined") {
+                    _this.currentIndex = _this.currentIndex + line
+                }
+            } else {
+                var jump = element[_this.currentIndex].getAttribute("data-" + direction);
+                jump = parseInt(jump);
+                var max = Math.sqrt(window.screen.width * window.screen.width + window.screen.height * window.screen.height);
+                if (direction == "up") {
+                    if (_this.currentIndex > line - 1 && !obj["autoMove"]) _this.currentIndex = jump ? _this.currentIndex - jump : _this.currentIndex - line;
+                    else if (obj && typeof obj["up"] == "object") _this.reSetClass(obj["up"][0], obj["up"][1], obj["up"][2]);
+                    else if (obj && typeof obj["up"] == "function") obj["up"].call(_this)
+                    else {
+                        var min1 = max,
+                            min2 = max,
+                            curIndex = _this.currentIndex,
+                            curIndex2 = _this.currentIndex;
+                        for (var i = 0; i < _this.hotbtn.length; i++) {
+                            var cur1 = distance(_this.current, _this.hotbtn[i], "AD");
+                            var cur2 = distance(_this.current, _this.hotbtn[i], "BC");
+                            if (cur1 < min1 && cur1 > 0 && getBoundingClientRect(_this.current).top > getBoundingClientRect(_this.hotbtn[i]).top && _this.currentIndex > i) {
+                                min1 = cur1;
+                                curIndex = i;
+                            }
+
+                            if (cur2 < min2 && cur2 > 0 && getBoundingClientRect(_this.current).top > getBoundingClientRect(_this.hotbtn[i]).top && _this.currentIndex > i) {
+                                min2 = cur2;
+                                curIndex2 = i;
+                            }
+                        }
+                        curIndex = min1 < min2 ? curIndex : curIndex2;
+                        _this.currentIndex = curIndex;
+                    }
+                } else if (direction == "left") {
+                    if ((_this.currentIndex) % line != 0 && !obj["autoMove"]) _this.currentIndex = jump ? _this.currentIndex - jump : _this.currentIndex - 1;
+                    else if (obj && typeof obj["left"] == "object") _this.reSetClass(obj["left"][0], obj["left"][1], obj["left"][2]);
+                    else if (obj && typeof obj["left"] == "function") obj["left"].call(_this)
+                    else {
+                        var min1 = max,
+                            min2 = max
+                        curIndex = _this.currentIndex, curIndex2 = _this.currentIndex;
+                        for (var i = 0; i < _this.hotbtn.length; i++) {
+                            var cur1 = distance(_this.current, _this.hotbtn[i], "AB");
+                            var cur2 = distance(_this.current, _this.hotbtn[i], "DC");
+                            if (cur1 < min1 && cur1 > 0 && getBoundingClientRect(_this.current).left > getBoundingClientRect(_this.hotbtn[i]).left && _this.currentIndex > i) {
+                                min1 = cur1;
+                                curIndex = i;
+                            }
+
+                            if (cur2 < min2 && cur2 > 0 && getBoundingClientRect(_this.current).left > getBoundingClientRect(_this.hotbtn[i]).left && _this.currentIndex > i) {
+                                min2 = cur2;
+                                curIndex2 = i;
+                            }
+                        }
+                        curIndex = min1 < min2 ? curIndex : curIndex2;
+                        _this.currentIndex = curIndex
+                    }
+                } else if (direction == "right") {
+                    if ((_this.currentIndex + 1) % line != 0 && !obj["autoMove"]) _this.currentIndex = jump ? _this.currentIndex + jump : _this.currentIndex + 1;
+                    else if (obj && typeof obj["right"] == "object") _this.reSetClass(obj["right"][0], obj["right"][1], obj["right"][2]);
+                    else if (obj && typeof obj["right"] == "function") obj["right"].call(_this)
+                    else {
+                        var min1 = max,
+                            min2 = max,
+                            curIndex = _this.currentIndex,
+                            curIndex2 = _this.currentIndex;
+                        for (var i = 0; i < _this.hotbtn.length; i++) {
+                            var cur1 = distance(_this.current, _this.hotbtn[i], "BA");
+                            var cur2 = distance(_this.current, _this.hotbtn[i], "CD");
+
+                            if (cur1 < min1 && cur1 > 0 && getBoundingClientRect(_this.current).right < getBoundingClientRect(_this.hotbtn[i]).right && _this.currentIndex < i) {
+                                min1 = cur1;
+                                curIndex = i;
+                            }
+
+                            if (cur2 < min2 && cur2 > 0 && getBoundingClientRect(_this.current).right < getBoundingClientRect(_this.hotbtn[i]).right && _this.currentIndex < i) {
+                                min2 = cur2;
+
+                                curIndex2 = i;
+                            }
+                        }
+                        curIndex = min1 < min2 ? curIndex : curIndex2;
+                        _this.currentIndex = curIndex;
+                    }
+                } else if (direction == "down") {
+                    if (_this.hotbtn.length - line > _this.currentIndex && !obj["autoMove"]) _this.currentIndex = jump ? _this.currentIndex + jump : _this.currentIndex + line;
+                    else if (obj && typeof obj["down"] == "object") _this.reSetClass(obj["down"][0], obj["down"][1], obj["down"][2]);
+                    else if (obj && typeof obj["down"] == "function") obj["down"].call(_this);
+                    else if (_this.currentIndex + line > _this.hotbtn.length - 1 && _this.currentIndex + line <= (line - _this.hotbtn.length % line) + _this.hotbtn.length - 1 && _this.hotbtn.length % line != 0 && isFloatLast) {
+                        _this.currentIndex = _this.currentIndex + line;
+                        self.overIndex()
+                    } else {
+                        var min1 = max,
+                            min2 = max,
+                            curIndex = _this.currentIndex,
+                            curIndex2 = _this.currentIndex;
+                        for (var i = 0; i < _this.hotbtn.length; i++) {
+                            var cur1 = distance(_this.current, _this.hotbtn[i], "DA");
+                            var cur2 = distance(_this.current, _this.hotbtn[i], "CB");
+                            if (cur1 < min1 && cur1 > 0 && getBoundingClientRect(_this.current).bottom < getBoundingClientRect(_this.hotbtn[i]).bottom && _this.currentIndex < i) {
+                                min1 = cur1;
+                                curIndex = i;
+                            }
+                            if (cur2 < min2 && cur2 > 0 && getBoundingClientRect(_this.current).bottom < getBoundingClientRect(_this.hotbtn[i]).bottom && _this.currentIndex < i) {
+                                min2 = cur2;
+                                curIndex2 = i;
+                            }
+                        }
+
+                        curIndex = min1 < min2 ? curIndex : curIndex2;
+                        _this.currentIndex = curIndex;
+                    }
+                }
+            }
+        }
+        self.rule = function(keyCode) {
+            if (element.length <= 0) {
+                console.log("初始化" + _this.className + "失败");
+                return
+            }
+            self.overIndex();
+            if (keyCode == btnLeft) {
+                self.ruleFn(0, "left")
+            } else if (keyCode == btnRight) {
+                self.ruleFn(2, "right")
+            } else if (keyCode == btnUp) {
+                self.ruleFn(1, "up")
+            } else if (keyCode == btnDown) {
+                self.ruleFn(3, "down")
+            }
+            self.overIndex()
+        }
+        this.BACK = function() {
+            self.onPressFn("back")
+        }
+        this.LEFT = function() {
+            self.onPressFn("left")
+        }
+        this.RIGHT = function() {
+            self.onPressFn("right")
+        }
+        this.UP = function() {
+            self.onPressFn("up")
+        }
+        this.DOWN = function() {
+            self.onPressFn("down")
+        }
+        self.onPressFn = function(e) {
+            var keyCode = "";
+            if (typeof e == "object") {
+                keyCode = e.keyCode
+            } else {
+                if (e == "left") {
+                    keyCode = btnLeft
+                } else if (e == "right") {
+                    keyCode = btnRight
+                } else if (e == "up") {
+                    keyCode = btnUp
+                } else if (e == "down") {
+                    keyCode = btnDown
+                } else if (e == "back") {
+                    keyCode = btnBack
+                }
+            }
+            _this.event = e;
+            _this.currentIndex = _this.currentIndex >= element.length - 1 ? element.length - 1 : _this.currentIndex;
+            _this.prev = element[_this.currentIndex];
+            _this.prevIndex = _this.currentIndex;
+            self.rule(keyCode);
+            _this.current = element[_this.currentIndex];
+            _this.currentIndex = _this.currentIndex;
+            _this.className = _this.className;
+            _this.onCommPress.call(_this);
+            if (keyCode == 8 || keyCode == btnBack) {
+                if (rules["#" + _this.currentId + ">." + _this.className] && (typeof rules["#" + _this.currentId + ">." + _this.className]["onBack"]) == "function") rules["#" + _this.currentId + ">." + _this.className]["onBack"].call(_this);
+                else if (rules[_this.className] && (typeof rules[_this.className]["onBack"]) == "function") rules[_this.className]["onBack"].call(_this);
+                else _this.onBack.call(_this)
+            }
+            if (rules && rules["#" + _this.currentId + ">." + _this.className] && (typeof rules["#" + _this.currentId + ">." + _this.className]["onPress"]) == "function") init.rules["#" + _this.currentId + ">." + _this.className]["onPress"].call(_this);
+            else if (rules && rules[_this.className] && (typeof rules[_this.className]["onPress"]) == "function") init.rules[_this.className]["onPress"].call(_this);
+            else _this.onPress.call(_this);
+            if (keyCode == btnEnter) {
+                if (rules["#" + _this.currentId + ">." + _this.className] && (typeof rules["#" + _this.currentId + ">." + _this.className]["onEnterPress"]) == "function") rules["#" + _this.currentId + ">." + _this.className]["onEnterPress"].call(_this);
+                else if (rules[_this.className] && (typeof rules[_this.className]["onEnterPress"]) == "function") rules[_this.className]["onEnterPress"].call(_this);
+                else _this.onEnterPress.call(_this)
+            }
+            _this.renderType = "";
+            _self.render(_this.currentIndex);
+            keydefault(e)
+        }
+        this.onLoad()
+    }
+    window.tvSysBtnBind = tvSysBtnBind
+})(window)

+ 793 - 0
js/tween.esm.js

@@ -0,0 +1,793 @@
+var NOW;
+// Include a performance.now polyfill.
+// In node.js, use process.hrtime.
+// eslint-disable-next-line
+// @ts-ignore
+if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) {
+    NOW = function () {
+        // eslint-disable-next-line
+        // @ts-ignore
+        var time = process.hrtime();
+        // Convert [seconds, nanoseconds] to milliseconds.
+        return time[0] * 1000 + time[1] / 1000000;
+    };
+}
+// In a browser, use self.performance.now if it is available.
+else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) {
+    // This must be bound, because directly assigning this function
+    // leads to an invocation exception in Chrome.
+    NOW = self.performance.now.bind(self.performance);
+}
+// Use Date.now if it is available.
+else if (Date.now !== undefined) {
+    NOW = Date.now;
+}
+// Otherwise, use 'new Date().getTime()'.
+else {
+    NOW = function () {
+        return new Date().getTime();
+    };
+}
+var NOW$1 = NOW;
+
+/**
+ * Controlling groups of tweens
+ *
+ * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.
+ * In these cases, you may want to create your own smaller groups of tween
+ */
+var Group = /** @class */ (function () {
+    function Group() {
+        this._tweens = {};
+        this._tweensAddedDuringUpdate = {};
+    }
+    Group.prototype.getAll = function () {
+        var _this = this;
+        return Object.keys(this._tweens).map(function (tweenId) {
+            return _this._tweens[tweenId];
+        });
+    };
+    Group.prototype.removeAll = function () {
+        this._tweens = {};
+    };
+    Group.prototype.add = function (tween) {
+        this._tweens[tween.getId()] = tween;
+        this._tweensAddedDuringUpdate[tween.getId()] = tween;
+    };
+    Group.prototype.remove = function (tween) {
+        delete this._tweens[tween.getId()];
+        delete this._tweensAddedDuringUpdate[tween.getId()];
+    };
+    Group.prototype.update = function (time, preserve) {
+        var tweenIds = Object.keys(this._tweens);
+        if (tweenIds.length === 0) {
+            return false;
+        }
+        time = time !== undefined ? time : NOW$1();
+        // Tweens are updated in "batches". If you add a new tween during an
+        // update, then the new tween will be updated in the next batch.
+        // If you remove a tween during an update, it may or may not be updated.
+        // However, if the removed tween was added during the current batch,
+        // then it will not be updated.
+        while (tweenIds.length > 0) {
+            this._tweensAddedDuringUpdate = {};
+            for (var i = 0; i < tweenIds.length; i++) {
+                var tween = this._tweens[tweenIds[i]];
+                if (tween && tween.update(time) === false && !preserve) {
+                    delete this._tweens[tweenIds[i]];
+                }
+            }
+            tweenIds = Object.keys(this._tweensAddedDuringUpdate);
+        }
+        return true;
+    };
+    return Group;
+}());
+
+/**
+ * The Ease class provides a collection of easing functions for use with tween.js.
+ */
+var Easing = {
+    Linear: {
+        None: function (amount) {
+            return amount;
+        },
+    },
+    Quadratic: {
+        In: function (amount) {
+            return amount * amount;
+        },
+        Out: function (amount) {
+            return amount * (2 - amount);
+        },
+        InOut: function (amount) {
+            if ((amount *= 2) < 1) {
+                return 0.5 * amount * amount;
+            }
+            return -0.5 * (--amount * (amount - 2) - 1);
+        },
+    },
+    Cubic: {
+        In: function (amount) {
+            return amount * amount * amount;
+        },
+        Out: function (amount) {
+            return --amount * amount * amount + 1;
+        },
+        InOut: function (amount) {
+            if ((amount *= 2) < 1) {
+                return 0.5 * amount * amount * amount;
+            }
+            return 0.5 * ((amount -= 2) * amount * amount + 2);
+        },
+    },
+    Quartic: {
+        In: function (amount) {
+            return amount * amount * amount * amount;
+        },
+        Out: function (amount) {
+            return 1 - --amount * amount * amount * amount;
+        },
+        InOut: function (amount) {
+            if ((amount *= 2) < 1) {
+                return 0.5 * amount * amount * amount * amount;
+            }
+            return -0.5 * ((amount -= 2) * amount * amount * amount - 2);
+        },
+    },
+    Quintic: {
+        In: function (amount) {
+            return amount * amount * amount * amount * amount;
+        },
+        Out: function (amount) {
+            return --amount * amount * amount * amount * amount + 1;
+        },
+        InOut: function (amount) {
+            if ((amount *= 2) < 1) {
+                return 0.5 * amount * amount * amount * amount * amount;
+            }
+            return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2);
+        },
+    },
+    Sinusoidal: {
+        In: function (amount) {
+            return 1 - Math.cos((amount * Math.PI) / 2);
+        },
+        Out: function (amount) {
+            return Math.sin((amount * Math.PI) / 2);
+        },
+        InOut: function (amount) {
+            return 0.5 * (1 - Math.cos(Math.PI * amount));
+        },
+    },
+    Exponential: {
+        In: function (amount) {
+            return amount === 0 ? 0 : Math.pow(1024, amount - 1);
+        },
+        Out: function (amount) {
+            return amount === 1 ? 1 : 1 - Math.pow(2, -10 * amount);
+        },
+        InOut: function (amount) {
+            if (amount === 0) {
+                return 0;
+            }
+            if (amount === 1) {
+                return 1;
+            }
+            if ((amount *= 2) < 1) {
+                return 0.5 * Math.pow(1024, amount - 1);
+            }
+            return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2);
+        },
+    },
+    Circular: {
+        In: function (amount) {
+            return 1 - Math.sqrt(1 - amount * amount);
+        },
+        Out: function (amount) {
+            return Math.sqrt(1 - --amount * amount);
+        },
+        InOut: function (amount) {
+            if ((amount *= 2) < 1) {
+                return -0.5 * (Math.sqrt(1 - amount * amount) - 1);
+            }
+            return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1);
+        },
+    },
+    Elastic: {
+        In: function (amount) {
+            if (amount === 0) {
+                return 0;
+            }
+            if (amount === 1) {
+                return 1;
+            }
+            return -Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);
+        },
+        Out: function (amount) {
+            if (amount === 0) {
+                return 0;
+            }
+            if (amount === 1) {
+                return 1;
+            }
+            return Math.pow(2, -10 * amount) * Math.sin((amount - 0.1) * 5 * Math.PI) + 1;
+        },
+        InOut: function (amount) {
+            if (amount === 0) {
+                return 0;
+            }
+            if (amount === 1) {
+                return 1;
+            }
+            amount *= 2;
+            if (amount < 1) {
+                return -0.5 * Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);
+            }
+            return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1;
+        },
+    },
+    Back: {
+        In: function (amount) {
+            var s = 1.70158;
+            return amount * amount * ((s + 1) * amount - s);
+        },
+        Out: function (amount) {
+            var s = 1.70158;
+            return --amount * amount * ((s + 1) * amount + s) + 1;
+        },
+        InOut: function (amount) {
+            var s = 1.70158 * 1.525;
+            if ((amount *= 2) < 1) {
+                return 0.5 * (amount * amount * ((s + 1) * amount - s));
+            }
+            return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2);
+        },
+    },
+    Bounce: {
+        In: function (amount) {
+            return 1 - Easing.Bounce.Out(1 - amount);
+        },
+        Out: function (amount) {
+            if (amount < 1 / 2.75) {
+                return 7.5625 * amount * amount;
+            }
+            else if (amount < 2 / 2.75) {
+                return 7.5625 * (amount -= 1.5 / 2.75) * amount + 0.75;
+            }
+            else if (amount < 2.5 / 2.75) {
+                return 7.5625 * (amount -= 2.25 / 2.75) * amount + 0.9375;
+            }
+            else {
+                return 7.5625 * (amount -= 2.625 / 2.75) * amount + 0.984375;
+            }
+        },
+        InOut: function (amount) {
+            if (amount < 0.5) {
+                return Easing.Bounce.In(amount * 2) * 0.5;
+            }
+            return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5;
+        },
+    },
+};
+
+/**
+ *
+ */
+var Interpolation = {
+    Linear: function (v, k) {
+        var m = v.length - 1;
+        var f = m * k;
+        var i = Math.floor(f);
+        var fn = Interpolation.Utils.Linear;
+        if (k < 0) {
+            return fn(v[0], v[1], f);
+        }
+        if (k > 1) {
+            return fn(v[m], v[m - 1], m - f);
+        }
+        return fn(v[i], v[i + 1 > m ? m : i + 1], f - i);
+    },
+    Bezier: function (v, k) {
+        var b = 0;
+        var n = v.length - 1;
+        var pw = Math.pow;
+        var bn = Interpolation.Utils.Bernstein;
+        for (var i = 0; i <= n; i++) {
+            b += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);
+        }
+        return b;
+    },
+    CatmullRom: function (v, k) {
+        var m = v.length - 1;
+        var f = m * k;
+        var i = Math.floor(f);
+        var fn = Interpolation.Utils.CatmullRom;
+        if (v[0] === v[m]) {
+            if (k < 0) {
+                i = Math.floor((f = m * (1 + k)));
+            }
+            return fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);
+        }
+        else {
+            if (k < 0) {
+                return v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);
+            }
+            if (k > 1) {
+                return v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);
+            }
+            return fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);
+        }
+    },
+    Utils: {
+        Linear: function (p0, p1, t) {
+            return (p1 - p0) * t + p0;
+        },
+        Bernstein: function (n, i) {
+            var fc = Interpolation.Utils.Factorial;
+            return fc(n) / fc(i) / fc(n - i);
+        },
+        Factorial: (function () {
+            var a = [1];
+            return function (n) {
+                var s = 1;
+                if (a[n]) {
+                    return a[n];
+                }
+                for (var i = n; i > 1; i--) {
+                    s *= i;
+                }
+                a[n] = s;
+                return s;
+            };
+        })(),
+        CatmullRom: function (p0, p1, p2, p3, t) {
+            var v0 = (p2 - p0) * 0.5;
+            var v1 = (p3 - p1) * 0.5;
+            var t2 = t * t;
+            var t3 = t * t2;
+            return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;
+        },
+    },
+};
+
+/**
+ * Utils
+ */
+var Sequence = /** @class */ (function () {
+    function Sequence() {
+    }
+    Sequence.nextId = function () {
+        return Sequence._nextId++;
+    };
+    Sequence._nextId = 0;
+    return Sequence;
+}());
+
+/**
+ * Tween.js - Licensed under the MIT license
+ * https://github.com/tweenjs/tween.js
+ * ----------------------------------------------
+ *
+ * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
+ * Thank you all, you're awesome!
+ */
+var Tween = /** @class */ (function () {
+    function Tween(_object, _group) {
+        if (_group === void 0) { _group = TWEEN; }
+        this._object = _object;
+        this._group = _group;
+        this._isPaused = false;
+        this._pauseStart = 0;
+        this._valuesStart = {};
+        this._valuesEnd = {};
+        this._valuesStartRepeat = {};
+        this._duration = 1000;
+        this._initialRepeat = 0;
+        this._repeat = 0;
+        this._yoyo = false;
+        this._isPlaying = false;
+        this._reversed = false;
+        this._delayTime = 0;
+        this._startTime = 0;
+        this._easingFunction = TWEEN.Easing.Linear.None;
+        this._interpolationFunction = TWEEN.Interpolation.Linear;
+        this._chainedTweens = [];
+        this._onStartCallbackFired = false;
+        this._id = TWEEN.nextId();
+        this._isChainStopped = false;
+    }
+    Tween.prototype.getId = function () {
+        return this._id;
+    };
+    Tween.prototype.isPlaying = function () {
+        return this._isPlaying;
+    };
+    Tween.prototype.isPaused = function () {
+        return this._isPaused;
+    };
+    Tween.prototype.to = function (properties, duration) {
+        // to (properties, duration) {
+        for (var prop in properties) {
+            this._valuesEnd[prop] = properties[prop];
+        }
+        if (duration !== undefined) {
+            this._duration = duration;
+        }
+        return this;
+    };
+    Tween.prototype.duration = function (d) {
+        this._duration = d;
+        return this;
+    };
+    Tween.prototype.start = function (time) {
+        if (this._isPlaying) {
+            return this;
+        }
+        // eslint-disable-next-line
+        // @ts-ignore FIXME?
+        this._group.add(this);
+        this._repeat = this._initialRepeat;
+        if (this._reversed) {
+            // If we were reversed (f.e. using the yoyo feature) then we need to
+            // flip the tween direction back to forward.
+            this._reversed = false;
+            for (var property in this._valuesStartRepeat) {
+                this._swapEndStartRepeatValues(property);
+                this._valuesStart[property] = this._valuesStartRepeat[property];
+            }
+        }
+        this._isPlaying = true;
+        this._isPaused = false;
+        this._onStartCallbackFired = false;
+        this._isChainStopped = false;
+        this._startTime =
+            time !== undefined ? (typeof time === 'string' ? TWEEN.now() + parseFloat(time) : time) : TWEEN.now();
+        this._startTime += this._delayTime;
+        this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat);
+        return this;
+    };
+    Tween.prototype._setupProperties = function (_object, _valuesStart, _valuesEnd, _valuesStartRepeat) {
+        for (var property in _valuesEnd) {
+            var startValue = _object[property];
+            var startValueIsArray = Array.isArray(startValue);
+            var propType = startValueIsArray ? 'array' : typeof startValue;
+            var isInterpolationList = !startValueIsArray && Array.isArray(_valuesEnd[property]);
+            // If `to()` specifies a property that doesn't exist in the source object,
+            // we should not set that property in the object
+            if (propType === 'undefined' || propType === 'function') {
+                continue;
+            }
+            // Check if an Array was provided as property value
+            if (isInterpolationList) {
+                var endValues = _valuesEnd[property];
+                if (endValues.length === 0) {
+                    continue;
+                }
+                // handle an array of relative values
+                endValues = endValues.map(this._handleRelativeValue.bind(this, startValue));
+                // Create a local copy of the Array with the start value at the front
+                _valuesEnd[property] = [startValue].concat(endValues);
+            }
+            // handle the deepness of the values
+            if ((propType === 'object' || startValueIsArray) && startValue && !isInterpolationList) {
+                _valuesStart[property] = startValueIsArray ? [] : {};
+                // eslint-disable-next-line
+                for (var prop in startValue) {
+                    // eslint-disable-next-line
+                    // @ts-ignore FIXME?
+                    _valuesStart[property][prop] = startValue[prop];
+                }
+                _valuesStartRepeat[property] = startValueIsArray ? [] : {}; // TODO? repeat nested values? And yoyo? And array values?
+                // eslint-disable-next-line
+                // @ts-ignore FIXME?
+                this._setupProperties(startValue, _valuesStart[property], _valuesEnd[property], _valuesStartRepeat[property]);
+            }
+            else {
+                // Save the starting value, but only once.
+                if (typeof _valuesStart[property] === 'undefined') {
+                    _valuesStart[property] = startValue;
+                }
+                if (!startValueIsArray) {
+                    // eslint-disable-next-line
+                    // @ts-ignore FIXME?
+                    _valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings
+                }
+                if (isInterpolationList) {
+                    // eslint-disable-next-line
+                    // @ts-ignore FIXME?
+                    _valuesStartRepeat[property] = _valuesEnd[property].slice().reverse();
+                }
+                else {
+                    _valuesStartRepeat[property] = _valuesStart[property] || 0;
+                }
+            }
+        }
+    };
+    Tween.prototype.stop = function () {
+        if (!this._isChainStopped) {
+            this._isChainStopped = true;
+            this.stopChainedTweens();
+        }
+        if (!this._isPlaying) {
+            return this;
+        }
+        // eslint-disable-next-line
+        // @ts-ignore FIXME?
+        this._group.remove(this);
+        this._isPlaying = false;
+        this._isPaused = false;
+        if (this._onStopCallback) {
+            this._onStopCallback(this._object);
+        }
+        return this;
+    };
+    Tween.prototype.end = function () {
+        this.update(Infinity);
+        return this;
+    };
+    Tween.prototype.pause = function (time) {
+        if (this._isPaused || !this._isPlaying) {
+            return this;
+        }
+        this._isPaused = true;
+        this._pauseStart = time === undefined ? TWEEN.now() : time;
+        // eslint-disable-next-line
+        // @ts-ignore FIXME?
+        this._group.remove(this);
+        return this;
+    };
+    Tween.prototype.resume = function (time) {
+        if (!this._isPaused || !this._isPlaying) {
+            return this;
+        }
+        this._isPaused = false;
+        this._startTime += (time === undefined ? TWEEN.now() : time) - this._pauseStart;
+        this._pauseStart = 0;
+        // eslint-disable-next-line
+        // @ts-ignore FIXME?
+        this._group.add(this);
+        return this;
+    };
+    Tween.prototype.stopChainedTweens = function () {
+        for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
+            this._chainedTweens[i].stop();
+        }
+        return this;
+    };
+    Tween.prototype.group = function (group) {
+        this._group = group;
+        return this;
+    };
+    Tween.prototype.delay = function (amount) {
+        this._delayTime = amount;
+        return this;
+    };
+    Tween.prototype.repeat = function (times) {
+        this._initialRepeat = times;
+        this._repeat = times;
+        return this;
+    };
+    Tween.prototype.repeatDelay = function (amount) {
+        this._repeatDelayTime = amount;
+        return this;
+    };
+    Tween.prototype.yoyo = function (yoyo) {
+        this._yoyo = yoyo;
+        return this;
+    };
+    Tween.prototype.easing = function (easingFunction) {
+        this._easingFunction = easingFunction;
+        return this;
+    };
+    Tween.prototype.interpolation = function (interpolationFunction) {
+        this._interpolationFunction = interpolationFunction;
+        return this;
+    };
+    Tween.prototype.chain = function () {
+        var tweens = [];
+        for (var _i = 0; _i < arguments.length; _i++) {
+            tweens[_i] = arguments[_i];
+        }
+        this._chainedTweens = tweens;
+        return this;
+    };
+    Tween.prototype.onStart = function (callback) {
+        this._onStartCallback = callback;
+        return this;
+    };
+    Tween.prototype.onUpdate = function (callback) {
+        this._onUpdateCallback = callback;
+        return this;
+    };
+    Tween.prototype.onRepeat = function (callback) {
+        this._onRepeatCallback = callback;
+        return this;
+    };
+    Tween.prototype.onComplete = function (callback) {
+        this._onCompleteCallback = callback;
+        return this;
+    };
+    Tween.prototype.onStop = function (callback) {
+        this._onStopCallback = callback;
+        return this;
+    };
+    Tween.prototype.update = function (time) {
+        var property;
+        var elapsed;
+        var endTime = this._startTime + this._duration;
+        if (time > endTime && !this._isPlaying) {
+            return false;
+        }
+        // If the tween was already finished,
+        if (!this.isPlaying) {
+            this.start(time);
+        }
+        if (time < this._startTime) {
+            return true;
+        }
+        if (this._onStartCallbackFired === false) {
+            if (this._onStartCallback) {
+                this._onStartCallback(this._object);
+            }
+            this._onStartCallbackFired = true;
+        }
+        elapsed = (time - this._startTime) / this._duration;
+        elapsed = this._duration === 0 || elapsed > 1 ? 1 : elapsed;
+        var value = this._easingFunction(elapsed);
+        // properties transformations
+        this._updateProperties(this._object, this._valuesStart, this._valuesEnd, value);
+        if (this._onUpdateCallback) {
+            this._onUpdateCallback(this._object, elapsed);
+        }
+        if (elapsed === 1) {
+            if (this._repeat > 0) {
+                if (isFinite(this._repeat)) {
+                    this._repeat--;
+                }
+                // Reassign starting values, restart by making startTime = now
+                for (property in this._valuesStartRepeat) {
+                    if (!this._yoyo && typeof this._valuesEnd[property] === 'string') {
+                        this._valuesStartRepeat[property] =
+                            // eslint-disable-next-line
+                            // @ts-ignore FIXME?
+                            this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);
+                    }
+                    if (this._yoyo) {
+                        this._swapEndStartRepeatValues(property);
+                    }
+                    this._valuesStart[property] = this._valuesStartRepeat[property];
+                }
+                if (this._yoyo) {
+                    this._reversed = !this._reversed;
+                }
+                if (this._repeatDelayTime !== undefined) {
+                    this._startTime = time + this._repeatDelayTime;
+                }
+                else {
+                    this._startTime = time + this._delayTime;
+                }
+                if (this._onRepeatCallback) {
+                    this._onRepeatCallback(this._object);
+                }
+                return true;
+            }
+            else {
+                if (this._onCompleteCallback) {
+                    this._onCompleteCallback(this._object);
+                }
+                for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
+                    // Make the chained tweens start exactly at the time they should,
+                    // even if the `update()` method was called way past the duration of the tween
+                    this._chainedTweens[i].start(this._startTime + this._duration);
+                }
+                this._isPlaying = false;
+                return false;
+            }
+        }
+        return true;
+    };
+    Tween.prototype._updateProperties = function (_object, _valuesStart, _valuesEnd, value) {
+        for (var property in _valuesEnd) {
+            // Don't update properties that do not exist in the source object
+            if (_valuesStart[property] === undefined) {
+                continue;
+            }
+            var start = _valuesStart[property] || 0;
+            var end = _valuesEnd[property];
+            var startIsArray = Array.isArray(_object[property]);
+            var endIsArray = Array.isArray(end);
+            var isInterpolationList = !startIsArray && endIsArray;
+            if (isInterpolationList) {
+                _object[property] = this._interpolationFunction(end, value);
+            }
+            else if (typeof end === 'object' && end) {
+                // eslint-disable-next-line
+                // @ts-ignore FIXME?
+                this._updateProperties(_object[property], start, end, value);
+            }
+            else {
+                // Parses relative end values with start as base (e.g.: +10, -3)
+                end = this._handleRelativeValue(start, end);
+                // Protect against non numeric properties.
+                if (typeof end === 'number') {
+                    // eslint-disable-next-line
+                    // @ts-ignore FIXME?
+                    _object[property] = start + (end - start) * value;
+                }
+            }
+        }
+    };
+    Tween.prototype._handleRelativeValue = function (start, end) {
+        if (typeof end !== 'string') {
+            return end;
+        }
+        if (end.charAt(0) === '+' || end.charAt(0) === '-') {
+            return start + parseFloat(end);
+        }
+        else {
+            return parseFloat(end);
+        }
+    };
+    Tween.prototype._swapEndStartRepeatValues = function (property) {
+        var tmp = this._valuesStartRepeat[property];
+        if (typeof this._valuesEnd[property] === 'string') {
+            // eslint-disable-next-line
+            // @ts-ignore FIXME?
+            this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);
+        }
+        else {
+            this._valuesStartRepeat[property] = this._valuesEnd[property];
+        }
+        this._valuesEnd[property] = tmp;
+    };
+    return Tween;
+}());
+
+var VERSION = '18.5.0';
+
+/**
+ * Tween.js - Licensed under the MIT license
+ * https://github.com/tweenjs/tween.js
+ * ----------------------------------------------
+ *
+ * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
+ * Thank you all, you're awesome!
+ */
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+/**
+ * Controlling groups of tweens
+ *
+ * Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.
+ * In these cases, you may want to create your own smaller groups of tween
+ */
+var Main = /** @class */ (function (_super) {
+    __extends(Main, _super);
+    function Main() {
+        var _this = _super !== null && _super.apply(this, arguments) || this;
+        _this.version = VERSION;
+        _this.now = NOW$1;
+        _this.Group = Group;
+        _this.Easing = Easing;
+        _this.Interpolation = Interpolation;
+        _this.nextId = Sequence.nextId;
+        _this.Tween = Tween;
+        return _this;
+    }
+    return Main;
+}(Group));
+var TWEEN = new Main();
+
+export default TWEEN;

+ 127 - 0
pano3.html

@@ -0,0 +1,127 @@
+<!DOCTYPE html>
+
+<html>
+
+<head>
+    <title>VR House</title>
+    <!-- <script src="./three.module.js"></script> -->
+    <!--    <script src="./js/controls/OrbitControls.js"></script> -->
+     <script src="./js/tvSysBtnBind.v2.1.js"></script> 
+    <!--   <script src="./js/loaders/MTLLoader.js"></script> -->
+    <!--   <script src="js/loaders/collada/AnimationHandler.js"></script> -->
+    <meta charset="utf-8">
+    <style>
+        body {
+            /* set margin to 0 and overflow to hidden, to go fullscreen */
+            margin: 0;
+            overflow: hidden;
+        }
+
+        .navigation{
+            display: flex;
+            z-index: 10;
+            position: fixed;
+            top:15px;
+            right:15px;
+            user-select: none;
+            -moz-user-select: none;
+            -khtml-user-select: none;
+            -webkit-user-select: none;
+            -o-user-select: none;
+            
+            /* flex-direction: column;
+            align-items: center; */
+        }
+
+        .navigation .map_img{
+            width: 128px;
+            height: 128px;
+        }
+
+        #map{
+            position: absolute;
+            /* z-index: 11;
+            top:32px; */
+            right:15px;
+        }
+
+        #cam{
+            position: absolute;
+            /* z-index: 12; */
+            /* top:32px; */
+            right:15px;
+            /* transform: rotate(180deg); */
+
+            
+        }
+
+        .navigation .cam_img{
+            width: 32px;
+            height: 32px;
+        }
+
+        .controls{
+            display: flex;
+            z-index: 10;
+            position: fixed;
+            bottom:30px;
+            right:100px;
+            flex-direction: column;
+            align-items: center;
+        }
+
+        .up,.down,.left,.right,.ok{
+            display: flex;
+            cursor: pointer;
+        }
+
+        .three{
+            display: flex;
+            width: 180px;
+            justify-content: space-between;
+ 
+        }
+
+    </style>
+</head>
+
+<body id="Jdoc">
+
+    <!-- 用来保存输出结果 -->
+    <div id="container">
+    </div>
+
+    <div class="navigation">
+      <div style="position:relative">
+        <div id='map'><img class="map_img" src="panos/Home户型图简图.png"/></div>
+        <div id='cam'><img class="cam_img" src="panos/Home位置示意点.png"/></div>
+    </div>
+        
+    </div>
+
+
+    <div class="controls">
+        <div class="up">UP</div>
+        
+        <div class="three">
+            <div class="left">LEFT</div>
+            <div class="ok">OK</div>
+            <div class="right">RIGHT</div>
+        </div>
+
+        <div class="down">DOWN</div>
+        
+    </div>
+
+
+
+    <div class="ctrlBtn"></div>
+    
+    <script type="module" src="app.min.js"></script>
+
+    <script type="text/javaScript">
+
+    </script>
+</body>
+
+</html>

+ 0 - 0
test.md