2022-03-22 18:18:39 +01:00

2 lines
2.0 KiB
JavaScript

import{S as _,i as y,s as x,e as d,a as v,b as u,n as f,d as m,o as S,c as A,f as L,g,h,m as I,t as M,j as O,k as P}from"./vendor.js";const k=function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))s(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const a of t.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function o(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerpolicy&&(t.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?t.credentials="include":e.crossorigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function s(e){if(e.ep)return;e.ep=!0;const t=o(e);fetch(e.href,t)}};k();function N(i){let n,o,s;return{c(){n=d("canvas"),o=v(),s=d("p"),s.textContent=`${C} ppm`},m(e,t){u(e,n,t),i[3](n),u(e,o,t),u(e,s,t)},p:f,i:f,o:f,d(e){e&&m(n),i[3](null),e&&m(o),e&&m(s)}}}let C=7500;function q(i,n,o){let{min:s=0}=n,{max:e=15e3}=n,t;S(()=>{const r=t.getContext("2d");let l=t.width,b=t.height,p=l/5,w=(C-s)/e*Math.PI;r.arc(l/2,b,l/2-p,-Math.PI,-Math.PI+w,!1),r.lineWidth=p;let c=r.createLinearGradient(0,0,l,0);c.addColorStop("0","green"),c.addColorStop("0.5","yellow"),c.addColorStop("1.0","red"),r.strokeStyle=c,r.stroke()});function a(r){A[r?"unshift":"push"](()=>{t=r,o(0,t)})}return i.$$set=r=>{"min"in r&&o(1,s=r.min),"max"in r&&o(2,e=r.max)},[t,s,e,a]}class E extends _{constructor(n){super();y(this,n,q,N,x,{min:1,max:2})}}function j(i){let n,o,s,e,t;return e=new E({}),{c(){n=d("main"),o=d("h1"),o.textContent="AAA",s=v(),L(e.$$.fragment),g(o,"class","svelte-1fm71xa"),g(n,"class","svelte-1fm71xa")},m(a,r){u(a,n,r),h(n,o),h(n,s),I(e,n,null),t=!0},p:f,i(a){t||(M(e.$$.fragment,a),t=!0)},o(a){O(e.$$.fragment,a),t=!1},d(a){a&&m(n),P(e)}}}class B extends _{constructor(n){super();y(this,n,null,j,x,{})}}new B({target:document.getElementById("app")});