Improvements to newsfeed.js

Cleaned up some CSS

Bumped v1 version string and rebuilt client assets
This commit is contained in:
Bobby Wibowo 2020-07-28 16:44:04 +07:00
parent 541c1da5a6
commit 3c2abcfadd
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
10 changed files with 92 additions and 75 deletions

2
dist/css/home.css vendored
View File

@ -1,2 +1,2 @@
#b{width:200px;height:200px;border-radius:100%;display:inline-block;margin-bottom:40px;vertical-align:top;-webkit-animation-delay:.5s;animation-delay:.5s;-webkit-animation-duration:1.5s;animation-duration:1.5s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:floatUp;animation-name:floatUp;-webkit-animation-timing-function:cubic-bezier(0,.71,.29,1);animation-timing-function:cubic-bezier(0,.71,.29,1)}.logo{max-height:200px}.logo.is-2x{display:none}#dropzone *{pointer-events:none}#panel,#tokenContainer{display:none}#maxSize{font-size:1rem}.dz-preview .dz-details{display:flex}.dz-preview .dz-details .dz-filename,.dz-preview .dz-details .dz-size{flex:1}.dz-preview .dz-error-mark,.dz-preview .dz-success-mark,.dz-preview img{display:none}@-webkit-keyframes floatUp{0%{opacity:0;transform:scale(.86)}25%{opacity:1}67%{transform:scale(1)}to{transform:scale(1)}}@keyframes floatUp{0%{opacity:0;transform:scale(.86)}25%{opacity:1}67%{transform:scale(1)}to{transform:scale(1)}}.uploads{display:flex;flex-direction:column}.uploads.is-reversed{flex-direction:column-reverse}.uploads>div{-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s;margin:.75rem!important}.uploads.is-reversed>div{flex:0 0 auto}.uploads>div:first-child{margin-top:1.5rem}.uploads.nojs{margin-bottom:0}.uploads>div>.icon:not(.icon-block){color:#209cee}.uploads>div>.icon.icon-block{color:#da4453}.uploads .descriptive-progress{color:#bdc3c7}.uploads img{max-width:200px}.name{font-size:1rem;color:#eff0f1}.link>a,.name{word-break:break-all}.clipboard-mobile{margin-top:5px}#albumDiv{-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#albumDiv .control{text-align:inherit}#linksColumn{margin-top:-.25rem;margin-left:-.25rem;margin-right:-.25rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#linksColumn .column{padding:.25rem}#linksColumn>span{padding:0 .3rem;color:#7f8c8d}.git-commit a{display:inline-block;word-break:break-all}#tabs{margin-bottom:1rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#tabs ul{border-bottom:1px solid #585858}#tabs li a{color:#bdc3c7;border-bottom-color:#585858}#tabs.is-boxed li.is-active a{color:#209cee;background:#000;border-color:#585858 #585858 #000}#tabs.is-boxed li:not(.is-active) a:hover{background:#585858}.tab-content{margin-bottom:-.75rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#tab-config.tab-content form{margin-bottom:.75rem}#urlMaxSize{font-weight:700}.render{position:fixed;right:0;bottom:0;font-size:1rem;color:#bdc3c7;cursor:pointer}.render.button{border-bottom-left-radius:0;border-bottom-right-radius:0;right:1%;opacity:.25;transition:opacity .25s}.render.button:hover{opacity:1}input[type=file].is-fullwidth{width:100%}#newsfeed{position:absolute;top:0;right:0;left:0;padding:1.5rem 1.5rem 0}#newsfeed .notification{padding:.9375rem 1.875rem .9375rem 1.125rem;margin-bottom:1.125rem}#newsfeed .notification .content{font-size:.75rem}#newsfeed .news-date.is-recent-week,#newsfeed .news-title{font-weight:700}
#b{width:200px;height:200px;border-radius:100%;display:inline-block;margin-bottom:40px;vertical-align:top;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}.logo{max-height:200px}.logo.is-2x{display:none}#dropzone *{pointer-events:none}#panel,#tokenContainer{display:none}#maxSize{font-size:1rem}.dz-preview .dz-details{display:flex}.dz-preview .dz-details .dz-filename,.dz-preview .dz-details .dz-size{flex:1}.dz-preview .dz-error-mark,.dz-preview .dz-success-mark,.dz-preview img{display:none}.uploads{display:flex;flex-direction:column}.uploads.is-reversed{flex-direction:column-reverse}.uploads>div{-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s;margin:.75rem!important}.uploads.is-reversed>div{flex:0 0 auto}.uploads>div:first-child{margin-top:1.5rem}.uploads.nojs{margin-bottom:0}.uploads>div>.icon:not(.icon-block){color:#209cee}.uploads>div>.icon.icon-block{color:#da4453}.uploads .descriptive-progress{color:#bdc3c7}.uploads img{max-width:200px}.name{font-size:1rem;color:#eff0f1}.link>a,.name{word-break:break-all}.clipboard-mobile{margin-top:5px}#albumDiv{-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#albumDiv .control{text-align:inherit}#linksColumn{margin-top:-.25rem;margin-left:-.25rem;margin-right:-.25rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#linksColumn .column{padding:.25rem}#linksColumn>span{padding:0 .3rem;color:#7f8c8d}.git-commit a{display:inline-block;word-break:break-all}#tabs{margin-bottom:1rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#tabs ul{border-bottom:1px solid #585858}#tabs li a{color:#bdc3c7;border-bottom-color:#585858}#tabs.is-boxed li.is-active a{color:#209cee;background:#000;border-color:#585858 #585858 #000}#tabs.is-boxed li:not(.is-active) a:hover{background:#585858}.tab-content{margin-bottom:-.75rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#tab-config.tab-content form{margin-bottom:.75rem}#urlMaxSize{font-weight:700}input[type=file].is-fullwidth{width:100%}.render{position:fixed;right:0;bottom:0;font-size:1rem;color:#bdc3c7;cursor:pointer;-webkit-animation:floatUp 1.5s cubic-bezier(0,.71,.29,1) .5s 1 normal both;animation:floatUp 1.5s cubic-bezier(0,.71,.29,1) .5s 1 normal both}.render.button{border-bottom-left-radius:0;border-bottom-right-radius:0;right:1%;opacity:.25;transition:opacity .25s}.render.button:hover{opacity:1}#newsfeed{position:absolute;top:0;right:0;left:0;padding:1.5rem 1.5rem 0}#newsfeed .column:last-child{-webkit-animation:floatUp 1.5s cubic-bezier(0,.71,.29,1) .5s 1 normal both;animation:floatUp 1.5s cubic-bezier(0,.71,.29,1) .5s 1 normal both}#newsfeed .notification{display:block;padding:.75rem 2.25rem .75rem 1.125rem;margin-bottom:1.125rem}#newsfeed .notification>.delete{top:.75rem}#newsfeed .notification .content{font-size:.75rem}#newsfeed .news-date.is-recent-week,#newsfeed .news-title{font-weight:700}
/*# sourceMappingURL=home.css.map */

