site-libsoc/Server/public/js/components/landing-component.js

2 lines
6.9 KiB
JavaScript

import{S as t,i as o,a as i,b as e,s as r,e as n,n as s,d as m,c as a,o as c,w as p,f as g,g as d,t as l,h as u,j as h,v as f,k as v,l as w,m as x}from"./index-4348483d.js";import{w as b}from"./index-71440b21.js";import{addMarkersGroups as j,groupsMarkersLayer as T}from"../../../../../../../../../js/groups.js";import{addMarkersCoops as k,coopsMarkersLayer as y}from"../../../../../../../../../js/coops.js";import{addMarkersCommunes as U,communesMarkersLayer as z}from"../../../../../../../../../js/communes.js";import{addMarkersParties as N,partiesMarkersLayer as C}from"../../../../../../../../../js/parties.js";import{getData as A,loadLocaleContent as E}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function F(t){let o,i,r,n,s,a,c,p,b,j,T,k,y,U,z,N,C,L,A,E,F,H,K,M,Q,R,S,W,B,D,J,O,_,q,G,I,P,V,X,Y,Z,$,tt,ot,it,et,rt,nt,st,mt,at,ct,pt,gt,dt,lt,ut,ht,ft,vt,wt,xt,bt,jt,Tt,kt,yt,Ut=t[3].top+"",zt=t[3].groupsTitle+"",Nt=t[3].groupsText+"",Ct=t[3].communesTitle+"",Lt=t[3].communesText+"",At=t[3].cooperativesTitle+"",Et=t[3].cooperativesText+"",Ft=t[3].partiesTitle+"",Ht=t[3].partiesText+"",Kt=t[3].findUs+"",Mt=t[3].whatNow+"",Qt=t[3].joinUs+"",Rt=t[3].talkWithUs+"";return{c(){o=g("div"),i=g("picture"),i.innerHTML='<source srcset="/img/crowd.webp"/> \n <source srcset="/img/crowd.png"/> \n <img id="crowd" alt="crowd"/>',r=d(),n=g("div"),s=g("p"),a=l(Ut),c=d(),p=g("div"),b=g("div"),j=g("a"),T=g("h2"),k=l(zt),y=d(),U=g("img"),N=d(),C=g("p"),L=l(Nt),A=d(),E=g("div"),F=g("a"),H=g("h2"),K=l(Ct),M=d(),Q=g("img"),S=d(),W=g("p"),B=l(Lt),D=d(),J=g("div"),O=g("a"),_=g("h2"),q=l(At),G=d(),I=g("img"),V=d(),X=g("p"),Y=l(Et),Z=d(),$=g("div"),tt=g("a"),ot=g("h2"),it=l(Ft),et=d(),rt=g("img"),st=d(),mt=g("p"),at=l(Ht),ct=d(),pt=g("h1"),gt=l(Kt),dt=d(),lt=g("map-component"),ht=d(),ft=g("h1"),vt=l(Mt),wt=d(),xt=g("div"),bt=g("a"),jt=l(Qt),Tt=d(),kt=g("a"),yt=l(Rt),u(j,"href","/"+t[6]+"/groups"),u(U,"id","groups-img"),h(U.src,z="/img/common/groups.svg")||u(U,"src","/img/common/groups.svg"),u(U,"alt","groups"),u(F,"href","/"+t[6]+"/communes"),u(Q,"id","communes-img"),h(Q.src,R="/img/common/commune.svg")||u(Q,"src","/img/common/commune.svg"),u(Q,"alt","communes"),u(O,"href","/"+t[6]+"/coops"),u(I,"id","coops-img"),h(I.src,P="/img/common/coops.svg")||u(I,"src","/img/common/coops.svg"),u(I,"alt","coops"),u(tt,"href","/"+t[6]+"/parties"),u(rt,"id","parties-img"),h(rt.src,nt="/img/common/parties.svg")||u(rt,"src","/img/common/parties.svg"),u(rt,"alt","coops"),u(p,"id","container-grid"),f(p,"--grid-width",t[1]),u(pt,"id","find-us"),v(lt,"id","map"),v(lt,"callback",ut=t[9]),v(lt,"colors",["#23AC20","#CA2437","#217BC9","#FFD326"]),u(bt,"class","link-button"),u(bt,"href","/"+t[6]+"/join-us"),u(kt,"class","link-button"),u(kt,"href","https://discord.gg/Qk8KUk787z"),u(kt,"target","_blank"),u(kt,"rel","noreferrer"),u(xt,"id","action-container"),u(n,"id","text-container"),u(o,"id","container")},m(m,g){e(m,o,g),w(o,i),w(o,r),w(o,n),w(n,s),w(s,a),w(n,c),w(n,p),w(p,b),w(b,j),w(j,T),w(T,k),w(b,y),w(b,U),w(b,N),w(b,C),w(C,L),w(p,A),w(p,E),w(E,F),w(F,H),w(H,K),w(E,M),w(E,Q),w(E,S),w(E,W),w(W,B),w(p,D),w(p,J),w(J,O),w(O,_),w(_,q),w(J,G),w(J,I),w(J,V),w(J,X),w(X,Y),w(p,Z),w(p,$),w($,tt),w(tt,ot),w(ot,it),w($,et),w($,rt),w($,st),w($,mt),w(mt,at),t[8](p),w(n,ct),w(n,pt),w(pt,gt),w(n,dt),w(n,lt),w(n,ht),w(n,ft),w(ft,vt),w(n,wt),w(n,xt),w(xt,bt),w(bt,jt),w(xt,Tt),w(xt,kt),w(kt,yt)},p(t,o){8&o&&Ut!==(Ut=t[3].top+"")&&x(a,Ut),8&o&&zt!==(zt=t[3].groupsTitle+"")&&x(k,zt),8&o&&Nt!==(Nt=t[3].groupsText+"")&&x(L,Nt),8&o&&Ct!==(Ct=t[3].communesTitle+"")&&x(K,Ct),8&o&&Lt!==(Lt=t[3].communesText+"")&&x(B,Lt),8&o&&At!==(At=t[3].cooperativesTitle+"")&&x(q,At),8&o&&Et!==(Et=t[3].cooperativesText+"")&&x(Y,Et),8&o&&Ft!==(Ft=t[3].partiesTitle+"")&&x(it,Ft),8&o&&Ht!==(Ht=t[3].partiesText+"")&&x(at,Ht),2&o&&f(p,"--grid-width",t[1]),8&o&&Kt!==(Kt=t[3].findUs+"")&&x(gt,Kt),8&o&&ut!==(ut=t[9])&&v(lt,"callback",ut),8&o&&Mt!==(Mt=t[3].whatNow+"")&&x(vt,Mt),8&o&&Qt!==(Qt=t[3].joinUs+"")&&x(jt,Qt),8&o&&Rt!==(Rt=t[3].talkWithUs+"")&&x(yt,Rt)},d(i){i&&m(o),t[8](null)}}}function H(t){let o,i=7==t[2]&&F(t);return{c(){i&&i.c(),o=n()},m(t,r){i&&i.m(t,r),e(t,o,r)},p(t,e){7==t[2]?i?i.p(t,e):(i=F(t),i.c(),i.m(o.parentNode,o)):i&&(i.d(1),i=null)},d(t){i&&i.d(t),t&&m(o)}}}function K(t){let o,i=t[2],a=H(t);return{c(){a.c(),o=n(),this.c=s},m(t,i){a.m(t,i),e(t,o,i)},p(t,[e]){4&e&&r(i,i=t[2])?(a.d(1),a=H(t),a.c(),a.m(o.parentNode,o)):a.p(t,e)},i:s,o:s,d(t){t&&m(o),a.d(t)}}}function M(t,o,i){let e,r,n,s,m=b(0);a(t,m,(t=>i(2,e=t)));let g,d,l=b({});function u(t){i(1,s="1fr 1fr")}a(t,l,(t=>i(3,r=t)));A("/assets/groups.json",(t=>{g=JSON.parse(t),d={};for(let t of g){let o=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),o in d?d[o].push(t):d[o]=[t]}m.update((t=>t+1))})),E(l,"groups-component",m),E(l,"communes-component",m),E(l,"cooperatives-component",m),E(l,"parties-component",m),E(l,"countries",m);let h=E(l,"landing-component",m,u);function f(t,o,i){let e=t([22,0],2);j(g,d,e,o,i),U(e,o,i),k(e,o,i),N(e,o,i);let r={};r[o.groups]=T,r[o.communes]=z,r[o.cooperatives]=y,r[o.parties]=C,L.control.layers(null,r).addTo(e)}u(),c((()=>{}));return[n,s,e,r,m,l,h,f,function(t){p[t?"unshift":"push"]((()=>{n=t,i(0,n)}))},t=>f(t,r,h)]}class Q extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#action-container{display:flex;justify-content:space-between;margin:auto;margin-top:2rem;max-width:34rem}.link-button{display:inline-block;font-size:1.6rem;font-family:var(--sans-serif,sans-serif);width:14rem;line-height:4rem;background:#cb1816;color:white;text-align:center}#map{--margin-top:1rem;--height:30rem;--width:100%;--margin-bottom:3rem}h1{font-size:2rem;text-align:center;margin-bottom:1rem}#container-grid>div>a>h2{text-align:center}#groups-img,#communes-img,#coops-img,#parties-img{position:absolute;left:50%;transform:translate(-50%);z-index:0;opacity:0.2;height:8rem}#coops-img{margin-top:0.5rem;height:7.5rem}#text-container{max-width:calc(100vw - 4rem);margin:auto}#crowd{width:100%;margin-bottom:2rem}#container{margin:auto;max-width:800px;margin-top:2rem;margin-bottom:5rem}#container>div>p{margin-bottom:1rem}#container p{text-align:justify}#container-grid{display:grid;grid-template-columns:var(--grid-width);grid-template-rows:var(--grid-width);grid-gap:4rem;row-gap:2.5rem;margin-top:2rem;margin-bottom:1rem}#container-grid>div{position:relative}#container-grid>div>p{position:relative;margin-top:5rem;z-index:2}@media only screen and (max-width: 1060px){#container-grid{display:flex;flex-direction:column;gap:2rem}#action-container{flex-direction:column;align-items:center;gap:2.5rem}#container-grid>:nth-child(2){height:calc(100% - 2rem)}}</style>",o(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},M,K,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("landing-component",Q);export{Q as default};