From d77716d0bdf0cd8e00caa36d74f2c84391f78de0 Mon Sep 17 00:00:00 2001 From: Chii Yuen Date: Sat, 20 Apr 2024 15:22:40 +0800 Subject: [PATCH] Build project --- assets/comment-quote-outline-UnNX39K_.svg | 1 + assets/index-3j2YF7n9.css | 1 + assets/index-SpBTz_1M.js | 1 + index.html | 17 +++++++++++++++++ 4 files changed, 20 insertions(+) create mode 100644 assets/comment-quote-outline-UnNX39K_.svg create mode 100644 assets/index-3j2YF7n9.css create mode 100644 assets/index-SpBTz_1M.js create mode 100644 index.html 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-3j2YF7n9.css b/assets/index-3j2YF7n9.css new file mode 100644 index 0000000..bc8b603 --- /dev/null +++ b/assets/index-3j2YF7n9.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Rubik:wght@300;400&display=swap";.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}.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}@keyframes svelte-1xewuj4-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#quote-box.svelte-1xewuj4.svelte-1xewuj4{width:500px;display:flex;flex-direction:column;justify-content:space-between;gap:30px;padding:30px;border-radius:3px;background:#fff}blockquote.svelte-1xewuj4.svelte-1xewuj4{display:flex;flex-direction:column;gap:15px}blockquote.svelte-1xewuj4.svelte-1xewuj4 *{color:var(--current-color);transition:color var(--transition-duration)}blockquote.svelte-1xewuj4.svelte-1xewuj4:has(.fetching){flex-direction:row;justify-content:center}.fetching.svelte-1xewuj4.svelte-1xewuj4,#text.svelte-1xewuj4.svelte-1xewuj4,#title.svelte-1xewuj4.svelte-1xewuj4,.error.svelte-1xewuj4.svelte-1xewuj4{font-size:var(--font-size-l);text-align:center}#author.svelte-1xewuj4.svelte-1xewuj4{font-size:var(--font-size-m);font-weight:300;margin-left:auto}#content.svelte-1xewuj4.svelte-1xewuj4{font-size:var(--font-size-s);text-align:justify;max-height:200px;overflow-y:auto}#btn-container.svelte-1xewuj4.svelte-1xewuj4{display:flex;justify-content:space-between}#btn-container.svelte-1xewuj4>div.svelte-1xewuj4{display:flex;gap:10px}.loading-icon.svelte-1xewuj4.svelte-1xewuj4{width:var(--font-size-m);aspect-ratio:1/1;animation:svelte-1xewuj4-spin 1s linear infinite}.loading-icon.svelte-1xewuj4.svelte-1xewuj4>path{fill:var(--current-color)}@media (max-width: 768px){#quote-box.svelte-1xewuj4.svelte-1xewuj4{max-width:500px;width:100%}}:root{--current-color:black;--transition-duration:1s;--font-size-l:2.5rem;--font-size-m:2rem;--font-size-s:1.5rem}main.svelte-184gmyo{background:var(--current-color);flex:1;display:grid;place-items:center;transition:background var(--transition-duration)}main.svelte-184gmyo *{font-family:Rubik,sans-serif}select.svelte-184gmyo{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)} diff --git a/assets/index-SpBTz_1M.js b/assets/index-SpBTz_1M.js new file mode 100644 index 0000000..ff48014 --- /dev/null +++ b/assets/index-SpBTz_1M.js @@ -0,0 +1 @@ +var qe=Object.defineProperty;var je=(t,e,n)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var W=(t,e,n)=>(je(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 s of c.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).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 y(){}function Ce(t,e){for(const n in e)t[n]=e[n];return t}function Me(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function he(t){return t()}function te(){return Object.create(null)}function I(t){t.forEach(he)}function me(t){return typeof t=="function"}function N(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let U;function B(t,e){return t===e?!0:(U||(U=document.createElement("a")),U.href=e,t===U.href)}function Ee(t){return Object.keys(t).length===0}function ze(t,...e){if(t==null){for(const o of e)o(void 0);return y}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function Fe(t,e,n){t.$$.on_destroy.push(ze(e,n))}function Qe(t,e,n,o){if(t){const l=ge(t,e,n,o);return t[0](l)}}function ge(t,e,n,o){return t[1]&&o?Ce(n.ctx.slice(),t[1](o(e))):n.ctx}function Te(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=[],s=Math.max(e.dirty.length,l.length);for(let u=0;u32){const e=[],n=t.ctx.length/32;for(let o=0;ot.removeEventListener(e,n,o)}function m(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function He(t){return Array.from(t.childNodes)}function O(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ne(t,e){t.value=e??""}function Be(t,e,{bubbles:n=!1,cancelable:o=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:o})}let P;function M(t){P=t}function be(){if(!P)throw new Error("Function called outside component initialization");return P}function Pe(){const t=be();return(e,n,{cancelable:o=!1}={})=>{const l=t.$$.callbacks[e];if(l){const c=Be(e,n,{cancelable:o});return l.slice().forEach(s=>{s.call(t,c)}),!c.defaultPrevented}return!0}}function Ie(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(o=>o.call(this,e))}const A=[],ne=[];let H=[];const le=[],Re=Promise.resolve();let Y=!1;function Se(){Y||(Y=!0,Re.then(X))}function J(t){H.push(t)}const K=new Set;let T=0;function X(){if(T!==0)return;const t=P;do{try{for(;Tt.indexOf(o)===-1?e.push(o):n.push(o)),n.forEach(o=>o()),H=e}const G=new Set;let Q;function we(){Q={r:0,c:[],p:Q}}function ve(){Q.r||I(Q.c),Q=Q.p}function L(t,e){t&&t.i&&(G.delete(t),t.i(e))}function q(t,e,n,o){if(t&&t.o){if(G.has(t))return;G.add(t),Q.c.push(()=>{G.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}else o&&o()}function oe(t,e){const n=e.token={};function o(l,c,s,u){if(e.token!==n)return;e.resolved=u;let i=e.ctx;s!==void 0&&(i=i.slice(),i[s]=u);const r=l&&(e.current=l)(i);let d=!1;e.block&&(e.blocks?e.blocks.forEach((a,f)=>{f!==c&&a&&(we(),q(a,1,1,()=>{e.blocks[f]===a&&(e.blocks[f]=null)}),ve())}):e.block.d(1),r.c(),L(r,1),r.m(e.mount(),e.anchor),d=!0),e.block=r,e.blocks&&(e.blocks[c]=r),d&&X()}if(Me(t)){const l=be();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 Ge(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 D(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function F(t){t&&t.c()}function E(t,e,n){const{fragment:o,after_update:l}=t.$$;o&&o.m(e,n),J(()=>{const c=t.$$.on_mount.map(he).filter(me);t.$$.on_destroy?t.$$.on_destroy.push(...c):I(c),t.$$.on_mount=[]}),l.forEach(J)}function z(t,e){const n=t.$$;n.fragment!==null&&(Ue(n.after_update),I(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ze(t,e){t.$$.dirty[0]===-1&&(A.push(t),Se(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const p=h.length?h[0]:f;return r.ctx&&l(r.ctx[a],r.ctx[a]=p)&&(!r.skip_bound&&r.bound[a]&&r.bound[a](p),d&&Ze(t,a)),f}):[],r.update(),d=!0,I(r.before_update),r.fragment=o?o(r.ctx):!1,e.target){if(e.hydrate){const a=He(e.target);r.fragment&&r.fragment.l(a),a.forEach(g)}else r.fragment&&r.fragment.c();e.intro&&L(t.$$.fragment),E(t,e.target,e.anchor),X()}M(i)}class S{constructor(){W(this,"$$");W(this,"$$set")}$destroy(){z(this,1),this.$destroy=y}$on(e,n){if(!me(n))return y;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&&!Ee(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const De="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(De);function We(t){let e,n,o;return{c(){e=b("a"),n=b("img"),B(n.src,o=t[1])||m(n,"src",o),m(n,"alt",t[3]),m(e,"id",t[0]),m(e,"class","btn svelte-r3dc7a"),m(e,"href",t[2]),m(e,"target","_blank")},m(l,c){_(l,e,c),v(e,n)},p(l,[c]){c&2&&!B(n.src,o=l[1])&&m(n,"src",o),c&8&&m(n,"alt",l[3]),c&1&&m(e,"id",l[0]),c&4&&m(e,"href",l[2])},i:y,o:y,d(l){l&&g(e)}}}function Ke(t,e,n){let{id:o}=e,{icon:l}=e,{href:c}=e,{alt:s}=e;return t.$$set=u=>{"id"in u&&n(0,o=u.id),"icon"in u&&n(1,l=u.icon),"href"in u&&n(2,c=u.href),"alt"in u&&n(3,s=u.alt)},[o,l,c,s]}class ce extends S{constructor(e){super(),R(this,e,Ke,We,N,{id:0,icon:1,href:2,alt:3})}}function Ye(t){let e,n,o,l,c,s;const u=t[3].default,i=Qe(u,t,t[2],null);return{c(){e=b("button"),n=$(t[1]),o=j(),i&&i.c(),m(e,"id",t[0]),m(e,"class","btn svelte-136yeq3")},m(r,d){_(r,e,d),v(e,n),v(e,o),i&&i.m(e,null),l=!0,c||(s=pe(e,"click",t[4]),c=!0)},p(r,[d]){(!l||d&2)&&O(n,r[1]),i&&i.p&&(!l||d&4)&&xe(i,u,r,r[2],l?Te(u,r[2],d,null):Ae(r[2]),null),(!l||d&1)&&m(e,"id",r[0])},i(r){l||(L(i,r),l=!0)},o(r){q(i,r),l=!1},d(r){r&&g(e),i&&i.d(r),c=!1,s()}}}function Je(t,e,n){let{$$slots:o={},$$scope:l}=e,{id:c=null}=e,{content:s=""}=e;function u(i){Ie.call(this,t,i)}return t.$$set=i=>{"id"in i&&n(0,c=i.id),"content"in i&&n(1,s=i.content),"$$scope"in i&&n(2,l=i.$$scope)},[c,s,l,o,u]}class Z extends S{constructor(e){super(),R(this,e,Je,Ye,N,{id:0,content:1})}}const Xe="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",et="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",tt="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",nt="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",lt="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=b("blockquote"),e.innerHTML='

