-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
1 lines (1 loc) · 5.91 KB
/
Copy pathscript.js
File metadata and controls
1 lines (1 loc) · 5.91 KB
1
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var s=e[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(r,s,function(e){return t[e]}.bind(null,s));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e){const n=t=>e=>e.method.toLowerCase()===t.toLowerCase(),r=n("connect"),s=n("delete"),o=n("get"),a=n("head"),i=n("options"),u=n("patch"),l=n("post"),c=n("put"),h=n("trace"),d=t=>e=>{const n=new URL(e.url).pathname;return(n.match(t)||[])[0]===n};t.exports=class{constructor(){this.routes=[]}handle(t,e){return this.routes.push({conditions:t,handler:e}),this}connect(t,e){return this.handle([r,d(t)],e)}delete(t,e){return this.handle([s,d(t)],e)}get(t,e){return this.handle([o,d(t)],e)}head(t,e){return this.handle([a,d(t)],e)}options(t,e){return this.handle([i,d(t)],e)}patch(t,e){return this.handle([u,d(t)],e)}post(t,e){return this.handle([l,d(t)],e)}put(t,e){return this.handle([c,d(t)],e)}trace(t,e){return this.handle([h,d(t)],e)}all(t){return this.handle([],t)}route(t){const e=this.resolve(t);return e?e.handler(t):new Response("resource not found",{status:404,statusText:"not found",headers:{"content-type":"text/plain"}})}resolve(t){return this.routes.find(e=>!(e.conditions&&(!Array.isArray(e)||e.conditions.length))||("function"==typeof e.conditions?e.conditions(t):e.conditions.every(e=>e(t))))}}},function(t,e){t.exports=class{constructor(t){this.links=t}async element(t){for(var e="\n",n=0;n<this.links.length;n++){var r="\t\t<a href=";r+='"'+this.links[n].url,r+='">'+this.links[n].name,e+=r+="</a>",e+="\n"}t.append(e,{html:!0})}}},function(t,e){t.exports=class{constructor(t){this.background=t}async element(t){var e="\n\t<div style=\"background-image: url('"+this.background+"');\">";t.prepend(e,{html:!0})}}},function(t,e){t.exports=class{constructor(t){this.links=t}async element(t){t.setAttribute("style","");t.append('\n\t<a href="https://www.linkedin.com/in/yusuf-mostafa-293b83148/">\n\t\t<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>LinkedIn</title><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>\n\t</a>',{html:!0}),t.append('\n\t<a href="https://github.com/Electrex/">\n\t\t<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>\n\t</a>',{html:!0}),t.append('\n\t<a href="https://www.youtube.com/channel/UCVCGOmEfk8gpyZfniHDtmCg">\n\t\t<svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>YouTube</title><path d="M23.495 6.205a3.007 3.007 0 0 0-2.088-2.088c-1.87-.501-9.396-.501-9.396-.501s-7.507-.01-9.396.501A3.007 3.007 0 0 0 .527 6.205a31.247 31.247 0 0 0-.522 5.805 31.247 31.247 0 0 0 .522 5.783 3.007 3.007 0 0 0 2.088 2.088c1.868.502 9.396.502 9.396.502s7.506 0 9.396-.502a3.007 3.007 0 0 0 2.088-2.088 31.247 31.247 0 0 0 .5-5.783 31.247 31.247 0 0 0-.5-5.805zM9.609 15.601V8.408l6.264 3.602z"/></svg>\n\t</a>',{html:!0})}}},function(t,e,n){"use strict";n.r(e);var r=n(0),s=n.n(r),o=n(1),a=n.n(o),i=n(2),u=n.n(i),l=n(3),c=n.n(l),h=[{name:"LinkedIn",url:"https://www.linkedin.com/in/yusuf-mostafa-293b83148/"},{name:"Github",url:"https://github.com/Electrex/"},{name:"YouTube",url:"https://www.youtube.com/channel/UCVCGOmEfk8gpyZfniHDtmCg"}];addEventListener("fetch",t=>{t.respondWith(async function(t){const e=new s.a;if("/links"==new URL(t.url).pathname){e.get("/links",t=>function(t){const e=JSON.stringify(h);return new Response(e,{headers:{"content-type":"application/json;charset=UTF-8"}})}());return await e.route(t)}{const t=(new HTMLRewriter).on("div#links",new a.a(h)).on("img#avatar",{element:t=>{t.setAttribute("src","https://avatars1.githubusercontent.com/u/11496110?s=460&u=e8ca84c6cb7f02fe72b3761d9b1b65d8258b0e18&v=4")}}).on("div#profile",{element:t=>{t.setAttribute("style","")}}).on("title",{element:t=>{t.setInnerContent("Yusuf Mostafa")}}).on("body",new u.a("https://cdnb.artstation.com/p/assets/images/images/001/636/155/large/yakovlev-art-pylot-fanart.jpg?1449881887")).on("div#social",new c.a(h)).on("h1#name",{element:t=>{t.setInnerContent("Yusuf Mostafa")}});var n=await fetch("https://static-links-page.signalnerve.workers.dev");return t.transform(n)}}(t.request))})}]);