1 line
6.5 KiB
JavaScript
1 line
6.5 KiB
JavaScript
import{c as e,l as t,m as n,n as r,r as i,t as a,u as o}from"./index-Cw6Vy2ED.js";import{t as s}from"./proxy-D2DvKtgS.js";var c=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),l=e(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),u=e(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),d=e(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),f=n(o(),1),p=`/assets/ritchennai-Cj5SDFG-.webp`,m=a(),h=()=>{let[e,n]=(0,f.useState)(!1),[a,o]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),_=t();return(0,f.useEffect)(()=>{sessionStorage.removeItem(`isCounterLoggedIn`),sessionStorage.removeItem(`counterUserName`)},[]),(0,m.jsxs)(`div`,{className:`min-h-screen bg-[#f8fafc] flex flex-col md:flex-row overflow-hidden font-inter`,children:[(0,m.jsxs)(`div`,{className:`w-full md:w-[45%] lg:w-[40%] flex flex-col p-8 md:p-12 lg:p-16 relative z-10 bg-white shadow-2xl`,children:[(0,m.jsxs)(s.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:`mb-10 flex flex-col items-center justify-center`,children:[(0,m.jsx)(`img`,{src:r,alt:`College Logo`,className:`h-16 md:h-20 object-contain`}),(0,m.jsx)(`span`,{className:`text-[10px] font-semibold text-slate-400 mt-2 italic tracking-wide font-sans`,children:`Till yo tummy is full...`})]}),(0,m.jsxs)(s.div,{initial:{opacity:0,x:-30},animate:{opacity:1,x:0},transition:{delay:.2},className:`flex-1 flex flex-col justify-center max-w-sm mx-auto w-full`,children:[(0,m.jsxs)(`div`,{className:`text-center mb-10`,children:[(0,m.jsx)(`h2`,{className:`text-[10px] font-black tracking-[0.3em] text-[#1e293b] uppercase mb-2`,children:`Counter Management System`}),(0,m.jsx)(`div`,{className:`w-12 h-1 bg-primary mx-auto rounded-full`})]}),(0,m.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault();try{let e=await fetch(`https://cmsapi.rit-services.in/api/system/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({email:a,password:h})}),t=await e.json();e.ok&&t.token&&(t.role===`MANAGER`||t.role===`MASTER`)?(sessionStorage.setItem(`isCounterLoggedIn`,`true`),sessionStorage.setItem(`counterUserName`,t.name),sessionStorage.setItem(`counterToken`,t.token),_(`/pos`)):a===`krishna`&&h===`12345678`?(sessionStorage.setItem(`isCounterLoggedIn`,`true`),sessionStorage.setItem(`counterUserName`,`Krishna`),_(`/pos`)):alert(t.error||`Invalid credentials or access denied`)}catch(e){a===`krishna`&&h===`12345678`?(sessionStorage.setItem(`isCounterLoggedIn`,`true`),sessionStorage.setItem(`counterUserName`,`Krishna`),_(`/pos`)):(console.error(e),alert(`Connection error or invalid credentials`))}},className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{className:`text-[10px] font-black text-[#94a3b8] uppercase tracking-widest pl-1`,children:`Operator ID`}),(0,m.jsxs)(`div`,{className:`relative group`,children:[(0,m.jsx)(`div`,{className:`absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none text-[#94a3b8] group-focus-within:text-primary transition-colors`,children:(0,m.jsx)(i,{size:18})}),(0,m.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:`Username`,className:`w-full bg-white border-2 border-[#e2e8f0] focus:border-primary rounded-2xl py-4 pl-12 pr-4 text-sm font-semibold outline-none transition-all placeholder:text-[#cbd5e1]`})]})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`flex justify-between items-center pl-1`,children:[(0,m.jsx)(`label`,{className:`text-[10px] font-black text-[#94a3b8] uppercase tracking-widest`,children:`Passcode`}),(0,m.jsx)(`button`,{type:`button`,className:`text-[10px] font-black text-primary uppercase hover:underline`,children:`Forgot?`})]}),(0,m.jsxs)(`div`,{className:`relative group`,children:[(0,m.jsx)(`div`,{className:`absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none text-[#94a3b8] group-focus-within:text-primary transition-colors`,children:(0,m.jsx)(d,{size:18})}),(0,m.jsx)(`input`,{type:e?`text`:`password`,value:h,onChange:e=>g(e.target.value),placeholder:`••••••••`,className:`w-full bg-white border-2 border-[#e2e8f0] focus:border-primary rounded-2xl py-4 pl-12 pr-12 text-sm font-semibold outline-none transition-all placeholder:text-[#cbd5e1]`}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>n(!e),className:`absolute inset-y-0 right-0 pr-4 flex items-center text-[#94a3b8] hover:text-[#64748b] transition-colors`,children:e?(0,m.jsx)(l,{size:18}):(0,m.jsx)(u,{size:18})})]})]}),(0,m.jsxs)(`button`,{type:`submit`,className:`w-full bg-primary text-white rounded-2xl py-4 font-black text-sm flex items-center justify-center gap-3 shadow-xl shadow-primary/20 hover:scale-[1.02] active:scale-[0.98] transition-all overflow-hidden group relative`,children:[(0,m.jsx)(`span`,{className:`relative z-10`,children:`CONNECT TO POS`}),(0,m.jsx)(c,{size:18,className:`relative z-10 group-hover:translate-x-1 transition-transform`}),(0,m.jsx)(s.div,{className:`absolute inset-0 bg-white/10`,initial:{x:`-100%`},whileHover:{x:`100%`},transition:{duration:.6}})]})]})]}),(0,m.jsx)(`div`,{className:`mt-auto text-center`,children:(0,m.jsx)(`p`,{className:`text-[10px] font-black text-[#cbd5e1] uppercase tracking-[0.2em]`,children:`© 2026 TILLO • COUNTER SYSTEM`})})]}),(0,m.jsxs)(`div`,{className:`hidden md:flex flex-1 relative bg-[#f8fafc] items-center justify-center p-8 overflow-hidden`,children:[(0,m.jsx)(`div`,{className:`absolute top-20 right-20 w-64 h-64 bg-primary/5 rounded-full blur-3xl`}),(0,m.jsx)(`div`,{className:`absolute bottom-20 left-40 w-96 h-96 bg-primary/5 rounded-full blur-3xl`}),(0,m.jsx)(s.div,{initial:{opacity:0,scale:.95,x:50},animate:{opacity:1,scale:1,x:0},transition:{duration:.8},className:`w-full h-full relative z-10`,children:(0,m.jsxs)(`div`,{className:`w-full h-full overflow-hidden shadow-2xl border-[12px] border-white bg-white`,children:[(0,m.jsx)(`img`,{src:p,alt:`Tillo Building`,className:`w-full h-full object-cover`}),(0,m.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-tr from-primary/20 to-transparent`})]})})]})]})};export{h as default}; |