From 1534f883f3a6953b30c956210a69d246d5f8a3c7 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 2 Nov 2020 16:38:57 +0300 Subject: [PATCH] firebase deploy --- .firebase/hosting.ZGlzdA.cache | 2 ++ .firebaserc | 5 +++++ dist/bundle.js | 2 +- dist/index.html | 2 +- firebase.json | 16 ++++++++++++++++ src/index.js | 4 +++- 6 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .firebase/hosting.ZGlzdA.cache create mode 100644 .firebaserc create mode 100644 firebase.json diff --git a/.firebase/hosting.ZGlzdA.cache b/.firebase/hosting.ZGlzdA.cache new file mode 100644 index 0000000..6132d80 --- /dev/null +++ b/.firebase/hosting.ZGlzdA.cache @@ -0,0 +1,2 @@ +bundle.js,1604323381767,974033ec3ca0c3ac4f403e204c49eea929bf1a33cd1506ae97e8c1c7b4363974 +index.html,1604323381767,93d54e472400d4602a98046f7b6079317e1b195a1049bdad237fa419cda8a810 diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..da4b704 --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "javascript-constructor-e6864" + } +} diff --git a/dist/bundle.js b/dist/bundle.js index ec3ca4b..f93e49f 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,n,r={756:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,"#app {\n position: relative;\n}\n\n.content {\n position: absolute;\n top: 0;\n right: 0;\n left: 200px;\n}\n\n.sidebar {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n width: 200px;\n z-index: 100;\n padding: 10px;\n box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);\n overflow-y: auto;\n}\n",""]);const i=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i{var r,o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e=i(379),t=i.n(e),n=i(756),t()(n.Z,{insert:"head",singleton:!1}),n.Z.locals,console.log([{type:"title",value:"Test title",options:{}},{type:"text",value:"Lorem ipsum dolor sit, amet consectetur adipisicing elit.",options:{}},{type:"textColumns",value:["text 1","text 2","text 3"],options:{}}])})(); \ No newline at end of file +(()=>{"use strict";var n={756:(n,e,t)=>{t.d(e,{Z:()=>o});var i=t(645),a=t.n(i)()((function(n){return n[1]}));a.push([n.id,"#app {\n position: relative;\n}\n\n.content {\n position: absolute;\n top: 0;\n right: 0;\n left: 200px;\n background: linear-gradient(17deg, #d3d3d3, #696969),\n linear-gradient(127deg, #d3d3d3, #bdbdbd),\n linear-gradient(336deg, #9e9e9e, #7d7d7d);\n}\n\n.sidebar {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n width: 200px;\n z-index: 100;\n padding: 10px;\n box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);\n overflow-y: auto;\n}\n\n#leaves {\n position: absolute;\n top: -50px;\n width: 100%;\n text-align: right;\n z-index: 4000;\n}\n\n#leaves i {\n display: inline-block;\n width: 200px;\n height: 150px;\n background: linear-gradient(to bottom right, #309900, #005600);\n transform: skew(20deg);\n border-radius: 5% 40% 70%;\n box-shadow: inset 0px 0px 1px #222;\n border: 1px solid #333;\n z-index: 1;\n animation: falling 5s 0s infinite;\n}\n\n#leaves i:nth-of-type(2n) {\n animation: falling2 5s 0s infinite;\n}\n#leaves i:nth-of-type(3n) {\n animation: falling3 5s 0s infinite;\n}\n\n#leaves i:before {\n position: absolute;\n content: '';\n top: 117px;\n right: 9px;\n height: 27px;\n width: 32px;\n transform: rotate(49deg);\n border-radius: 0% 15% 15% 0%;\n border-top: 1px solid #222;\n border-bottom: 1px solid #222;\n border-left: 0px solid #222;\n border-right: 1px solid #222;\n background: linear-gradient(to right, rgba(0, 100, 0, 1), #005600);\n z-index: 1;\n}\n\n#leaves i:after {\n content: '';\n height: 125px;\n width: 10px;\n background: linear-gradient(to right, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));\n display: block;\n transform: rotate(125deg);\n position: absolute;\n left: 85px;\n border-radius: 50%;\n}\n\n#leaves i:nth-of-type(n) {\n height: 23px;\n width: 30px;\n}\n#leaves i:nth-of-type(n):before {\n width: 7px;\n height: 5px;\n top: 17px;\n right: 1px;\n}\n#leaves i:nth-of-type(n):after {\n width: 2px;\n height: 17px;\n left: 12px;\n top: 0px;\n}\n\n#leaves i:nth-of-type(2n + 1) {\n height: 11px;\n width: 16px;\n}\n#leaves i:nth-of-type(2n + 1):before {\n width: 4px;\n height: 3px;\n top: 7px;\n right: 0px;\n}\n#leaves i:nth-of-type(2n + 1):after {\n width: 2px;\n height: 6px;\n left: 5px;\n top: 1px;\n}\n\n#leaves i:nth-of-type(3n + 2) {\n height: 17px;\n width: 23px;\n}\n#leaves i:nth-of-type(3n + 2):before {\n height: 4px;\n width: 4px;\n top: 12px;\n right: 1px;\n}\n#leaves i:nth-of-type(3n + 2):after {\n height: 10px;\n width: 2px;\n top: 1px;\n left: 8px;\n}\n\n#leaves i:nth-of-type(n) {\n animation-delay: 1.9s;\n}\n#leaves i:nth-of-type(2n) {\n animation-delay: 3.9s;\n}\n#leaves i:nth-of-type(3n) {\n animation-delay: 2.3s;\n}\n#leaves i:nth-of-type(4n) {\n animation-delay: 4.4s;\n}\n#leaves i:nth-of-type(5n) {\n animation-delay: 5s;\n}\n#leaves i:nth-of-type(6n) {\n animation-delay: 3.5s;\n}\n#leaves i:nth-of-type(7n) {\n animation-delay: 2.8s;\n}\n#leaves i:nth-of-type(8n) {\n animation-delay: 1.5s;\n}\n#leaves i:nth-of-type(9n) {\n animation-delay: 3.3s;\n}\n#leaves i:nth-of-type(10n) {\n animation-delay: 2.5s;\n}\n#leaves i:nth-of-type(11n) {\n animation-delay: 1.2s;\n}\n#leaves i:nth-of-type(12n) {\n animation-delay: 4.1s;\n}\n#leaves i:nth-of-type(13n) {\n animation-delay: 1s;\n}\n#leaves i:nth-of-type(14n) {\n animation-delay: 4.7s;\n}\n#leaves i:nth-of-type(15n) {\n animation-delay: 3s;\n}\n\n#leaves i:nth-of-type(n) {\n background: linear-gradient(to bottom right, #309900, #005600);\n}\n#leaves i:nth-of-type(2n + 2) {\n background: linear-gradient(to bottom right, #5e9900, #2b5600);\n}\n#leaves i:nth-of-type(4n + 1) {\n background: linear-gradient(to bottom right, #990, #564500);\n}\n\n#leaves i:nth-of-type(n) {\n opacity: 0.7;\n}\n#leaves i:nth-of-type(3n + 1) {\n opacity: 0.5;\n}\n#leaves i:nth-of-type(3n + 2) {\n opacity: 0.3;\n}\n\n#leaves i:nth-of-type(n) {\n transform: rotate(180deg);\n}\n\n#leaves i:nth-of-type(n) {\n animation-timing-function: ease-in-out;\n}\n\n@keyframes falling {\n 0% {\n transform: translate3d(300, 0, 0) rotate(0deg);\n }\n\n 100% {\n transform: translate3d(-350px, 700px, 0) rotate(90deg);\n opacity: 0;\n }\n}\n\n@keyframes falling3 {\n 0% {\n transform: translate3d(0, 0, 0) rotate(-20deg);\n }\n\n 100% {\n transform: translate3d(-230px, 640px, 0) rotate(-70deg);\n opacity: 0;\n }\n}\n\n@keyframes falling2 {\n 0% {\n transform: translate3d(0, 0, 0) rotate(90deg);\n }\n\n 100% {\n transform: translate3d(-400px, 680px, 0) rotate(0deg);\n opacity: 0;\n }\n}\n",""]);const o=a},645:n=>{n.exports=function(n){var e=[];return e.toString=function(){return this.map((function(e){var t=n(e);return e[2]?"@media ".concat(e[2]," {").concat(t,"}"):t})).join("")},e.i=function(n,t,i){"string"==typeof n&&(n=[[null,n,""]]);var a={};if(i)for(var o=0;o{var i,a=function(){var n={};return function(e){if(void 0===n[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(n){t=null}n[e]=t}return n[e]}}(),o=[];function r(n){for(var e=-1,t=0;t{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var i in e)t.o(e,i)&&!t.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:e[i]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),(()=>{var n=t(379),e=t.n(n),i=t(756);e()(i.Z,{insert:"head",singleton:!1}),i.Z.locals;const a=(n,e="")=>`
${n}
`,o=n=>`
${n}
`,r=(n={})=>Object.keys(n).map((e=>`${e}: ${n[e]}`)).join(";");class s{constructor(n,e){this.value=n,this.options=e}toHTML(){throw new Error("Для данного блока не найден подходящий метод для генерации HTML кода!")}}class l extends s{constructor(n,e){super(n,e)}toHTML(){const{options:n,value:e}=this;return a(o(`<${n.tag}>${e}`),n.styles)}}class p extends s{constructor(n,e){super(n,e)}toHTML(){const{options:n,value:e}=this;return a(o(`

${e}

`),n.styles)}}const d=[new class extends s{constructor(n,e){super(n,e)}toHTML(){return a(this.value)}}('
\n \n \n \n \n
'),new l("Алексей Плещеев",{styles:r({color:"#fff","text-align":"center","font-family":"Georgia, serif","font-size":"25px","letter-spacing":"2px","word-spacing":"2px","font-variant":"small-caps","padding-top":"50px"}),tag:"h2"}),new p("Осень наступила, высохли цветы",{styles:r({"text-align":"center","font-family":"Arial, Helvetica, sans-serif","font-size":"20px","font-weight":"700","padding-top":"20px"})}),new class extends s{constructor(n,e){super(n,e)}toHTML(){const{alt:n,styles:e}=this.options;return a(o(`${n}`),e)}}("golden_autumn.jpg",{styles:r({"text-align":"center","padding-top":"20px"}),alt:"Иван Иванович Шишкин – Ранняя осень 1889"}),new class extends s{constructor(n,e){super(n,e)}toHTML(){const{options:n,value:e}=this;return a(e.map((n=>o(n))).join(""),n.styles)}}([" Осень наступила,\n Высохли цветы,\n И глядят уныло\n Голые кусты."," Вянет и желтеет\n Травка на лугах,\n Только зеленеет\n Озимь на полях."," Туча небо кроет,\n Солнце не блестит,\n Ветер в поле воет,\n Дождик моросит.."," Зашумели воды\n Быстрого ручья,\n Птички улетели\n В теплые края."],{styles:r({"white-space":"pre-wrap","text-align":"justify","padding-top":"50px","font-family":"Verdana","font-size":"16px","font-weight":"700","padding-bottom":"200px","padding-left":"150px","padding-right":"100px"})})];function c(n){return`\n
\n
${n}
\n
\n \n
\n
\n \n
\n \n
\n
\n `}const f=new class{constructor(n){this.$el=document.querySelector(n)}render(n){this.$el.innerHTML="",n.forEach((n=>{this.$el.insertAdjacentHTML("beforeend",n.toHTML())}))}}("#site");f.render(d),new class{constructor(n,e){this.$el=document.querySelector(n),this.update=e,this.init()}init(){this.$el.addEventListener("submit",this.addBlock.bind(this)),this.$el.innerHTML=this.template}get template(){return[c("text"),c("title")].join("")}addBlock(n){n.preventDefault();const e=n.target.name,t=n.target.value.value,i=n.target.styles.value,a=new("text"===e?p:l)(t,{styles:i});this.update(a),n.target.value.value="",n.target.styles.value=""}}("#panel",(n=>{d.push(n),f.render(d)}))})()})(); \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 05b4771..d8aae28 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -JavaScript Constructor

Title

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Incidunt consectetur reprehenderit ex blanditiis assumenda quaerat ea atque fugit eaque asperiores eligendi accusantium ratione exercitationem delectus eveniet unde rerum, possimus voluptate!

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Incidunt consectetur reprehenderit ex blanditiis assumenda quaerat ea atque fugit eaque asperiores eligendi accusantium ratione exercitationem delectus eveniet unde rerum, possimus voluptate!

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Incidunt consectetur reprehenderit ex blanditiis assumenda quaerat ea atque fugit eaque asperiores eligendi accusantium ratione exercitationem delectus eveniet unde rerum, possimus voluptate!

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Incidunt consectetur reprehenderit ex blanditiis assumenda quaerat ea atque fugit eaque asperiores eligendi accusantium ratione exercitationem delectus eveniet unde rerum, possimus voluptate!

\ No newline at end of file +JavaScript Constructor
\ No newline at end of file diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..2c33c29 --- /dev/null +++ b/firebase.json @@ -0,0 +1,16 @@ +{ + "hosting": { + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +} diff --git a/src/index.js b/src/index.js index 1d3f058..208d278 100644 --- a/src/index.js +++ b/src/index.js @@ -3,10 +3,12 @@ import { model } from './model.js' import { Site } from './classes/site.js' import { SideBar } from './classes/sidebar.js' +const site = new Site('#site') + const updateCallback = (newBlock) => { model.push(newBlock) site.render(model) } -new Site('#site').render(model) +site.render(model) new SideBar('#panel', updateCallback)