diff --git a/assets/comment-quote-outline-UnNX39K_.svg b/assets/comment-quote-outline-UnNX39K_.svg new file mode 100644 index 0000000..04e9469 --- /dev/null +++ b/assets/comment-quote-outline-UnNX39K_.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/index-Jcbj7HI_.css b/assets/index-Jcbj7HI_.css new file mode 100644 index 0000000..af532c1 --- /dev/null +++ b/assets/index-Jcbj7HI_.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Rubik:wght@300;400&display=swap";.btn.svelte-136yeq3{background:var(--current-color);border-radius:3px;display:flex;justify-content:center;align-items:center;padding:10px;transition:background var(--transition-duration);color:#fff;border:none;cursor:pointer;font-size:var(--font-size-s);white-space:nowrap}.btn.svelte-136yeq3:hover{opacity:.8}.btn.svelte-136yeq3>img{width:20px;aspect-ratio:1/1}button.svelte-136yeq3{padding-inline:12px}.btn.svelte-r3dc7a{background:var(--current-color);border-radius:3px;display:flex;justify-content:center;align-items:center;padding:10px;transition:background var(--transition-duration);color:#fff;border:none;cursor:pointer;font-size:var(--font-size-s);white-space:nowrap}.btn.svelte-r3dc7a:hover{opacity:.8}.btn.svelte-r3dc7a>img{width:20px;aspect-ratio:1/1}@keyframes svelte-1ebnxd5-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#quote-box.svelte-1ebnxd5{width:500px;display:flex;flex-direction:column;justify-content:space-between;gap:30px;padding:30px;border-radius:3px;background:#fff}blockquote.svelte-1ebnxd5{display:flex;flex-direction:column;gap:15px}blockquote.svelte-1ebnxd5 *{color:var(--current-color);transition:color var(--transition-duration)}blockquote.svelte-1ebnxd5:has(.fetching){flex-direction:row;justify-content:center}.fetching.svelte-1ebnxd5,#text.svelte-1ebnxd5,#title.svelte-1ebnxd5,.error.svelte-1ebnxd5{font-size:var(--font-size-l);text-align:center}#author.svelte-1ebnxd5{font-size:var(--font-size-m);font-weight:300;margin-left:auto}#desc.svelte-1ebnxd5{font-size:var(--font-size-s);text-align:justify;max-height:200px;overflow-y:auto}#btn-container.svelte-1ebnxd5{display:flex;justify-content:space-between}#btn-container.svelte-1ebnxd5>div{display:flex;gap:10px}#btn-container.svelte-1ebnxd5>.control{margin-left:auto}.loading-icon.svelte-1ebnxd5{width:var(--font-size-m);aspect-ratio:1/1;animation:svelte-1ebnxd5-spin 1s linear infinite}.loading-icon.svelte-1ebnxd5>path{fill:var(--current-color)}@media (max-width: 768px){#quote-box.svelte-1ebnxd5{max-width:500px;width:100%}}select.svelte-1ck14yg{position:absolute;top:30px;right:30px;cursor:pointer;min-width:175px;border-radius:3px;border:none;font-size:var(--font-size-s);color:var(--current-color);transition:color var(--transition-duration);padding-left:.5rem}:root{--current-color:black;--transition-duration:1s;--font-size-l:2.5rem;--font-size-m:2rem;--font-size-s:1.5rem}main.svelte-11xf4py{background:var(--current-color);flex:1;display:grid;place-items:center;transition:background var(--transition-duration)}main.svelte-11xf4py *{font-family:Rubik,sans-serif} diff --git a/assets/index-yX75kDKz.js b/assets/index-yX75kDKz.js new file mode 100644 index 0000000..2edbe5a --- /dev/null +++ b/assets/index-yX75kDKz.js @@ -0,0 +1,5 @@ +var ye=Object.defineProperty;var qe=(t,e,n)=>e in t?ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var G=(t,e,n)=>(qe(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const r of c.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(l){if(l.ep)return;l.ep=!0;const c=n(l);fetch(l.href,c)}})();function h(){}function Le(t,e){for(const n in e)t[n]=e[n];return t}function Ce(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function _e(t){return t()}function ne(){return Object.create(null)}function S(t){t.forEach(_e)}function pe(t){return typeof t=="function"}function z(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let j;function T(t,e){return t===e?!0:(j||(j=document.createElement("a")),j.href=e,t===j.href)}function Me(t){return Object.keys(t).length===0}function Fe(t,...e){if(t==null){for(const o of e)o(void 0);return h}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Ee(t,e,n){t.$$.on_destroy.push(Fe(e,n))}function Ne(t,e,n,o){if(t){const l=be(t,e,n,o);return t[0](l)}}function be(t,e,n,o){return t[1]&&o?Le(n.ctx.slice(),t[1](o(e))):n.ctx}function Oe(t,e,n,o){if(t[2]&&o){const l=t[2](o(n));if(e.dirty===void 0)return l;if(typeof l=="object"){const c=[],r=Math.max(e.dirty.length,l.length);for(let s=0;s32){const e=[],n=t.ctx.length/32;for(let o=0;ot.removeEventListener(e,n,o)}function d(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Qe(t){return Array.from(t.childNodes)}function P(t,e){e=""+e,t.data!==e&&(t.data=e)}function oe(t,e){t.value=e??""}function Pe(t,e,{bubbles:n=!1,cancelable:o=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:o})}let x;function M(t){x=t}function ve(){if(!x)throw new Error("Function called outside component initialization");return x}function Be(){const t=ve();return(e,n,{cancelable:o=!1}={})=>{const l=t.$$.callbacks[e];if(l){const c=Pe(e,n,{cancelable:o});return l.slice().forEach(r=>{r.call(t,c)}),!c.defaultPrevented}return!0}}function $e(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(o=>o.call(this,e))}const I=[],le=[];let Q=[];const ce=[],Re=Promise.resolve();let Z=!1;function Te(){Z||(Z=!0,Re.then(ee))}function D(t){Q.push(t)}const W=new Set;let A=0;function ee(){if(A!==0)return;const t=x;do{try{for(;At.indexOf(o)===-1?e.push(o):n.push(o)),n.forEach(o=>o()),Q=e}const U=new Set;let O;function K(){O={r:0,c:[],p:O}}function Y(){O.r||S(O.c),O=O.p}function $(t,e){t&&t.i&&(U.delete(t),t.i(e))}function q(t,e,n,o){if(t&&t.o){if(U.has(t))return;U.add(t),O.c.push(()=>{U.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}else o&&o()}function J(t,e){const n=e.token={};function o(l,c,r,s){if(e.token!==n)return;e.resolved=s;let i=e.ctx;r!==void 0&&(i=i.slice(),i[r]=s);const u=l&&(e.current=l)(i);let m=!1;e.block&&(e.blocks?e.blocks.forEach((a,f)=>{f!==c&&a&&(K(),q(a,1,1,()=>{e.blocks[f]===a&&(e.blocks[f]=null)}),Y())}):e.block.d(1),u.c(),$(u,1),u.m(e.mount(),e.anchor),m=!0),e.block=u,e.blocks&&(e.blocks[c]=u),m&&ee()}if(Ce(t)){const l=ve();if(t.then(c=>{M(l),o(e.then,1,e.value,c),M(null)},c=>{if(M(l),o(e.catch,2,e.error,c),M(null),!e.hasCatch)throw c}),e.current!==e.pending)return o(e.pending,0),!0}else{if(e.current!==e.then)return o(e.then,1,e.value,t),!0;e.resolved=t}}function ke(t,e,n){const o=e.slice(),{resolved:l}=t;t.current===t.then&&(o[t.value]=l),t.current===t.catch&&(o[t.error]=l),t.block.p(o,n)}function re(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function N(t){t&&t.c()}function F(t,e,n){const{fragment:o,after_update:l}=t.$$;o&&o.m(e,n),D(()=>{const c=t.$$.on_mount.map(_e).filter(pe);t.$$.on_destroy?t.$$.on_destroy.push(...c):S(c),t.$$.on_mount=[]}),l.forEach(D)}function E(t,e){const n=t.$$;n.fragment!==null&&(Se(n.after_update),S(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function je(t,e){t.$$.dirty[0]===-1&&(I.push(t),Te(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const _=g.length?g[0]:f;return u.ctx&&l(u.ctx[a],u.ctx[a]=_)&&(!u.skip_bound&&u.bound[a]&&u.bound[a](_),m&&je(t,a)),f}):[],u.update(),m=!0,S(u.before_update),u.fragment=o?o(u.ctx):!1,e.target){if(e.hydrate){const a=Qe(e.target);u.fragment&&u.fragment.l(a),a.forEach(b)}else u.fragment&&u.fragment.c();e.intro&&$(t.$$.fragment),F(t,e.target,e.anchor),ee()}M(i)}class R{constructor(){G(this,"$$");G(this,"$$set")}$destroy(){E(this,1),this.$destroy=h}$on(e,n){if(!pe(n))return h;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const l=o.indexOf(n);l!==-1&&o.splice(l,1)}}$set(e){this.$$set&&!Me(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ue="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ue);function Ve(t){return fetch(`https://quote-api-u0ka.onrender.com/api/collections/${t}`).then(e=>e.json()).then(e=>e)}function Ge(){return fetch("https://quote-api-u0ka.onrender.com/api/collections").then(t=>t.json()).then(t=>t)}function se(t){return t==="Villains"}function ie(t){return["Villains","How to Win Friends and Influence People"].includes(t)}const H=[];function We(t,e=h){let n;const o=new Set;function l(s){if(z(t,s)&&(t=s,n)){const i=!H.length;for(const u of o)u[1](),H.push(u,t);if(i){for(let u=0;u{o.delete(u),o.size===0&&n&&(n(),n=null)}}return{set:l,update:c,subscribe:r}}function Ze(t){let e,n,o,l,c,r;const s=t[3].default,i=Ne(s,t,t[2],null);return{c(){e=v("button"),n=L(t[1]),o=C(),i&&i.c(),d(e,"id",t[0]),d(e,"class","btn svelte-136yeq3")},m(u,m){w(u,e,m),k(e,n),k(e,o),i&&i.m(e,null),l=!0,c||(r=we(e,"click",t[4]),c=!0)},p(u,[m]){(!l||m&2)&&P(n,u[1]),i&&i.p&&(!l||m&4)&&ze(i,s,u,u[2],l?Oe(s,u[2],m,null):Ae(u[2]),null),(!l||m&1)&&d(e,"id",u[0])},i(u){l||($(i,u),l=!0)},o(u){q(i,u),l=!1},d(u){u&&b(e),i&&i.d(u),c=!1,r()}}}function De(t,e,n){let{$$slots:o={},$$scope:l}=e,{id:c=null}=e,{content:r=""}=e;function s(i){$e.call(this,t,i)}return t.$$set=i=>{"id"in i&&n(0,c=i.id),"content"in i&&n(1,r=i.content),"$$scope"in i&&n(2,l=i.$$scope)},[c,r,l,o,s]}class X extends R{constructor(e){super(),B(this,e,De,Ze,z,{id:0,content:1})}}function Ke(t){let e,n,o;return{c(){e=v("a"),n=v("img"),T(n.src,o=t[1])||d(n,"src",o),d(n,"alt",t[3]),d(e,"id",t[0]),d(e,"class","btn svelte-r3dc7a"),d(e,"href",t[2]),d(e,"target","_blank")},m(l,c){w(l,e,c),k(e,n)},p(l,[c]){c&2&&!T(n.src,o=l[1])&&d(n,"src",o),c&8&&d(n,"alt",l[3]),c&1&&d(e,"id",l[0]),c&4&&d(e,"href",l[2])},i:h,o:h,d(l){l&&b(e)}}}function Ye(t,e,n){let{id:o}=e,{icon:l}=e,{href:c}=e,{alt:r}=e;return t.$$set=s=>{"id"in s&&n(0,o=s.id),"icon"in s&&n(1,l=s.icon),"href"in s&&n(2,c=s.href),"alt"in s&&n(3,r=s.alt)},[o,l,c,r]}class ue extends R{constructor(e){super(),B(this,e,Ye,Ke,z,{id:0,icon:1,href:2,alt:3})}}const Je="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='16'%20width='16'%20viewBox='0%200%20512%20512'%3e%3c!--!Font%20Awesome%20Free%206.5.1%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license/free%20Copyright%202024%20Fonticons,%20Inc.--%3e%3cpath%20opacity='1'%20fill='%23fff'%20d='M389.2%2048h70.6L305.6%20224.2%20487%20464H345L233.7%20318.6%20106.5%20464H35.8L200.7%20275.5%2026.8%2048H172.4L272.9%20180.9%20389.2%2048zM364.4%20421.8h39.1L151.1%2088h-42L364.4%20421.8z'/%3e%3c/svg%3e",Xe="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='16'%20width='10'%20viewBox='0%200%20320%20512'%3e%3c!--!Font%20Awesome%20Free%206.5.1%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license/free%20Copyright%202024%20Fonticons,%20Inc.--%3e%3cpath%20opacity='1'%20fill='%23fff'%20d='M309.8%20480.3c-13.6%2014.5-50%2031.7-97.4%2031.7-120.8%200-147-88.8-147-140.6v-144H17.9c-5.5%200-10-4.5-10-10v-68c0-7.2%204.5-13.6%2011.3-16%2062-21.8%2081.5-76%2084.3-117.1%20.8-11%206.5-16.3%2016.1-16.3h70.9c5.5%200%2010%204.5%2010%2010v115.2h83c5.5%200%2010%204.4%2010%209.9v81.7c0%205.5-4.5%2010-10%2010h-83.4V360c0%2034.2%2023.7%2053.6%2068%2035.8%204.8-1.9%209-3.2%2012.7-2.2%203.5%20.9%205.8%203.4%207.4%207.9l22%2064.3c1.8%205%203.3%2010.6-.4%2014.5z'/%3e%3c/svg%3e",et="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20640%20512'%3e%3c!--!Font%20Awesome%20Free%206.5.2%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license/free%20Copyright%202024%20Fonticons,%20Inc.--%3e%3cpath%20fill='%23fff'%20d='M274.9%2034.3c-28.1-28.1-73.7-28.1-101.8%200L34.3%20173.1c-28.1%2028.1-28.1%2073.7%200%20101.8L173.1%20413.7c28.1%2028.1%2073.7%2028.1%20101.8%200L413.7%20274.9c28.1-28.1%2028.1-73.7%200-101.8L274.9%2034.3zM200%20224a24%2024%200%201%201%2048%200%2024%2024%200%201%201%20-48%200zM96%20200a24%2024%200%201%201%200%2048%2024%2024%200%201%201%200-48zM224%20376a24%2024%200%201%201%200-48%2024%2024%200%201%201%200%2048zM352%20200a24%2024%200%201%201%200%2048%2024%2024%200%201%201%200-48zM224%20120a24%2024%200%201%201%200-48%2024%2024%200%201%201%200%2048zm96%20328c0%2035.3%2028.7%2064%2064%2064H576c35.3%200%2064-28.7%2064-64V256c0-35.3-28.7-64-64-64H461.7c11.6%2036%203.1%2077-25.4%20105.5L320%20413.8V448zM480%20328a24%2024%200%201%201%200%2048%2024%2024%200%201%201%200-48z'/%3e%3c/svg%3e",tt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23fff'%20d='M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z'%20/%3e%3c/svg%3e",nt="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23fff'%20d='M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z'%20/%3e%3c/svg%3e";function ot(t){let e;return{c(){e=v("blockquote"),e.innerHTML='

Cannot fetch quotes. Try again later.

',d(e,"class","svelte-1ebnxd5")},m(n,o){w(n,e,o)},p:h,i:h,o:h,d(n){n&&b(e)}}}function lt(t){let e,n,o,l,c,r,s,i;function u(_,p){return _[1]?rt:ct}let m=u(t),a=m(t),f=t[9].desc&&ae(t);r=new X({props:{id:"randomize",$$slots:{default:[st]},$$scope:{ctx:t}}}),r.$on("click",t[6]);let g=!t[2]&&de(t);return{c(){e=v("blockquote"),a.c(),n=C(),o=v("div"),f&&f.c(),l=C(),c=v("div"),N(r.$$.fragment),s=C(),g&&g.c(),d(e,"class","svelte-1ebnxd5"),d(c,"class","control"),d(o,"id","btn-container"),d(o,"class","svelte-1ebnxd5")},m(_,p){w(_,e,p),a.m(e,null),w(_,n,p),w(_,o,p),f&&f.m(o,null),k(o,l),k(o,c),F(r,c,null),k(c,s),g&&g.m(c,null),i=!0},p(_,p){m===(m=u(_))&&a?a.p(_,p):(a.d(1),a=m(_),a&&(a.c(),a.m(e,null))),_[9].desc?f?(f.p(_,p),p&1&&$(f,1)):(f=ae(_),f.c(),$(f,1),f.m(o,l)):f&&(K(),q(f,1,1,()=>{f=null}),Y());const y={};p&1024&&(y.$$scope={dirty:p,ctx:_}),r.$set(y),_[2]?g&&(K(),q(g,1,1,()=>{g=null}),Y()):g?(g.p(_,p),p&4&&$(g,1)):(g=de(_),g.c(),$(g,1),g.m(c,null))},i(_){i||($(f),$(r.$$.fragment,_),$(g),i=!0)},o(_){q(f),q(r.$$.fragment,_),q(g),i=!1},d(_){_&&(b(e),b(n),b(o)),a.d(),f&&f.d(),E(r),g&&g.d()}}}function ct(t){let e,n=t[9].title+"",o,l,c,r=t[9].desc&&fe(t);return{c(){e=v("p"),o=L(n),l=C(),r&&r.c(),c=Ie(),d(e,"id","title"),d(e,"class","svelte-1ebnxd5")},m(s,i){w(s,e,i),k(e,o),w(s,l,i),r&&r.m(s,i),w(s,c,i)},p(s,i){i&1&&n!==(n=s[9].title+"")&&P(o,n),s[9].desc?r?r.p(s,i):(r=fe(s),r.c(),r.m(c.parentNode,c)):r&&(r.d(1),r=null)},d(s){s&&(b(e),b(l),b(c)),r&&r.d(s)}}}function rt(t){let e,n,o=t[9].title+"",l,c,r,s,i,u=t[9].desc+"",m;return{c(){e=v("p"),n=L('"'),l=L(o),c=L('"'),r=C(),s=v("p"),i=L("- "),m=L(u),d(e,"id","text"),d(e,"class","svelte-1ebnxd5"),d(s,"id","author"),d(s,"class","svelte-1ebnxd5")},m(a,f){w(a,e,f),k(e,n),k(e,l),k(e,c),w(a,r,f),w(a,s,f),k(s,i),k(s,m)},p(a,f){f&1&&o!==(o=a[9].title+"")&&P(l,o),f&1&&u!==(u=a[9].desc+"")&&P(m,u)},d(a){a&&(b(e),b(r),b(s))}}}function fe(t){let e,n=t[9].desc+"",o;return{c(){e=v("p"),o=L(n),d(e,"id","desc"),d(e,"class","svelte-1ebnxd5")},m(l,c){w(l,e,c),k(e,o)},p(l,c){c&1&&n!==(n=l[9].desc+"")&&P(o,n)},d(l){l&&b(e)}}}function ae(t){let e,n,o,l,c;return n=new ue({props:{id:"tweet-quote",icon:Je,href:t[4](t[9].desc,t[9].title),alt:"Twitter"}}),l=new ue({props:{id:"share-quote",icon:Xe,href:t[5](t[9].desc,t[9].title),alt:"Tumblr"}}),{c(){e=v("div"),N(n.$$.fragment),o=C(),N(l.$$.fragment)},m(r,s){w(r,e,s),F(n,e,null),k(e,o),F(l,e,null),c=!0},p(r,s){const i={};s&1&&(i.href=r[4](r[9].desc,r[9].title)),n.$set(i);const u={};s&1&&(u.href=r[5](r[9].desc,r[9].title)),l.$set(u)},i(r){c||($(n.$$.fragment,r),$(l.$$.fragment,r),c=!0)},o(r){q(n.$$.fragment,r),q(l.$$.fragment,r),c=!1},d(r){r&&b(e),E(n),E(l)}}}function st(t){let e,n;return{c(){e=v("img"),T(e.src,n=et)||d(e,"src",n),d(e,"alt","Random Quote")},m(o,l){w(o,e,l)},p:h,d(o){o&&b(e)}}}function de(t){let e,n,o,l;return e=new X({props:{id:"previous-quote",$$slots:{default:[it]},$$scope:{ctx:t}}}),e.$on("click",t[7]),o=new X({props:{id:"next-quote",$$slots:{default:[ut]},$$scope:{ctx:t}}}),o.$on("click",t[8]),{c(){N(e.$$.fragment),n=C(),N(o.$$.fragment)},m(c,r){F(e,c,r),w(c,n,r),F(o,c,r),l=!0},p(c,r){const s={};r&1024&&(s.$$scope={dirty:r,ctx:c}),e.$set(s);const i={};r&1024&&(i.$$scope={dirty:r,ctx:c}),o.$set(i)},i(c){l||($(e.$$.fragment,c),$(o.$$.fragment,c),l=!0)},o(c){q(e.$$.fragment,c),q(o.$$.fragment,c),l=!1},d(c){c&&b(n),E(e,c),E(o,c)}}}function it(t){let e,n;return{c(){e=v("img"),T(e.src,n=tt)||d(e,"src",n),d(e,"alt","Previous Quote")},m(o,l){w(o,e,l)},p:h,d(o){o&&b(e)}}}function ut(t){let e,n;return{c(){e=v("img"),T(e.src,n=nt)||d(e,"src",n),d(e,"alt","Next Quote")},m(o,l){w(o,e,l)},p:h,d(o){o&&b(e)}}}function ft(t){let e;return{c(){e=v("blockquote"),e.innerHTML='

Fetching quote...

',d(e,"class","svelte-1ebnxd5")},m(n,o){w(n,e,o)},p:h,i:h,o:h,d(n){n&&b(e)}}}function at(t){let e,n,o,l={ctx:t,current:null,token:null,hasCatch:!0,pending:ft,then:lt,catch:ot,value:9,blocks:[,,,]};return J(n=t[0],l),{c(){e=v("section"),l.block.c(),d(e,"id","quote-box"),d(e,"class","svelte-1ebnxd5")},m(c,r){w(c,e,r),l.block.m(e,l.anchor=null),l.mount=()=>e,l.anchor=null,o=!0},p(c,[r]){t=c,l.ctx=t,r&1&&n!==(n=t[0])&&J(n,l)||ke(l,t,r)},i(c){o||($(l.block),o=!0)},o(c){for(let r=0;r<3;r+=1){const s=l.blocks[r];q(s)}o=!1},d(c){c&&b(e),l.block.d(),l.token=null,l=null}}}function dt(t,e,n){let{quote:o}=e,{villains:l=!1}=e,{randomOnly:c=!1}=e;const r=Be();function s(f,g){return l?`https://twitter.com/intent/tweet?hashtags=quotes&text=${encodeURIComponent(`"${g}" - ${f}`)}`:`https://twitter.com/intent/tweet?hashtags=quotes&text=${encodeURIComponent(`"${f}" - ${g}`)}`}function i(f,g){return l?`https://www.tumblr.com/widgets/share/tool?posttype=quote&tags=quotes&caption=${encodeURIComponent(f)} + &content=${encodeURIComponent(g)} + &canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button`:`https://www.tumblr.com/widgets/share/tool?posttype=quote&tags=quotes&caption=${encodeURIComponent(g)} + &content=${encodeURIComponent(f)} + &canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button`}const u=()=>r("randomQuote"),m=()=>r("previousQuote"),a=()=>r("nextQuote");return t.$$set=f=>{"quote"in f&&n(0,o=f.quote),"villains"in f&&n(1,l=f.villains),"randomOnly"in f&&n(2,c=f.randomOnly)},[o,l,c,r,s,i,u,m,a]}class mt extends R{constructor(e){super(),B(this,e,dt,at,z,{quote:0,villains:1,randomOnly:2})}}const ht="data:image/svg+xml,%3csvg%20viewBox='0%200%2017%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%23fff'%20fill-rule='evenodd'%3e%3cpath%20d='m8.20003216%200c-4.5281696%200-8.20003216%203.67233045-8.20003216%208.2025137%200%203.6241466%202.34955472%206.6987785%205.60770169%207.7833978.40979259.0759104.5602814-.1779394.5602814-.3946059%200-.195566-.00765306-.84177-.01112588-1.5271516-2.28132027.4961843-2.76269151-.9677944-2.76269151-.9677944-.37300645-.948109-.91045728-1.2001576-.91045728-1.2001576-.74395492-.5091149.05607959-.4986933.05607959-.4986933.82344388.0578979%201.25703171.8453083%201.25703171.8453083.73134987%201.2540026%201.9182821.8914335%202.38621225.6819077.07357231-.5302154.28612167-.8920125.52060124-1.0968421-1.82130043-.2074672-3.73598109-.9107972-3.73598109-4.05374848%200-.89548638.32033536-1.62725057.84492391-2.20166134-.08514837-.20663091-.36580356-1.04087425.07942464-2.17071817%200%200%20.68858276-.22046205%202.25559569.8408051.6540475-.18179917%201.35555686-.27289175%202.0524358-.27597964.69687893.00308789%201.39890278.09418047%202.05423654.27597964%201.5651479-1.06126715%202.252766-.8408051%202.252766-.8408051.4463215%201.12984392.1655376%201.96408726.0803893%202.17071817.5257461.57441077.8438949%201.30611063.8438949%202.20166134%200%203.15041368-1.9182821%203.84415838-3.74421295%204.04718668.29409628.2545575.55616545.7537654.55616545%201.5189817%200%201.0974854-.0095181%201.9808133-.0095181%202.2510031%200%20.2182748.1475948.4740546.5633041.3935122%203.2563462-1.0858415%205.6029426-4.1593798%205.6029426-7.7823041%200-4.53018325-3.6713481-8.2025137-8.19996784-8.2025137'/%3e%3cpath%20d='m3.07518929%2011.6824029c-.01787762.0408541-.08159856.0531168-.13950928.0251063-.05905999-.0268489-.09226129-.0826118-.07310669-.1236596.01755837-.0420803.08127932-.0538267.14021161-.025558.05918769.0267843.09289978.0830636.07240436.1241113m.40045868.3611685c-.03881997.0364008-.11473601.0194912-.16626186-.0380143-.05324977-.0573765-.06321015-.1340506-.02381554-.1710323.0400331-.0363363.11365058-.0193621.16702804.0380789.05324977.0580219.06359325.1342442.02298552.1710322m.27480455.4620452c-.04992964.0350455-.1315282.0021944-.18190478-.0709945-.04986579-.0731243-.04986579-.1608994.00108543-.1960739.05056812-.0351746.13088971-.0035497.18196863.0690583.04980194.0744151.04980194.1621902-.00121313.1980747m.46462657.5351695c-.0446302.0496962-.13963698.0364009-.209232-.0314957-.07112739-.0663476-.09098432-.1605121-.04622642-.2102728.04514099-.0498253.14072241-.03582.21082822.0314957.07068044.0662185.09226128.161093.04469405.2102728m.60036877.1807134c-.01960153.0644113-.11116048.0937127-.20335792.0663476-.09206974-.0282042-.15234286-.1037166-.1337629-.1688379.01915459-.0648632.11109663-.0953908.20399641-.0660894.09194204.0280751.15234286.1030065.13318826.1685797m.68337202.0766095c.00229855.0678966-.07591604.1241759-.17271058.1254021-.09736918.0021299-.17609455-.0527941-.17711613-.1195289%200-.068542.07642682-.124305.17373215-.1259185.09679454-.0019362.17609456.0526005.17609456.1200453m.67130462-.0260098c.01162045.0662185-.05567602.1342442-.15176823.1523155-.09449599.0174259-.18196862-.0234282-.19403602-.0890659-.01174815-.0678965.05682529-.1358576.15112974-.1534772.09628375-.0169096.18241557.0229119.19467451.0902276'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e";function gt(t){let e,n,o,l;return{c(){e=v("footer"),n=v("span"),n.textContent=`Copyright @ ${t[0]} ChiefWoods`,o=C(),l=v("a"),l.innerHTML=`GitHub`,d(n,"class","made-by"),d(l,"class","github-link"),d(l,"href","https://github.com/ChiefWoods/random-quote-machine"),d(l,"target","_blank")},m(c,r){w(c,e,r),k(e,n),k(e,o),k(e,l)},p:h,i:h,o:h,d(c){c&&b(e)}}}function _t(t){return[new Date().getFullYear()]}class pt extends R{constructor(e){super(),B(this,e,_t,gt,z,{})}}function me(t,e,n){const o=t.slice();return o[2]=e[n].name,o[3]=e[n].fullName,o}function he(t){let e,n=t[3]+"",o,l;return{c(){e=v("option"),o=L(n),e.__value=l=t[2],oe(e,e.__value)},m(c,r){w(c,e,r),k(e,o)},p(c,r){r&1&&n!==(n=c[3]+"")&&P(o,n),r&1&&l!==(l=c[2])&&(e.__value=l,oe(e,e.__value))},d(c){c&&b(e)}}}function bt(t){let e,n,o,l=re(t[0]),c=[];for(let r=0;r{"collections"in c&&n(0,o=c.collections)},[o,l]}class vt extends R{constructor(e){super(),B(this,e,wt,bt,z,{collections:0})}}function $t(t){return{c:h,m:h,p:h,i:h,o:h,d:h}}function kt(t){let e,n;return e=new vt({props:{collections:t[12]}}),e.$on("change",t[4]),{c(){N(e.$$.fragment)},m(o,l){F(e,o,l),n=!0},p:h,i(o){n||($(e.$$.fragment,o),n=!0)},o(o){q(e.$$.fragment,o),n=!1},d(o){E(e,o)}}}function yt(t){return{c:h,m:h,p:h,i:h,o:h,d:h}}function qt(t){var i,u;let e,n,o,l,c,r,s={ctx:t,current:null,token:null,hasCatch:!1,pending:yt,then:kt,catch:$t,value:12,blocks:[,,,]};return J(t[2],s),o=new mt({props:{quote:t[1],villains:se((i=t[0])==null?void 0:i.fullName),randomOnly:ie((u=t[0])==null?void 0:u.fullName)}}),o.$on("randomQuote",t[5]),o.$on("previousQuote",t[6]),o.$on("nextQuote",t[7]),c=new pt({}),{c(){e=v("main"),s.block.c(),n=C(),N(o.$$.fragment),l=C(),N(c.$$.fragment),d(e,"class","svelte-11xf4py")},m(m,a){w(m,e,a),s.block.m(e,s.anchor=null),s.mount=()=>e,s.anchor=n,k(e,n),F(o,e,null),w(m,l,a),F(c,m,a),r=!0},p(m,[a]){var g,_;t=m,ke(s,t,a);const f={};a&2&&(f.quote=t[1]),a&1&&(f.villains=se((g=t[0])==null?void 0:g.fullName)),a&1&&(f.randomOnly=ie((_=t[0])==null?void 0:_.fullName)),o.$set(f)},i(m){r||($(s.block),$(o.$$.fragment,m),$(c.$$.fragment,m),r=!0)},o(m){for(let a=0;a<3;a+=1){const f=s.blocks[a];q(f)}q(o.$$.fragment,m),q(c.$$.fragment,m),r=!1},d(m){m&&(b(e),b(l)),s.block.d(),s.token=null,s=null,E(o),E(c,m)}}}function ge(t){return Math.floor(Math.random()*t.length)}function Lt(t,e,n){let o,l=Ge(),c,r=We(0);Ee(t,r,p=>n(8,o=p));let s,i="#fff";function u(){const p=c.colors;let y;do y=p[ge(p)];while(y===i);i=y,document.documentElement.style.setProperty("--current-color",i)}async function m(p){const y=p.target,te=(await l).map(({name:V})=>V).find(V=>V===y.value);te&&await a(te)}async function a(p){n(1,s=Ve(p).then(y=>(n(0,c=y),r.set(ge(y.quotes)),y.quotes[o])))}function f(){r.update(p=>{let y;do y=Math.floor(Math.random()*c.quotes.length);while(y===p);return y})}function g(){r.update(p=>p===0?c.quotes.length-1:p-1)}function _(){r.update(p=>(p+1)%c.quotes.length)}return a("villains"),t.$$.update=()=>{t.$$.dirty&257&&c&&(n(1,s=Promise.resolve(c.quotes[o])),u())},[c,s,l,r,m,f,g,_,o]}class Ct extends R{constructor(e){super(),B(this,e,Lt,qt,z,{})}}new Ct({target:document.body}); diff --git a/index.html b/index.html new file mode 100644 index 0000000..8e60d49 --- /dev/null +++ b/index.html @@ -0,0 +1,17 @@ + + + + + + + + + Random Quote Machine + + + + + + + + \ No newline at end of file