feat: card seo

This commit is contained in:
tglide authored and Christy Jacob committed 2023-05-01 17:37:45 +05:30
1 parent 9557e93352
commit 392ee0660a
4 files changed
+38 -20

No files matched your search

+8 -17
View File
@@ -6,19 +6,10 @@
function isTouchEvent(e: MouseEvent | TouchEvent): e is TouchEvent {
return e.type === 'touchmove';
}
function opacityFromDegree(degree: number): number {
const degreeNormalized: number = degree % 360;
const step: number = degreeNormalized % 180;
return step <= 90 ? step / 90 : 2 - step / 90;
}
</script>
<script lang="ts">
import { windowFocusStore } from '$lib/stores/windowFocus';
import { VARS } from '$lib/system';
import { onMount } from 'svelte';
import { spring } from 'svelte/motion';
import { getCardImgUrls } from './helpers';
@@ -166,14 +157,14 @@
};
const windowKeyDown = (e: KeyboardEvent) => {
// if (e.key === 'q') {
// springRotateDelta.update((old) => {
// return {
// ...old,
// x: old.x + 360
// };
// });
// }
if (e.key === 'q') {
springRotateDelta.update((old) => {
return {
...old,
x: old.x + 360
};
});
}
if (!active) return;
if (e.key === 'q') {
+3
View File
@@ -1,7 +1,10 @@
<script lang="ts">
import Display from '../display.svelte';
import { getCardImgUrls } from '../helpers';
export let data;
const { ogImg } = getCardImgUrls(data.userId);
</script>
<Display userId={data.userId} variant="external" />
+25 -1
View File
@@ -26,7 +26,7 @@
let cardIsFlipped = false;
let showEmbedCode = false;
const { frontImg } = getCardImgUrls(userId);
const { frontImg, ogImg } = getCardImgUrls(userId);
$: title = variant === 'owner' ? 'Welcome to the cloud' : 'Join the Appwrite Cloud';
$: shareableLink = `${window.location.origin}/card/${userId}`;
@@ -57,8 +57,32 @@
});
showEmbedCode = false;
}
const seo = {
title: 'Appwrite Cloud Card',
description:
'Cloud is live in public beta, create your Cloud account and unlock your exclusive card!'
};
</script>
<svelte:head>
<!-- HTML Meta Tags -->
<title>{seo.title}</title>
<meta name="description" content={seo.description} />
<!-- Facebook Meta Tags -->
<meta property="og:url" content={window.location.href} />
<meta property="og:type" content="website" />
<meta property="og:title" content={seo.title} />
<meta property="og:description" content={seo.description} />
<meta property="og:image" content={ogImg} />
<!-- Twitter Meta Tags -->
<meta name="twitter:title" content={seo.title} />
<meta name="twitter:description" content={seo.description} />
<meta name="twitter:image" content={ogImg} />
</svelte:head>
<div class="wrapper">
<div class="card">
<h3 class="heading-level-3 u-flex u-cross-center u-gap-8">
+2 -2
View File
@@ -1,8 +1,8 @@
import { VARS } from '$lib/system';
export function getCardImgUrls(userId: string) {
const frontImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud?userId=${userId}`;
const backImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud-back?userId=${userId}`;
const frontImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud?mock=normal`;
const backImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud-back?mock=normal`;
const ogImg = `${VARS.APPWRITE_ENDPOINT}/cards/cloud-og?userId=${userId}`;
return { frontImg, backImg, ogImg };