File diff suppressed because one or more lines are too long

2
dist/css/style.css vendored
View File

@ -1,2 +1,2 @@
html{background-color:#000;overflow-y:auto}body{color:#eff0f1;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}@-webkit-keyframes fadeInOpacity{0%{opacity:0}to{opacity:1}}@keyframes fadeInOpacity{0%{opacity:0}to{opacity:1}}a{color:#209cee}a:hover{color:#67c3ff}hr{background-color:#585858}.message-body code,code{background-color:#000;border-radius:5px;font-size:1rem}.subtitle,.subtitle strong{color:#bdc3c7}.subtitle.is-brighter,.subtitle.is-brighter strong,.title{color:#eff0f1}.input,.select select,.textarea{color:#eff0f1;border-color:#585858;background-color:#000}.input::-moz-placeholder,.textarea::-moz-placeholder{color:#bdc3c7}.input::-webkit-input-placeholder,.textarea::-webkit-input-placeholder{color:#bdc3c7}.input:-moz-placeholder,.textarea:-moz-placeholder{color:#bdc3c7}.input:-ms-input-placeholder,.textarea:-ms-input-placeholder{color:#bdc3c7}.input.is-active,.input.is-focused,.input:active,.input:focus,.input:not([disabled]):hover,.select fieldset:not([disabled]) select:hover,.select select:not([disabled]):hover,.textarea.is-active,.textarea.is-focused,.textarea:active,.textarea:focus,.textarea:not([disabled]):hover,fieldset:not([disabled]) .input:hover,fieldset:not([disabled]) .select select:hover,fieldset:not([disabled]) .textarea:hover{border-color:#209cee}.input[disabled],.select fieldset[disabled] select,.select select[disabled],.textarea[disabled],fieldset[disabled] .input,fieldset[disabled] .select select,fieldset[disabled] .textarea{border-color:#585858;background-color:#2f2f2f}.label{color:#eff0f1;font-weight:400}.help{color:#bdc3c7}.progress{background-color:#585858}.button.is-info.is-hovered [class*=" icon-"]:before,.button.is-info.is-hovered [class^=icon-]:before,.button.is-info:hover [class*=" icon-"]:before,.button.is-info:hover [class^=icon-]:before{fill:#fff}.button.is-dangerish{background-color:#ff7043;border-color:transparent;color:rgba(0,0,0,.7)}.button.is-dangerish.is-hovered,.button.is-dangerish:not([disabled]):hover{background-color:#ff8a65;border-color:transparent;color:rgba(0,0,0,.7)}.button.is-dangerish.is-active,.button.is-dangerish:not([disabled]):active{background-color:#ff5722;border-color:transparent;color:rgba(0,0,0,.7)}.button.is-dangerish.is-outlined{background-color:transparent;border-color:#ff7043;color:#ff7043}.button.is-dangerish.is-outlined.is-focused,.button.is-dangerish.is-outlined.is-hovered,.button.is-dangerish.is-outlined:not([disabled]):focus,.button.is-dangerish.is-outlined:not([disabled]):hover{background-color:#ff7043;border-color:#ff7043;color:rgba(0,0,0,.7)}.button.is-wrappable{white-space:break-spaces;min-height:2.25em;height:auto}.checkbox:hover,.radio:hover{color:#7f8c8d}.select:not(.is-multiple):not(.is-loading):after,.select:not(.is-multiple):not(.is-loading):hover:after{border-color:#eff0f1}.select select[disabled]:hover,fieldset[disabled] .select select:hover{border-color:#585858}.message{background-color:#2f2f2f}.message-body{color:#eff0f1;border:0}.table{color:#bdc3c7;background-color:#000}.table.is-narrow{font-size:.75rem}.table.is-hoverable tbody tr:not(.is-selected):hover{background-color:#2f2f2f}.table td,.table th{white-space:nowrap;vertical-align:middle;border-bottom:1px solid #585858}.table th{color:#eff0f1;height:2.25em;font-weight:400}.table th.capitalize{text-transform:capitalize}.table thead td,.table thead th{color:#eff0f1;background-color:#383838;border-bottom:0;height:31px}.table tbody tr:last-child td,.table tbody tr:last-child th{border-bottom-width:1px}.table .cell-indent{padding-left:2.25em}.cc-window{font-family:inherit!important}.cc-link{padding:0!important}.section.has-extra-bottom-padding{padding-bottom:6.5rem}a.floating-home-button{display:flex;position:fixed;right:1.5rem;bottom:1.5rem;border-radius:100%;background-color:#209cee;color:#fff;width:3.5rem;height:3.5rem;justify-content:center;align-items:center;transition:background-color .25s}a.floating-home-button:hover{background-color:#67c3ff;color:#fff}a.floating-home-button>.icon{margin-top:-2px}.hero.is-fullheight>.hero-body{min-height:100vh;height:100%}.hero.is-fullheight>.hero-body>.container{width:100%}
@-webkit-keyframes fadeInOpacity{0%{opacity:0}to{opacity:1}}@keyframes fadeInOpacity{0%{opacity:0}to{opacity:1}}@-webkit-keyframes floatUp{0%{opacity:0;transform:scale(.86)}25%{opacity:1}67%{transform:scale(1)}to{transform:scale(1)}}@keyframes floatUp{0%{opacity:0;transform:scale(.86)}25%{opacity:1}67%{transform:scale(1)}to{transform:scale(1)}}html{background-color:#000;overflow-y:auto}body{color:#eff0f1;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}a{color:#209cee}a:hover{color:#67c3ff}hr{background-color:#585858}.message-body code,code{background-color:#000;border-radius:5px;font-size:1rem}.subtitle,.subtitle strong{color:#bdc3c7}.subtitle.is-brighter,.subtitle.is-brighter strong,.title{color:#eff0f1}.input,.select select,.textarea{color:#eff0f1;border-color:#585858;background-color:#000}.input::-moz-placeholder,.textarea::-moz-placeholder{color:#bdc3c7}.input::-webkit-input-placeholder,.textarea::-webkit-input-placeholder{color:#bdc3c7}.input:-moz-placeholder,.textarea:-moz-placeholder{color:#bdc3c7}.input:-ms-input-placeholder,.textarea:-ms-input-placeholder{color:#bdc3c7}.input.is-active,.input.is-focused,.input:active,.input:focus,.input:not([disabled]):hover,.select fieldset:not([disabled]) select:hover,.select select:not([disabled]):hover,.textarea.is-active,.textarea.is-focused,.textarea:active,.textarea:focus,.textarea:not([disabled]):hover,fieldset:not([disabled]) .input:hover,fieldset:not([disabled]) .select select:hover,fieldset:not([disabled]) .textarea:hover{border-color:#209cee}.input[disabled],.select fieldset[disabled] select,.select select[disabled],.textarea[disabled],fieldset[disabled] .input,fieldset[disabled] .select select,fieldset[disabled] .textarea{border-color:#585858;background-color:#2f2f2f}.label{color:#eff0f1;font-weight:400}.help{color:#bdc3c7}.progress{background-color:#585858}.button.is-info.is-hovered [class*=" icon-"]:before,.button.is-info.is-hovered [class^=icon-]:before,.button.is-info:hover [class*=" icon-"]:before,.button.is-info:hover [class^=icon-]:before{fill:#fff}.button.is-dangerish{background-color:#ff7043;border-color:transparent;color:rgba(0,0,0,.7)}.button.is-dangerish.is-hovered,.button.is-dangerish:not([disabled]):hover{background-color:#ff8a65;border-color:transparent;color:rgba(0,0,0,.7)}.button.is-dangerish.is-active,.button.is-dangerish:not([disabled]):active{background-color:#ff5722;border-color:transparent;color:rgba(0,0,0,.7)}.button.is-dangerish.is-outlined{background-color:transparent;border-color:#ff7043;color:#ff7043}.button.is-dangerish.is-outlined.is-focused,.button.is-dangerish.is-outlined.is-hovered,.button.is-dangerish.is-outlined:not([disabled]):focus,.button.is-dangerish.is-outlined:not([disabled]):hover{background-color:#ff7043;border-color:#ff7043;color:rgba(0,0,0,.7)}.button.is-wrappable{white-space:break-spaces;min-height:2.25em;height:auto}.checkbox:hover,.radio:hover{color:#7f8c8d}.select:not(.is-multiple):not(.is-loading):after,.select:not(.is-multiple):not(.is-loading):hover:after{border-color:#eff0f1}.select select[disabled]:hover,fieldset[disabled] .select select:hover{border-color:#585858}.message{background-color:#2f2f2f}.message-body{color:#eff0f1;border:0}.table{color:#bdc3c7;background-color:#000}.table.is-narrow{font-size:.75rem}.table.is-hoverable tbody tr:not(.is-selected):hover{background-color:#2f2f2f}.table td,.table th{white-space:nowrap;vertical-align:middle;border-bottom:1px solid #585858}.table th{color:#eff0f1;height:2.25em;font-weight:400}.table th.capitalize{text-transform:capitalize}.table thead td,.table thead th{color:#eff0f1;background-color:#383838;border-bottom:0;height:31px}.table tbody tr:last-child td,.table tbody tr:last-child th{border-bottom-width:1px}.table .cell-indent{padding-left:2.25em}.cc-window{font-family:inherit!important}.cc-link{padding:0!important}.section.has-extra-bottom-padding{padding-bottom:6.5rem}a.floating-home-button{display:flex;position:fixed;right:1.5rem;bottom:1.5rem;border-radius:100%;background-color:#209cee;color:#fff;width:3.5rem;height:3.5rem;justify-content:center;align-items:center;transition:background-color .25s}a.floating-home-button:hover{background-color:#67c3ff;color:#fff}a.floating-home-button>.icon{margin-top:-2px}.hero.is-fullheight>.hero-body{min-height:100vh;height:100%}.hero.is-fullheight>.hero-body>.container{width:100%}
/*# sourceMappingURL=style.css.map */

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
var newsfeed={lsKey:"newsfeed",feedUrl:"https://blog.fiery.me/rss-newsfeed.xml",maxItems:3,dismissed:{},done:!1,simpleParseDate:function(e){var t={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},n=e.match(/[a-zA-Z]*,\s(\d{2})\s([a-zA-Z]{3})\s(\d{4})\s(\d{2}):(\d{2}):(\d{2})\sGMT/);if(n&&void 0!==t[n[2]]){var i=new Date;return i.setUTCDate(n[1]),i.setUTCMonth(t[n[2]]),i.setUTCFullYear(n[3]),i.setUTCHours(n[4]),i.setUTCMinutes(n[5]),i.setUTCSeconds(n[6]),i}},formatRelativeDate:function(e){var t,n;return e<60?(t=e,n="second"):e<3600?(t=Math.floor(e/60),n="minute"):e<86400?(t=Math.floor(e/3600),n="hour"):e<604800?(t=Math.floor(e/86400),n="day"):(t=Math.floor(e/604800),n="week"),t+" "+n+(1!==t?"s":"")+" ago"},formatNotification:function(e){var t=newsfeed.simpleParseDate(e.pubDate),n=Math.round((+new Date-t)/1e3),i=n<=604800,s=document.createElement("div");return s.dataset.identifier=e.identifier,s.className="notification is-info",s.innerHTML='\n <button class="delete" title="Dismiss"></button>\n <div class="content">\n <div class="news-title">\n <a href="'+e.link+'" target="_blank">'+(e.title||"Untitled")+'</a>\n </div>\n <div class="news-excerpt">\n '+(e.description?""+("…"===e.description.slice(-1)?e.description.slice(0,-1)+' <a href="'+e.link+'" target="_blank">[…]</a>':e.description):"N/A")+'\n </div>\n <div class="news-date'+(i?" is-recent-week":"")+'" title="'+t.toLocaleString()+'">\n '+newsfeed.formatRelativeDate(n)+"\n </div>\n <div>\n ",s},dismissNotification:function(e){if(e&&e.dataset.identifier){newsfeed.dismissed[e.dataset.identifier]=1,e.parentNode.removeChild(e);var t=Object.keys(newsfeed.dismissed);if(t.length>newsfeed.maxItems)for(var n=0;n<t.length-newsfeed.maxItems;n++)delete newsfeed.dismissed[t[n]];localStorage[newsfeed.lsKey]=JSON.stringify(newsfeed.dismissed)}},do:function(){return axios.get(newsfeed.feedUrl,{responseType:"document"}).then((function(e){if(!(e&&e.data&&e.data.documentElement instanceof Element))throw Error("response.data.documentElement is NOT an instance of Element");var t=e.data.documentElement.querySelectorAll("item");if(t.length){var n=localStorage[newsfeed.lsKey];n&&(newsfeed.dismissed=JSON.parse(n));var i=document.createElement("section");i.id="newsfeed",i.className="section",i.innerHTML='\n <div class="columns is-gapless">\n <div class="column is-hidden-mobile"></div>\n <div class="column is-hidden-mobile"></div>\n <div class="column"></div>\n </div>\n ';for(var s=i.querySelector(".columns > .column:last-child"),d=0;d<Math.min(newsfeed.maxItems,t.length);d++){var a=t[d].querySelector("title"),o=t[d].querySelector("description"),r=t[d].querySelector("pubDate"),l=t[d].querySelector("link"),c=a?a.textContent:"",f=o?o.textContent:"",m=r?r.textContent:"",u=l?l.textContent:"",v=c+"|"+f+"|"+m+"|"+u;if(!newsfeed.dismissed[v]){var w=newsfeed.formatNotification({title:c,description:f,pubDate:m,link:u,identifier:v});w.querySelector(".delete").addEventListener("click",(function(){newsfeed.dismissNotification(event.target.parentNode)})),s.appendChild(w)}}document.body.appendChild(i)}})).catch(console.error)},onloaded:function(){"undefined"!=typeof page&&page.apiChecked&&!newsfeed.done&&newsfeed.do()}};"interactive"===document.readyState||"complete"===document.readyState?newsfeed.onloaded():window.addEventListener("DOMContentLoaded",(function(){return newsfeed.onloaded()}));
var newsfeed={lsKey:"newsfeed",feedUrl:"https://blog.fiery.me/rss-newsfeed.xml",maxItems:3,dismissed:{},done:!1,simpleParseDate:function(e){var t={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},n=e.match(/[a-zA-Z]*,\s(\d{2})\s([a-zA-Z]{3})\s(\d{4})\s(\d{2}):(\d{2}):(\d{2})\sGMT/);if(n&&void 0!==t[n[2]]){var i=new Date;return i.setUTCDate(n[1]),i.setUTCMonth(t[n[2]]),i.setUTCFullYear(n[3]),i.setUTCHours(n[4]),i.setUTCMinutes(n[5]),i.setUTCSeconds(n[6]),i}},formatRelativeDate:function(e){var t,n;return e<60?(t=e,n="second"):e<3600?(t=Math.floor(e/60),n="minute"):e<86400?(t=Math.floor(e/3600),n="hour"):e<604800?(t=Math.floor(e/86400),n="day"):(t=Math.floor(e/604800),n="week"),t+" "+n+(1!==t?"s":"")+" ago"},formatNotification:function(e){var t=newsfeed.simpleParseDate(e.pubDate),n=Math.round((+new Date-t)/1e3),i=n<=604800,s=document.createElement("a");return s.dataset.identifier=e.identifier,s.className="notification is-info",s.href=e.link,s.target="_blank",s.innerHTML='\n <button class="delete" title="Dismiss"></button>\n <div class="content">\n <div class="news-title">\n '+(e.title||"Untitled")+'\n </div>\n <div class="news-excerpt">\n '+(e.description?""+("…"===e.description.slice(-1)?e.description.slice(0,-1)+" […]":e.description):"N/A")+'\n </div>\n <div class="news-date'+(i?" is-recent-week":"")+'">\n <span title="'+t.toLocaleString()+'">'+newsfeed.formatRelativeDate(n)+"</span>\n </div>\n <div>\n ",s},dismissNotification:function(e){if(e&&e.dataset.identifier){newsfeed.dismissed[e.dataset.identifier]=1,e.parentNode.removeChild(e);var t=Object.keys(newsfeed.dismissed);if(t.length>newsfeed.maxItems)for(var n=0;n<t.length-newsfeed.maxItems;n++)delete newsfeed.dismissed[t[n]];localStorage[newsfeed.lsKey]=JSON.stringify(newsfeed.dismissed)}},do:function(){return axios.get(newsfeed.feedUrl,{responseType:"document"}).then((function(e){if(!(e&&e.data&&e.data.documentElement instanceof Element))throw Error("response.data.documentElement is NOT an instance of Element");var t=e.data.documentElement.querySelectorAll("item");if(t.length){var n=localStorage[newsfeed.lsKey];n&&(newsfeed.dismissed=JSON.parse(n));var i=document.createElement("section");i.id="newsfeed",i.className="section",i.innerHTML='\n <div class="columns is-gapless">\n <div class="column is-hidden-mobile"></div>\n <div class="column is-hidden-mobile"></div>\n <div class="column has-text-right"></div>\n </div>\n ';for(var s=i.querySelector(".columns > .column:last-child"),d=0;d<Math.min(newsfeed.maxItems,t.length);d++){var a=t[d].querySelector("title"),o=t[d].querySelector("description"),r=t[d].querySelector("pubDate"),l=t[d].querySelector("link"),c=a?a.textContent:"",f=o?o.textContent:"",m=r?r.textContent:"",u=l?l.textContent:"",v=c+"|"+f+"|"+m+"|"+u;if(!newsfeed.dismissed[v]){var p=newsfeed.formatNotification({title:c,description:f,pubDate:m,link:u,identifier:v}),w=p.querySelector(".delete");w&&w.addEventListener("click",(function(){event.preventDefault(),newsfeed.dismissNotification(event.target.parentNode)})),s.appendChild(p)}}document.body.appendChild(i)}})).catch(console.error)},onloaded:function(){"undefined"!=typeof page&&page.apiChecked&&!newsfeed.done&&newsfeed.do()}};"interactive"===document.readyState||"complete"===document.readyState?newsfeed.onloaded():window.addEventListener("DOMContentLoaded",(function(){return newsfeed.onloaded()}));
//# sourceMappingURL=newsfeed.js.map

File diff suppressed because one or more lines are too long

View File

@ -5,11 +5,7 @@
display: inline-block;
margin-bottom: 40px;
vertical-align: top;
animation-delay: 0.5s;
animation-duration: 1.5s;
animation-fill-mode: both;
animation-name: floatUp;
animation-timing-function: cubic-bezier(0, 0.71, 0.29, 1)
animation: fadeInOpacity 0.5s
}
.logo {
@ -48,44 +44,6 @@
display: none
}
@-webkit-keyframes floatUp {
0% {
opacity: 0;
transform: scale(0.86)
}
25% {
opacity: 100
}
67% {
transform: scale(1)
}
100% {
transform: scale(1)
}
}
@keyframes floatUp {
0% {
opacity: 0;
transform: scale(0.86)
}
25% {
opacity: 100
}
67% {
transform: scale(1)
}
100% {
transform: scale(1)
}
}
.uploads {
display: flex;
flex-direction: column
@ -209,13 +167,20 @@
font-weight: bold
}
input[type="file"].is-fullwidth {
width: 100%
}
/** Render **/
.render {
position: fixed;
right: 0;
bottom: 0;
font-size: 1rem;
color: #bdc3c7;
cursor: pointer
cursor: pointer;
animation: floatUp 1.5s cubic-bezier(0, 0.71, 0.29, 1) 0.5s 1 normal both
}
.render.button {
@ -230,9 +195,7 @@
opacity: 1
}
input[type="file"].is-fullwidth {
width: 100%
}
/** Newsfeed **/
#newsfeed {
position: absolute;
@ -242,11 +205,20 @@ input[type="file"].is-fullwidth {
padding: 1.5rem 1.5rem 0 1.5rem
}
#newsfeed .column:last-child {
animation: floatUp 1.5s cubic-bezier(0, 0.71, 0.29, 1) 0.5s 1 normal both
}
#newsfeed .notification {
padding: 0.9375rem 1.875rem 0.9375rem 1.125rem;
display: block;
padding: 0.75rem 2.25rem 0.75rem 1.125rem;
margin-bottom: 1.125rem
}
#newsfeed .notification > .delete {
top: 0.75rem
}
#newsfeed .notification .content {
font-size: 0.75rem
}

