JORVEX / ELECTRONIC PARTS HUB
ELECTRONICS · COMPONENTS · CONNECTIONS

Find the parts.
Build the next.

Explore modules, circuit components, wiring and connection essentials. From relay boards and motor controllers to capacitors, resistors, development boards and cables, find your next project part in the Jorvex catalog.

Explore the parts catalog
01 / THE COMPONENT FINDER

Search the parts library.

Search product names, switch collections or sort through the current Jorvex selection. Browse the available selection and open a product to see its full details.

COLLECTIONS
02 / THE CATALOG

Components & connections.

LOADING PRODUCTS
','text/html'); const textarea=next.createElement('textarea');textarea.innerHTML=t; if(textarea.value===t)break; t=textarea.value; } return t; } function text(tag,value,cls){const e=document.createElement(tag);if(cls)e.className=cls;e.textContent=decode(value);return e;} function url(raw){try{const u=new URL(String(raw||''),window.location.href);return /^(https?:)$/.test(u.protocol)?u.href:null;}catch(e){return null;}} function endpoint(path,params){ let base=document.querySelector('link[rel="https://api.w.org/"]')?.getAttribute('href')||window.wpApiSettings?.root||new URL('/wp-json/',window.location.origin).href; if(!base.endsWith('/'))base+='/'; const u=new URL('wc/store/v1/'+path,base); Object.entries(params||{}).forEach(([k,v])=>{if(v!==undefined&&v!==null&&v!=='')u.searchParams.set(k,String(v));}); return u; } async function loadApi(path,params,signal){ const res=await fetch(endpoint(path,params),{credentials:'same-origin',headers:{Accept:'application/json'},signal}); if(!res.ok)throw Error('Store API: '+res.status); return {data:await res.json(),total:res.headers.get('X-WP-Total'),pages:res.headers.get('X-WP-TotalPages')}; } function productUrl(p){return url(p?.permalink)||'#jx-products';} function imageUrl(p){const im=(p.images||[]).find(x=>url(x?.src));return im?url(im.src):null;} function picture(p,{eager=false}={}){ const src=imageUrl(p); if(!src)return text('span','JORVEX / ELECTRONIC PARTS','jx-no-image'); const im=document.createElement('img');im.src=src;im.alt=decode(p.name||'Electronic part');im.loading=eager?'eager':'lazy';im.decoding='async'; return im; } function catName(p){return decode((p.categories||[]).find(c=>c&&c.slug!=='uncategorized')?.name||(p.categories||[])[0]?.name||'Electronic parts');} function priceAmount(raw,meta){ if(raw==null||raw==='')return ''; const parsedMinor=Number(meta.currency_minor_unit); const minor=Math.min(6,Math.max(0,Number.isFinite(parsedMinor)?parsedMinor:2)); const n=Number(typeof raw==='object'?raw.value:raw)/Math.pow(10,minor); if(!Number.isFinite(n))return ''; let [integer,fraction]=n.toFixed(minor).split('.'); integer=integer.replace(/\B(?=(\d{3})+(?!\d))/g,meta.currency_thousand_separator??','); const number=integer+(minor?(meta.currency_decimal_separator??'.')+fraction:''); const symbol=decode(meta.currency_symbol||meta.currency_code||''); const prefix=meta.currency_prefix!=null?decode(meta.currency_prefix):symbol; const suffix=decode(meta.currency_suffix||''); return prefix+number+suffix; } function moneyTo(el,p){ const pr=p.prices||{}; const range=pr.price_range; if(range?.min_amount!=null&&range?.max_amount!=null){ const lo=priceAmount(range.min_amount,pr),hi=priceAmount(range.max_amount,pr); if(lo&&hi){el.textContent=lo===hi?lo:lo+' – '+hi;return;} } const current=priceAmount(pr.price,pr),regular=priceAmount(pr.regular_price,pr); if(!current){el.textContent='View product';return;} if(p.on_sale&®ular&®ular!==current){el.append(text('del',regular));el.append(text('ins',current));return;} el.textContent=current; } function productCard(p){ const article=document.createElement('article');article.className='jx-product'; const imgLink=document.createElement('a');imgLink.className='jx-product-image';imgLink.href=productUrl(p);imgLink.setAttribute('aria-label','View '+decode(p.name||'product'));imgLink.append(picture(p)); if(p.on_sale)imgLink.append(text('span','SALE','jx-sale')); const body=document.createElement('div');body.className='jx-product-info'; body.append(text('span',catName(p),'jx-product-category')); const h=document.createElement('h3');h.className='jx-product-title';const link=document.createElement('a');link.href=productUrl(p);link.textContent=decode(p.name||'Explore product');h.append(link);body.append(h); const bottom=document.createElement('div');bottom.className='jx-product-bottom'; const price=document.createElement('div');price.className='jx-product-price';moneyTo(price,p);bottom.append(price); const cta=document.createElement('a');cta.className='jx-product-link';cta.href=productUrl(p);cta.textContent=p.type==='variable'?'Select options ↗':'View component ↗';bottom.append(cta);body.append(bottom); article.append(imgLink,body);return article; } function showState(message){stateBox.hidden=!message;stateBox.textContent=message||'';} function setCategory(cat){ activeCategory=String(cat?.id??'all'); categoryWrap.querySelectorAll('.jx-category').forEach(b=>{const active=b.dataset.jxCategory===activeCategory;b.classList.toggle('is-active',active);b.setAttribute('aria-pressed',String(active));}); page=1;loadProducts(false); root.querySelector('#jx-products').scrollIntoView({behavior:window.matchMedia('(prefers-reduced-motion: reduce)').matches?'auto':'smooth',block:'start'}); } function showCategories(cats){ categoryWrap.replaceChildren(); const all=text('button','All parts','jx-category is-active');all.type='button';all.dataset.jxCategory='all';all.setAttribute('aria-pressed','true');all.addEventListener('click',()=>setCategory(null));categoryWrap.append(all); cats.forEach(c=>{const btn=text('button',c.name,'jx-category');btn.type='button';btn.dataset.jxCategory=String(c.id);btn.setAttribute('aria-pressed','false');btn.addEventListener('click',()=>setCategory(c));categoryWrap.append(btn);}); // A directory of just one category would add no meaningful navigation. if(cats.length<2){directory.hidden=true;return;} directoryList.replaceChildren(); cats.slice(0,12).forEach((c,i)=>{ const row=document.createElement('button');row.type='button';row.className='jx-directory-row'; row.append(text('span',String(i+1).padStart(2,'0'),'jx-directory-num'),text('span',c.name,'jx-directory-name'),text('span',String(c.count)+' products','jx-directory-count'),text('span','↗','jx-directory-arrow')); row.addEventListener('click',()=>setCategory(c));directoryList.append(row); }); directory.hidden=false; } async function loadCategories(){ try{ const data=await loadApi('products/categories',{per_page:100,hide_empty:true}); if(!Array.isArray(data.data))return; const cats=data.data.filter(c=>c&&c.id&&c.slug!=='uncategorized'&&Number(c.count)>0).sort((a,b)=>(Number(b.count||0)-Number(a.count||0))||decode(a.name).localeCompare(decode(b.name))); showCategories(cats); }catch(e){console.warn('Jorvex category request:',e);} } function paintShowcase(products){ const valid=products.filter(p=>imageUrl(p)); root.querySelectorAll('[data-jx-feature]').forEach((a,i)=>{ const p=valid[i];if(!p)return; a.href=productUrl(p);a.setAttribute('aria-label','View '+decode(p.name||'product')); a.replaceChildren(picture(p,{eager:i===0})); }); const p=valid[3]||valid[0];if(p)paintSpotlight(p); } function paintSpotlight(p){ const photo=root.querySelector('#jx-spotlight-photo');photo.replaceChildren(picture(p)); $('#jx-spotlight-category').textContent=catName(p); $('#jx-spotlight-product-name').textContent=decode(p.name||'Electronic component'); const raw=p.short_description||p.description||''; const tmp=document.createElement('div');tmp.innerHTML=String(raw); const description=decode((tmp.textContent||'').replace(/\s+/g,' ').trim()).slice(0,230); const dp=$('#jx-spotlight-description');dp.textContent=description;dp.hidden=!description; const pr=$('#jx-spotlight-price');pr.replaceChildren();moneyTo(pr,p); $('#jx-spotlight-link').href=productUrl(p); spotlight.hidden=false; } async function loadFeatures(){ try{const result=await loadApi('products',{per_page:12,orderby:'date',order:'desc'}); if(Array.isArray(result.data))paintShowcase(result.data); }catch(e){console.warn('Jorvex showcase request:',e);} } function ordering(){const [orderby,order]=sort.value.split('-');return {orderby,order};} async function loadProducts(append){ const seq=++requestCounter; if(controller)controller.abort();controller=new AbortController(); loading=true;more.disabled=true;showState(''); if(!append){page=1;grid.replaceChildren(...Array.from({length:5},()=>{const e=document.createElement('div');e.className='jx-skeleton';return e;}));more.hidden=true;count.textContent='LOADING PRODUCTS';} try{ const params={per_page:perPage,page,search:search.value.trim(),...ordering()};if(activeCategory!=='all')params.category=activeCategory; const r=await loadApi('products',params,controller.signal); if(seq!==requestCounter)return; if(!Array.isArray(r.data))throw Error('Unexpected products response'); if(!append)grid.replaceChildren(); const frag=document.createDocumentFragment();r.data.forEach(p=>frag.appendChild(productCard(p)));grid.appendChild(frag); const total=r.total===null?NaN:Number(r.total),pages=r.pages===null?NaN:Number(r.pages); count.textContent=Number.isFinite(total)?total+' PRODUCTS':'LIVE CATALOG'; hasMore=Number.isFinite(pages)&&pages>0?page{e.preventDefault();clearTimeout(searchDebounce);page=1;loadProducts(false);}); search.addEventListener('input',()=>{clearTimeout(searchDebounce);searchDebounce=setTimeout(()=>{page=1;loadProducts(false);},360);}); sort.addEventListener('change',()=>{page=1;loadProducts(false);}); more.addEventListener('click',()=>{if(loading||!hasMore)return;page+=1;loadProducts(true);}); loadCategories();loadFeatures();loadProducts(false); })();