2Btainment commited on
Commit
3abd05e
·
verified ·
1 Parent(s): 544e3ba

auth.js: compact login button on mobile (no horizontal overflow)

Browse files
Files changed (1) hide show
  1. app/static/auth.js +4 -1
app/static/auth.js CHANGED
@@ -1,5 +1,8 @@
1
  // Session badge + HF login (library is owner-only; guests get an isolated 24h workspace).
2
  (async()=>{
 
 
 
3
  const pill=document.querySelector(".status-pill, .privacy");
4
  const box=document.createElement("span"); box.id="authBox"; box.style.cssText="display:inline-flex;gap:8px;align-items:center";
5
  pill?.parentNode.insertBefore(box,pill);
@@ -11,7 +14,7 @@
11
  a.href="/logout"; a.textContent="Abmelden";
12
  }else{
13
  if(pill) pill.innerHTML=`<i></i> GAST · eigene Projekte (${me.guest_ttl_hours||24} h)`;
14
- a.href="/login"; a.textContent="Mit Hugging Face anmelden";
15
  }
16
  box.appendChild(a);
17
  })();
 
1
  // Session badge + HF login (library is owner-only; guests get an isolated 24h workspace).
2
  (async()=>{
3
+ const css=document.createElement("style");
4
+ css.textContent="@media (max-width:700px){.top-actions .privacy{display:none}#hfLogin{padding:6px 9px;font-size:11px;white-space:nowrap}#hfLogin .long{display:none}}";
5
+ document.head.appendChild(css);
6
  const pill=document.querySelector(".status-pill, .privacy");
7
  const box=document.createElement("span"); box.id="authBox"; box.style.cssText="display:inline-flex;gap:8px;align-items:center";
8
  pill?.parentNode.insertBefore(box,pill);
 
14
  a.href="/logout"; a.textContent="Abmelden";
15
  }else{
16
  if(pill) pill.innerHTML=`<i></i> GAST · eigene Projekte (${me.guest_ttl_hours||24} h)`;
17
+ a.href="/login"; a.innerHTML="<span class=\"long\">Mit Hugging Face </span>anmelden"; a.title="Mit Hugging Face anmelden";
18
  }
19
  box.appendChild(a);
20
  })();