Skip to content

Commit

Permalink
Web codes responsive fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Apr 1, 2024
1 parent 7586d2b commit cf634d6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
15 changes: 15 additions & 0 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"type": "module",
"dependencies": {
"@tauri-apps/api": "^1.5.3",
"otpauth": "^9.2.2",
"ua-parser-js": "^1.0.35"
}
Expand Down
24 changes: 19 additions & 5 deletions website/src/routes/codes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
} as LibImportFile
let codesRefresher: NodeJS.Timeout
const getInitialCode = (i: number) => {
const token = new TOTP({
secret: codes.secrets[i],
}).generate()
return token
}
const refreshCodes = () => {
setTimeout(() => {
for (let i = 0; i < codes.secrets.length; i++) {
Expand Down Expand Up @@ -106,23 +114,29 @@

<div class="min-h-screen flex justify-center items-start">
<div
class="transparent-900 p-3 sm:p-10 rounded-xl main m-auto my-20 w-[95%] text-center sm:w-3/5"
class="transparent-900 p-3 sm:p-10 rounded-xl main m-auto my-20 w-[95%] text-center lg:w-1/2"
>
<div class="mb-10">
<h1 class="text-4xl sm:text-6xl font-bold">Authme</h1>
<input type="file" id="fileUpload" accept=".authme" />
</div>

<div class="content mx-auto flex flex-row flex-wrap items-center justify-center gap-10 w-full">
<div class="content mx-auto flex flex-row flex-wrap items-center justify-center gap-10">
{#if codes !== undefined}
{#each codes.issuers as item, i}
<div class="transparent-800 p-4 rounded-xl w-full sm:w-1/2 space-y-3">
<div class="transparent-800 p-4 rounded-xl w-full lg:w-[80%] space-y-3">
<div class="flex">
<div class="flex flex-1 justify-start">
<p class="text-3xl whitespace-nowrap">{item}</p>
<p class="text-3xl whitespace-nowrap">
{#if item.length > 12}
{item.slice(0, 12)}...
{:else}
{item}
{/if}
</p>
</div>
<div class="flex flex-1 justify-center px-3">
<p class="text-2xl mt-1" id={`code${i}`}>-</p>
<p class="text-2xl mt-1" id={`code${i}`}>{getInitialCode(i)}</p>
</div>
<div class="flex flex-1 justify-end">
<button
Expand Down

0 comments on commit cf634d6

Please sign in to comment.