Cannot fetch quotes. Try again later.

',m(e,"class","svelte-1xewuj4")},m(n,o){_(n,e,o)},p:y,i:y,o:y,d(n){n&&g(e)}}}function ct(t){let e,n,o,l,c,s;function u(h,p){if(h[0]==="single")return st;if(h[0]==="full")return rt}let i=u(t),r=i&&i(t);const d=[ut,it],a=[];function f(h,p){return h[0]==="single"?0:h[0]==="full"?1:-1}return~(l=f(t))&&(c=a[l]=d[l](t)),{c(){e=b("blockquote"),r&&r.c(),n=j(),o=b("div"),c&&c.c(),m(e,"class","svelte-1xewuj4"),m(o,"id","btn-container"),m(o,"class","svelte-1xewuj4")},m(h,p){_(h,e,p),r&&r.m(e,null),_(h,n,p),_(h,o,p),~l&&a[l].m(o,null),s=!0},p(h,p){i===(i=u(h))&&r?r.p(h,p):(r&&r.d(1),r=i&&i(h),r&&(r.c(),r.m(e,null)));let k=l;l=f(h),l===k?~l&&a[l].p(h,p):(c&&(we(),q(a[k],1,1,()=>{a[k]=null}),ve()),~l?(c=a[l],c?c.p(h,p):(c=a[l]=d[l](h),c.c()),L(c,1),c.m(o,null)):c=null)},i(h){s||(L(c),s=!0)},o(h){q(c),s=!1},d(h){h&&(g(e),g(n),g(o)),r&&r.d(),~l&&a[l].d()}}}function rt(t){let e,n,o=t[2][t[3]].id+"",l,c,s=t[2][t[3]].title+"",u,i,r,d=t[2][t[3]].desc+"",a;return{c(){e=b("p"),n=$("Law "),l=$(o),c=$(": "),u=$(s),i=j(),r=b("p"),a=$(d),m(e,"id","title"),m(e,"class","svelte-1xewuj4"),m(r,"id","content"),m(r,"class","svelte-1xewuj4")},m(f,h){_(f,e,h),v(e,n),v(e,l),v(e,c),v(e,u),_(f,i,h),_(f,r,h),v(r,a)},p(f,h){h&12&&o!==(o=f[2][f[3]].id+"")&&O(l,o),h&12&&s!==(s=f[2][f[3]].title+"")&&O(u,s),h&12&&d!==(d=f[2][f[3]].desc+"")&&O(a,d)},d(f){f&&(g(e),g(i),g(r))}}}function st(t){let e,n,o=t[9].quote+"",l,c,s,u,i,r=t[9].name+"",d;return{c(){e=b("p"),n=$('"'),l=$(o),c=$('"'),s=j(),u=b("p"),i=$("- "),d=$(r),m(e,"id","text"),m(e,"class","svelte-1xewuj4"),m(u,"id","author"),m(u,"class","svelte-1xewuj4")},m(a,f){_(a,e,f),v(e,n),v(e,l),v(e,c),_(a,s,f),_(a,u,f),v(u,i),v(u,d)},p(a,f){f&2&&o!==(o=a[9].quote+"")&&O(l,o),f&2&&r!==(r=a[9].name+"")&&O(d,r)},d(a){a&&(g(e),g(s),g(u))}}}function it(t){let e,n,o,l,c,s,u;return e=new Z({props:{id:"randomize",$$slots:{default:[ft]},$$scope:{ctx:t}}}),e.$on("click",t[6]),l=new Z({props:{id:"previous-quote",$$slots:{default:[at]},$$scope:{ctx:t}}}),l.$on("click",t[7]),s=new Z({props:{id:"next-quote",$$slots:{default:[dt]},$$scope:{ctx:t}}}),s.$on("click",t[8]),{c(){F(e.$$.fragment),n=j(),o=b("div"),F(l.$$.fragment),c=j(),F(s.$$.fragment),m(o,"class","svelte-1xewuj4")},m(i,r){E(e,i,r),_(i,n,r),_(i,o,r),E(l,o,null),v(o,c),E(s,o,null),u=!0},p(i,r){const d={};r&1024&&(d.$$scope={dirty:r,ctx:i}),e.$set(d);const a={};r&1024&&(a.$$scope={dirty:r,ctx:i}),l.$set(a);const f={};r&1024&&(f.$$scope={dirty:r,ctx:i}),s.$set(f)},i(i){u||(L(e.$$.fragment,i),L(l.$$.fragment,i),L(s.$$.fragment,i),u=!0)},o(i){q(e.$$.fragment,i),q(l.$$.fragment,i),q(s.$$.fragment,i),u=!1},d(i){i&&(g(n),g(o)),z(e,i),z(l),z(s)}}}function ut(t){let e,n,o,l,c,s,u;return n=new ce({props:{id:"tweet-quote",icon:Xe,href:re(t[9].name,t[9].quote),alt:"Twitter"}}),l=new ce({props:{id:"share-quote",icon:et,href:se(t[9].name,t[9].quote),alt:"Tumblr"}}),s=new Z({props:{id:"new-quote",content:"New Quote"}}),s.$on("click",t[5]),{c(){e=b("div"),F(n.$$.fragment),o=j(),F(l.$$.fragment),c=j(),F(s.$$.fragment),m(e,"class","svelte-1xewuj4")},m(i,r){_(i,e,r),E(n,e,null),v(e,o),E(l,e,null),_(i,c,r),E(s,i,r),u=!0},p(i,r){const d={};r&2&&(d.href=re(i[9].name,i[9].quote)),n.$set(d);const a={};r&2&&(a.href=se(i[9].name,i[9].quote)),l.$set(a)},i(i){u||(L(n.$$.fragment,i),L(l.$$.fragment,i),L(s.$$.fragment,i),u=!0)},o(i){q(n.$$.fragment,i),q(l.$$.fragment,i),q(s.$$.fragment,i),u=!1},d(i){i&&(g(e),g(c)),z(n),z(l),z(s,i)}}}function ft(t){let e,n;return{c(){e=b("img"),B(e.src,n=tt)||m(e,"src",n),m(e,"alt","")},m(o,l){_(o,e,l)},p:y,d(o){o&&g(e)}}}function at(t){let e,n;return{c(){e=b("img"),B(e.src,n=nt)||m(e,"src",n),m(e,"alt","")},m(o,l){_(o,e,l)},p:y,d(o){o&&g(e)}}}function dt(t){let e,n;return{c(){e=b("img"),B(e.src,n=lt)||m(e,"src",n),m(e,"alt","")},m(o,l){_(o,e,l)},p:y,d(o){o&&g(e)}}}function ht(t){let e;return{c(){e=b("blockquote"),e.innerHTML='