View File

@ -1,12 +1,4 @@
html {
background-color: #000;
overflow-y: auto
}
body {
color: #eff0f1;
animation: fadeInOpacity 0.5s
}
/** Animations **/
@-webkit-keyframes fadeInOpacity {
0% {
@ -28,6 +20,56 @@ body {
}
}
@-webkit-keyframes floatUp {
0% {
opacity: 0;
transform: scale(0.86)
}
25% {
opacity: 100
}
67% {
transform: scale(1)
}
100% {
transform: scale(1)
}
}
@keyframes floatUp {
0% {
opacity: 0;
transform: scale(0.86)
}
25% {
opacity: 100
}
67% {
transform: scale(1)
}
100% {
transform: scale(1)
}
}
/** General **/
html {
background-color: #000;
overflow-y: auto
}
body {
color: #eff0f1;
animation: fadeInOpacity 0.5s
}
a {
color: #209cee
}

View File

@ -61,24 +61,24 @@ newsfeed.formatNotification = item => {
const dateDelta = Math.round((+new Date() - parsedDate) / 1000)
const isRecentWeek = dateDelta <= 604800
const element = document.createElement('div')
const element = document.createElement('a')
element.dataset.identifier = item.identifier
element.className = 'notification is-info'
element.href = item.link
element.target = '_blank'
element.innerHTML = `
<button class="delete" title="Dismiss"></button>
<div class="content">
<div class="news-title">
<a href="${item.link}" target="_blank">${item.title || 'Untitled'}</a>
${item.title || 'Untitled'}
</div>
<div class="news-excerpt">
${item.description
? `${item.description.slice(-1) === '…'
? `${item.description.slice(0, -1)} <a href="${item.link}" target="_blank">[…]</a>`
: item.description}`
? `${item.description.slice(-1) === '…' ? `${item.description.slice(0, -1)} […]` : item.description}`
: 'N/A'}
</div>
<div class="news-date${isRecentWeek ? ' is-recent-week' : ''}" title="${parsedDate.toLocaleString()}">
${newsfeed.formatRelativeDate(dateDelta)}
<div class="news-date${isRecentWeek ? ' is-recent-week' : ''}">
<span title="${parsedDate.toLocaleString()}">${newsfeed.formatRelativeDate(dateDelta)}</span>
</div>
<div>
`
@ -118,7 +118,7 @@ newsfeed.do = () => {
<div class="columns is-gapless">
<div class="column is-hidden-mobile"></div>
<div class="column is-hidden-mobile"></div>
<div class="column"></div>
<div class="column has-text-right"></div>
</div>
`
const column = element.querySelector('.columns > .column:last-child')
@ -141,7 +141,10 @@ newsfeed.do = () => {
title, description, pubDate, link, identifier
})
notificationElement.querySelector('.delete').addEventListener('click', function () {
const dismissTrigger = notificationElement.querySelector('.delete')
if (dismissTrigger)
dismissTrigger.addEventListener('click', function () {
event.preventDefault()
newsfeed.dismissNotification(event.target.parentNode)
})

View File

@ -1,5 +1,5 @@
{
"1": "1595882711",
"1": "1595929408",
"2": "1589010026",
"3": "1581416390",
"4": "1581416390",