-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
1 lines (1 loc) · 1.66 KB
/
index.js
1
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)[360]=t(e.react)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),r={exports:{}};function o(){}function a(){}a.resetWarningCache=o;r.exports=function(){function e(e,t,n,r,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}();var i=r.exports;function s(t){const{width:r,height:o,rotation:a,imgPath:i}=t;var s;s="https://aframe.io/releases/0.5.0/aframe.min.js",e.useEffect((()=>{const e=document.createElement("script");return e.src=s,e.async=!0,document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[s]);const c={width:r,height:o};return n.default.createElement(n.default.Fragment,null,n.default.createElement("div",{style:c},n.default.createElement("a-scene",{embedded:!0},n.default.createElement("a-sky",{src:i,rotation:a}))))}return s.propTypes={width:i.string,height:i.string,rotation:i.string,imgPath:i.string.isRequired},s.defaultProps={width:"100vw",height:"100vh",rotation:"0 -130 0"},s}));