Fetching quote...

',m(e,"class","svelte-1xewuj4")},m(n,o){_(n,e,o)},p:y,i:y,o:y,d(n){n&&g(e)}}}function mt(t){let e,n,o,l={ctx:t,current:null,token:null,hasCatch:!0,pending:ht,then:ct,catch:ot,value:9,blocks:[,,,]};return oe(n=t[1],l),{c(){e=b("section"),l.block.c(),m(e,"id","quote-box"),m(e,"class","svelte-1xewuj4")},m(c,s){_(c,e,s),l.block.m(e,l.anchor=null),l.mount=()=>e,l.anchor=null,o=!0},p(c,[s]){t=c,l.ctx=t,s&2&&n!==(n=t[1])&&oe(n,l)||Ge(l,t,s)},i(c){o||(L(l.block),o=!0)},o(c){for(let s=0;s<3;s+=1){const u=l.blocks[s];q(u)}o=!1},d(c){c&&g(e),l.block.d(),l.token=null,l=null}}}function re(t,e){return`https://twitter.com/intent/tweet?hashtags=quotes&text=${encodeURIComponent(`${t} ${e}`)}`}function se(t,e){return`https://www.tumblr.com/widgets/share/tool?posttype=quote&tags=quotes&caption=${encodeURIComponent(e.slice(0))}&content=${encodeURIComponent(t.slice(0))}&canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button`}function gt(t,e,n){let{collectionType:o}=e,{quote:l}=e,{fullQuotes:c}=e,{index:s}=e;const u=Pe(),i=()=>u("newQuote"),r=()=>u("randomize"),d=()=>u("previous"),a=()=>u("next");return t.$$set=f=>{"collectionType"in f&&n(0,o=f.collectionType),"quote"in f&&n(1,l=f.quote),"fullQuotes"in f&&n(2,c=f.fullQuotes),"index"in f&&n(3,s=f.index)},[o,l,c,s,u,i,r,d,a]}class _t extends S{constructor(e){super(),R(this,e,gt,mt,N,{collectionType:0,quote:1,fullQuotes:2,index:3})}}const pt="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 bt(t){let e,n,o,l;return{c(){e=b("footer"),n=b("span"),n.textContent=`Copyright @ ${t[0]} ChiefWoods`,o=j(),l=b("a"),l.innerHTML=`GitHub`,m(n,"class","made-by"),m(l,"class","github-link"),m(l,"href","https://github.com/ChiefWoods/random-quote-machine"),m(l,"target","_blank")},m(c,s){_(c,e,s),v(e,n),v(e,o),v(e,l)},p:y,i:y,o:y,d(c){c&&g(e)}}}function wt(t){return[new Date().getFullYear()]}class vt extends S{constructor(e){super(),R(this,e,wt,bt,N,{})}}function ie(t){return fetch(`http://localhost:8000/api/quotes/${t}/random`).then(e=>e.json()).then(e=>e)}function yt(t){return fetch(`http://localhost:8000/api/quotes/${t}`).then(e=>e.json()).then(e=>e)}const x=[];function kt(t,e=y){let n;const o=new Set;function l(u){if(N(t,u)&&(t=u,n)){const i=!x.length;for(const r of o)r[1](),x.push(r,t);if(i){for(let r=0;r{o.delete(r),o.size===0&&n&&(n(),n=null)}}return{set:l,update:c,subscribe:s}}function ue(t,e,n){const o=t.slice();return o[16]=e[n][0],o[17]=e[n][1],o}function fe(t,e,n){const o=t.slice();return o[20]=e[n].option,o[21]=e[n].name,o}function ae(t){let e,n=t[20]+"",o,l;return{c(){e=b("option"),o=$(n),e.__value=t[21],Ne(e,e.__value),e.selected=l=t[3].name===t[21]},m(c,s){_(c,e,s),v(e,o)},p(c,s){s&8&&l!==(l=c[3].name===c[21])&&(e.selected=l)},d(c){c&&g(e)}}}function de(t){let e,n=D(t[17]),o=[];for(let l=0;ln(2,o=w));async function a(){u.type==="single"?n(0,i=ie(u.name)):n(0,i=yt(u.name).then(w=>(n(1,r=w),w[o])))}async function f(w){const C=w.target;for(const[jt,$e]of Object.entries(l)){const ee=$e.find(Le=>Le.name===C.value);if(ee){n(3,u=ee);break}}a()}function h(){const w=c[u.name];let C;do C=w[Math.floor(Math.random()*w.length)];while(C===s);s=C,document.documentElement.style.setProperty("--current-color",s)}async function p(){let w;do w=await ie(u.name);while(w===i);n(0,i=w)}async function k(){d.update(w=>{let C;do C=Math.floor(Math.random()*r.length);while(C===w);return C})}async function V(){d.update(w=>w===0?r.length-1:w-1)}async function ye(){d.update(w=>(w+1)%r.length)}a();const ke=w=>f(w);return t.$$.update=()=>{t.$$.dirty&6&&r&&n(0,i=r[o]),t.$$.dirty&1&&i!==void 0&&h()},[i,r,o,u,l,d,f,p,k,V,ye,ke]}class qt extends S{constructor(e){super(),R(this,e,Lt,$t,N,{})}}new qt({target:document.body}); diff --git a/index.html b/index.html new file mode 100644 index 0000000..3c03763 --- /dev/null +++ b/index.html @@ -0,0 +1,17 @@ + + + + + + + + + Random Quote Machine + + + + + + + + \ No newline at end of file