mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
feat: style github link
This commit is contained in:
1 parent
6fe56ce0cd
commit
1e973d8a77
5 files changed
+57
-54
No files matched your search
@@ -28,15 +28,6 @@
|
||||
'kotlin',
|
||||
'swift'
|
||||
];
|
||||
|
||||
function onGithubLogin() {
|
||||
sdkForConsole.account.createOAuth2Session(
|
||||
'github',
|
||||
window.location.origin,
|
||||
window.location.origin,
|
||||
['read:user', 'user:email']
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<main class="grid-1-1 is-full-page" id="main">
|
||||
@@ -160,14 +151,6 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p class="u-margin-block-start-20">Or sign in with:</p>
|
||||
|
||||
<div class="u-margin-block-start-16 u-flex u-gap-12">
|
||||
<button on:click={onGithubLogin} class="button is-secondary">
|
||||
<span class="text">GitHub</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if isCloud}
|
||||
<div class="is-only-mobile u-margin-block-start-auto">
|
||||
<div class="mobile-beta">Public <span>beta</span></div>
|
||||
|
||||
@@ -149,4 +149,23 @@
|
||||
border-right-color: hsl(var(--p-tooltip--bg-color));
|
||||
}
|
||||
}
|
||||
|
||||
.with-separators {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
|
||||
text-transform: uppercase;
|
||||
width: 100%;
|
||||
|
||||
color: hsl(var(--color-neutral-100));
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background: hsl(var(--color-neutral-200));
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -236,43 +236,12 @@
|
||||
--center: ${$centerProximity};
|
||||
`;
|
||||
|
||||
// Lifecycle
|
||||
onMount(() => {
|
||||
let cb: number | null = null;
|
||||
const animate = () => {
|
||||
if (active) return (cb = window.requestAnimationFrame(animate));
|
||||
|
||||
// Rotate
|
||||
springRotate.update((old) => {
|
||||
const step = old.x % 360 > 90 && old.x % 360 < 270 ? 0.5 : 0.25;
|
||||
|
||||
return {
|
||||
...old,
|
||||
x: old.x + step * 4,
|
||||
y: 15
|
||||
};
|
||||
});
|
||||
|
||||
// Set glare opacity
|
||||
springGlare.update((old) => ({
|
||||
...old,
|
||||
x: 50,
|
||||
y: 50,
|
||||
o: opacityFromDegree(old.x)
|
||||
}));
|
||||
|
||||
cb = window.requestAnimationFrame(animate);
|
||||
};
|
||||
// animate();
|
||||
|
||||
return () => {
|
||||
cb && window.cancelAnimationFrame(cb);
|
||||
};
|
||||
});
|
||||
|
||||
const frontImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud?userId=${userId}`;
|
||||
// const frontImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud?mock=employee`;
|
||||
const backImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud-back?userId=${userId}`;
|
||||
// const frontImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud?userId=${userId}`;
|
||||
const frontImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud?mock=employee`;
|
||||
// const frontImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud?mock=normal`;
|
||||
// const backImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud-back?userId=${userId}`;
|
||||
const backImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud-back?mock=golden`;
|
||||
// const backImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud-back?mock=normal`;
|
||||
</script>
|
||||
|
||||
<svelte:window on:keydown={windowKeyDown} />
|
||||
|
||||
@@ -37,6 +37,15 @@
|
||||
trackError(error, Submit.AccountCreate);
|
||||
}
|
||||
}
|
||||
|
||||
function onGithubLogin() {
|
||||
sdkForConsole.account.createOAuth2Session(
|
||||
'github',
|
||||
window.location.origin,
|
||||
window.location.origin,
|
||||
['read:user', 'user:email']
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -66,6 +75,13 @@
|
||||
<FormItem>
|
||||
<Button fullWidth submit {disabled}>Sign in</Button>
|
||||
</FormItem>
|
||||
<span class="with-separators eyebrow-heading-3">or</span>
|
||||
<FormItem>
|
||||
<Button secondary fullWidth on:click={onGithubLogin} {disabled}>
|
||||
<span class="icon-github" aria-hidden="true" />
|
||||
<span class="text">Sign in with Github</span>
|
||||
</Button>
|
||||
</FormItem>
|
||||
</FormList>
|
||||
</Form>
|
||||
</svelte:fragment>
|
||||
|
||||
@@ -37,6 +37,15 @@
|
||||
trackError(error, Submit.AccountCreate);
|
||||
}
|
||||
}
|
||||
|
||||
function onGithubLogin() {
|
||||
sdkForConsole.account.createOAuth2Session(
|
||||
'github',
|
||||
window.location.origin,
|
||||
window.location.origin,
|
||||
['read:user', 'user:email']
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -84,6 +93,13 @@
|
||||
<FormItem>
|
||||
<Button fullWidth submit {disabled}>Sign up</Button>
|
||||
</FormItem>
|
||||
<span class="with-separators eyebrow-heading-3">or</span>
|
||||
<FormItem>
|
||||
<Button secondary fullWidth on:click={onGithubLogin} {disabled}>
|
||||
<span class="icon-github" aria-hidden="true" />
|
||||
<span class="text">Sign up with Github</span>
|
||||
</Button>
|
||||
</FormItem>
|
||||
</FormList>
|
||||
</Form>
|
||||
</svelte:fragment>
|
||||
|
||||
Reference in new issue
Block a user