Skip to content

Commit

Permalink
feat(link): replaced every internal and external links by libertai li…
Browse files Browse the repository at this point in the history
…nk component

Took 26 minutes
  • Loading branch information
Croos3r committed Jul 18, 2024
1 parent e0267fa commit 5381987
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 65 deletions.
10 changes: 6 additions & 4 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<div class="grid grid-cols-2">
<div v-for="section of sections" :key="section.title" class="space-y-2">
<p class="body-regular text-neutral-white">{{ section.title }}</p>
<a v-for="item of section.items" :key="item.title" :href="item.link" target="_blank">
<LLink v-for="item of section.items" :key="item.title" :href="item.link" target="_blank">
<p class="body-small text-neutral-white">{{ item.title }}</p>
</a>
</LLink>
</div>
</div>
<img alt="white logo" class="m-2 max-md:hidden" src="../assets/logos/libertAI_white.png" />
Expand All @@ -18,14 +18,16 @@
<p class="rich-bold-18 max-lg:body-small mt-2 text-center text-tertiary">
Copyright © LibertAI.io | Powered by
</p>
<a href="https://aleph.im/" target="_blank">
<LLink href="https://aleph.im/" target="_blank">
<p class="rich-bold-18 max-lg:body-small mt-2 text-center text-majorelle-500">aleph.im</p>
</a>
</LLink>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import LLink from "@/components/LLink.vue";
type FooterSection = {
title: string;
items: { title: string; link: string }[];
Expand Down
6 changes: 4 additions & 2 deletions src/components/LAnnouncementBanner.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts" setup>
import LLink from "@/components/LLink.vue";
export type LAnnouncementBannerProps = {
text: string;
link?: {
Expand All @@ -14,7 +16,7 @@ withDefaults(defineProps<LAnnouncementBannerProps>(), {
<template>
<p class="max-lg:body-small bg-majorelle-500 py-6 text-center text-neutral-white max-lg:px-4">
{{ text }}
<RouterLink v-if="link && link.href.startsWith('/')" :to="link.href" class="font-bold">{{ link.text }}</RouterLink>
<a v-else-if="link" :href="link.href" class="font-bold">{{ link.text }}</a>
<LLink v-if="link && link.href.startsWith('/')" :href="link.href" class="font-bold">{{ link.text }}</LLink>
<LLink v-else-if="link" :href="link.href" class="font-bold">{{ link.text }}</LLink>
</p>
</template>
12 changes: 9 additions & 3 deletions src/components/LLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,27 @@ import { LinkHTMLAttributes, ref } from "vue";
import { AlertDialog, AlertDialogContent, AlertDialogTrigger } from "@/components/ui/alert-dialog";
import { AlertDialogOverlay, AlertDialogPortal } from "radix-vue";
import LButton from "@/components/LButton.vue";
import { ClassProp } from "class-variance-authority/types";
interface IProps extends /* @vue-ignore */ LinkHTMLAttributes {}
withDefaults(defineProps<IProps>(), {});
withDefaults(defineProps<IProps & ClassProp>(), {});
const open = ref(false);
</script>

<template>
<RouterLink v-if="$attrs.href && ($attrs.href as string).startsWith('/')" :to="$attrs.href">
<RouterLink
v-if="$attrs.href && ($attrs.href as string).startsWith('/')"
:class="$props.class ?? $props.className"
:to="$attrs.href"
class="w-fit"
>
<slot />
</RouterLink>
<AlertDialog v-else v-model:open="open">
<AlertDialogTrigger as-child>
<a class="cursor-pointer">
<a :class="$props.class ?? $props.className" class="w-fit cursor-pointer">
<slot />
</a>
</AlertDialogTrigger>
Expand Down
43 changes: 22 additions & 21 deletions src/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
</button>

<!-- Site logo -->
<RouterLink class="mr-8" to="/">
<LLink class="mr-8" href="/">
<img alt="Site Logo" class="block max-lg:hidden" height="21" src="../assets/logos/libertAI.svg" width="120" />
<img alt="Site Logo" class="hidden h-8 max-lg:block" src="../assets/logos/libertAI.svg" />
</RouterLink>
</LLink>

<!-- Navbar buttons for large screens -->
<nav class="body-small flex space-x-8 text-neutral-800 max-lg:hidden">
<RouterLink to="/company">Company</RouterLink>
<RouterLink to="/earn">Earn</RouterLink>
<RouterLink to="/developer">Developer</RouterLink>
<RouterLink to="/tokenomics">Tokenomics</RouterLink>
<a href="/Litepaper_0624_v2.pdf" target="_blank">Litepaper</a>
<LLink href="/company">Company</LLink>
<LLink href="/earn">Earn</LLink>
<LLink href="/developer">Developer</LLink>
<LLink href="/tokenomics">Tokenomics</LLink>
<LLink href="/Litepaper_0624_v2.pdf" target="_blank">Litepaper</LLink>
<div @mouseenter="showApps = true" @mouseleave="showApps = false">
<div class="flex">
<span class="mr-1.5 cursor-pointer">Apps</span>
Expand All @@ -40,18 +40,18 @@
role="menu"
>
<div class="py-1">
<a href="https://chat.libertai.io" target="_blank">
<LLink href="https://chat.libertai.io" target="_blank">
<div class="dropdown-item flex justify-between">
<span class="mr-1">Chat dApp</span>
<img alt="Open" src="../assets/icons/open_in_new.svg" width="16" />
</div>
</a>
<a href="https://t.me/liberchat_bot" target="_blank">
</LLink>
<LLink href="https://t.me/liberchat_bot" target="_blank">
<div class="dropdown-item flex justify-between">
<span class="mr-1">Telegram bot</span>
<img alt="Open" src="../assets/icons/open_in_new.svg" width="16" />
</div>
</a>
</LLink>
</div>
</div>
</div>
Expand All @@ -60,7 +60,7 @@
</div>

<!-- Button for the chat app -->
<a href="https://chat.libertai.io">
<LLink href="https://chat.libertai.io">
<button
class="body-bold-default body-tiny w-fit rounded-full bg-majorelle-500 px-6 py-3 text-neutral-white max-lg:px-4 max-lg:py-2"
>
Expand All @@ -69,32 +69,32 @@
<img alt="Message" src="../assets/icons/message.svg" />
</div>
</button>
</a>
</LLink>
<!-- Navbar buttons for small screens -->
<div v-show="showSidebar" class="absolute left-0 top-16 w-full translate-y-1 border-y bg-neutral-white shadow">
<div class="flex flex-col">
<RouterLink class="body-default px-8 py-4 focus:bg-neutral-300" to="/company">Company</RouterLink>
<RouterLink class="body-default px-8 py-4 focus:bg-neutral-300" to="/earn">Earn</RouterLink>
<RouterLink class="body-default px-8 py-4 focus:bg-neutral-300" to="/developer">Developer</RouterLink>
<RouterLink class="body-default px-8 py-4 focus:bg-neutral-300" to="/tokenomics">Tokenomics</RouterLink>
<LLink class="body-default px-8 py-4 focus:bg-neutral-300" href="/company">Company</LLink>
<LLink class="body-default px-8 py-4 focus:bg-neutral-300" href="/earn">Earn</LLink>
<LLink class="body-default px-8 py-4 focus:bg-neutral-300" href="/developer">Developer</LLink>
<LLink class="body-default px-8 py-4 focus:bg-neutral-300" href="/tokenomics">Tokenomics</LLink>
<div class="body-default focus:bg-neutral-200">
<button class="flex items-center px-8 py-4" @click="showApps = !showApps">
<span class="mr-1.5 cursor-pointer">Apps</span>
<img alt="Chevron up" src="../assets/icons/chevron_down.svg" />
</button>
<div v-show="showApps" class="flex flex-col border-y">
<a href="https://chat.libertai.io" target="_blank">
<LLink href="https://chat.libertai.io" target="_blank">
<div class="body-default flex justify-between bg-neutral-200 px-16 py-4 focus:bg-neutral-300">
<span>Chat dApp</span>
<img alt="Open" src="../assets/icons/open_in_new.svg" width="20" />
</div>
</a>
<a href="https://t.me/liberchat_bot" target="_blank">
</LLink>
<LLink href="https://t.me/liberchat_bot" target="_blank">
<div class="body-default flex justify-between bg-neutral-200 px-16 py-4 focus:bg-neutral-300">
<span>Telegram bot</span>
<img alt="Open" src="../assets/icons/open_in_new.svg" width="20" />
</div>
</a>
</LLink>
</div>
</div>
</div>
Expand All @@ -105,6 +105,7 @@
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from "vue";
import { useRouter } from "vue-router";
import LLink from "@/components/LLink.vue";
const showApps = ref(false);
const showSidebar = ref(false);
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Company/JoinTeamSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
Are you passionate about artificial intelligence, decentralization, and community-driven innovation? Do you
want to be a part of a pioneering team that is transforming the AI landscape? Look no further than LibertAI!
</p>
<a class="w-full max-lg:mb-6" href="mailto:[email protected]" target="_blank">
<LLink class="w-full max-lg:mb-6" href="mailto:[email protected]" target="_blank">
<LButton small text="Join Now" />
</a>
</LLink>
</div>
<img alt="Company" class="m-auto max-lg:w-full lg:rounded-2xl" src="../../assets/team.webp" width="730px" />
</div>
</section>
</template>
<script lang="ts" setup>
import LButton from "@/components/LButton.vue";
import LLink from "@/components/LLink.vue";
</script>
5 changes: 3 additions & 2 deletions src/pages/Developer/ArchitectureSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import LModelCard from "@/components/LModelCard.vue";
import { models } from "@/texts.ts";
import LTinyHeading from "@/components/LTinyHeading.vue";
import LButton from "@/components/LButton.vue";
import LLink from "@/components/LLink.vue";
const paragraphs = [
"LibertAI works on top of the aleph.im network. It uses its on-demand virtual machines (serverless). When you do a call to the API, it's going to one of the load balancers of the network that distributes your request to one of the available CRN (computing resource nodes, you can also call the API directly on one). This CRN then looks at the path (or domain) and redirects it to a specific virtual machine.",
Expand All @@ -29,9 +30,9 @@ const paragraphs = [
:type="model.type"
/>
</div>
<a class="mb-36" href="https://docs.libertai.io">
<LLink class="mb-36" href="https://docs.libertai.io">
<LButton text="Find Out More" />
</a>
</LLink>
<div class="pt-20 text-primary">
<h2 class="text-center max-lg:hidden">How it works</h2>
<h3 class="hidden text-center max-lg:block">How it works</h3>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Earn/CallToActionSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CoreNodeImage from "../../assets/earn/core-channel-node-operator.svg";
import ResourceNodeImage from "../../assets/earn/resource-node-operator.svg";
import ConnectAccountsImage from "../../assets/earn/connect-accounts.svg";
import LButton from "@/components/LButton.vue";
import LLink from "@/components/LLink.vue";
type Action = {
cardTitle: string;
Expand Down Expand Up @@ -62,9 +63,9 @@ const actions: Action[] = [
<img :src="action.imagePath" alt="card" />
<p class="body-bold-default text-primary">{{ action.cardTitle }}</p>
<p class="body-tiny w-56">{{ action.cardDescription }}</p>
<a :href="action.buttonLink" target="_blank">
<LLink :href="action.buttonLink" target="_blank">
<LButton :text="action.buttonText" small />
</a>
</LLink>
</div>
</div>
</section>
Expand Down
9 changes: 5 additions & 4 deletions src/pages/Home/AICustomizationSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import VirtualGirlfriend from "../../assets/home/personas/VirtualGirlfriend.png"
import Tromp from "../../assets/home/personas/Tromp.png";
import { onMounted, ref, watch } from "vue";
import LTinyHeading from "@/components/LTinyHeading.vue";
import LLink from "@/components/LLink.vue";
const AIs = [
{ text: "Donald Tromp", image: Tromp },
Expand Down Expand Up @@ -67,9 +68,9 @@ onMounted(() => {
keeping your data encrypted and under your control.
</p>
<div>
<a class="text-majorelle-500" href="https://chat.libertai.io/">
<LLink class="text-majorelle-500" href="https://chat.libertai.io/">
<LButton small text="Customize Now" />
</a>
</LLink>
</div>
</div>
<div
Expand Down Expand Up @@ -116,9 +117,9 @@ onMounted(() => {
keeping your data encrypted and under your control.
</p>
<div>
<a class="text-majorelle-500" href="https://chat.libertai.io/#/persona-management">
<LLink class="text-majorelle-500" href="https://chat.libertai.io/#/persona-management">
<LButton small text="Customize Now" />
</a>
</LLink>
</div>
</div>
</div>
Expand Down
16 changes: 9 additions & 7 deletions src/pages/Home/FooterSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@
the future of decentralized intelligence.
</p>
<div class="flex flex-row space-x-7">
<a href="https://x.com/Libertai_DAI" target="_blank">
<LLink href="https://x.com/Libertai_DAI" target="_blank">
<img alt="Twitter / X" src="../../assets/icons/x.svg" style="width: 36px; height: 36px" />
</a>
<a href="https://t.me/libertai" target="_blank">
</LLink>
<LLink href="https://t.me/libertai" target="_blank">
<img alt="Telegram" src="../../assets/icons/telegram.svg" style="width: 36px; height: 36px" />
</a>
<a href="https://aleph.im/" target="_blank">
</LLink>
<LLink href="https://aleph.im/" target="_blank">
<img alt="Aleph.im" src="../../assets/icons/aleph.svg" style="width: 36px; height: 36px" />
</a>
</LLink>
</div>
</div>
</div>
</footer>
</template>
<script lang="ts" setup></script>
<script lang="ts" setup>
import LLink from "@/components/LLink.vue";
</script>
7 changes: 4 additions & 3 deletions src/pages/Home/HeroSection.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts" setup>
import LButton from "@/components/LButton.vue";
import LLink from "@/components/LLink.vue";
</script>

<template>
Expand All @@ -15,15 +16,15 @@ import LButton from "@/components/LButton.vue";
<div class="z-20 flex w-[1440px] justify-center py-60 max-lg:px-0 max-lg:py-56">
<div
:style="{ backdropFilter: 'blur(20px)' }"
class="mx-20 flex w-full flex-col gap-6 rounded-3xl border-t bg-primary bg-opacity-10 px-6 py-10 text-center text-neutral-white max-lg:mx-5"
class="mx-20 flex w-full flex-col items-center gap-6 rounded-3xl border-t bg-primary bg-opacity-10 px-6 py-10 text-center text-neutral-white max-lg:mx-5"
>
<h1 class="max-lg:hidden">Discover the Freedom of Decentralized AI</h1>
<h2 class="hidden sm:max-lg:block">Discover the Freedom of Decentralized AI</h2>
<h3 class="hidden font-bold max-sm:block">Discover the Freedom of Decentralized AI</h3>
<p class="body-small">Use decentralized AI and keep your data private and secure with blockchain.</p>
<a href="https://chat.libertai.io">
<LLink href="https://chat.libertai.io">
<LButton class="w-fit" light text="TRY FOR FREE" />
</a>
</LLink>
</div>
</div>
</section>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Home/NotYourAverageAIAssistant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import iphone from "../../assets/home/notYourAverageAIAssistantIphone.png";
import LTinyHeading from "@/components/LTinyHeading.vue";
import LButton from "@/components/LButton.vue";
import LLink from "@/components/LLink.vue";
</script>

<template>
Expand All @@ -19,9 +20,9 @@ import LButton from "@/components/LButton.vue";
<div class="relative mt-48 flex h-[346px] w-[837px] rounded-3xl bg-gradient-to-tr from-[#644DF9] to-[#FCCBFF]">
<img :src="iphone" alt="iphone" class="absolute bottom-0 left-0 right-0 mx-auto" />
</div>
<a href="https://t.me/liberchat_bot" target="_blank">
<LLink href="https://t.me/liberchat_bot" target="_blank">
<LButton text="Add to Telegram" class="mt-12" />
</a>
</LLink>
</div>
</section>
</template>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Home/OpenSourceModelsSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import LModelCard from "@/components/LModelCard.vue";
import LButton from "@/components/LButton.vue";
import { models } from "@/texts.ts";
import LTinyHeading from "@/components/LTinyHeading.vue";
import LLink from "@/components/LLink.vue";
</script>

<template>
Expand All @@ -26,9 +27,9 @@ import LTinyHeading from "@/components/LTinyHeading.vue";
:type="model.type"
/>
</div>
<RouterLink to="/developer">
<LLink href="/developer">
<LButton small text="Find Out More" />
</RouterLink>
</LLink>
</section>
</template>

Expand Down
12 changes: 7 additions & 5 deletions src/pages/Home/PartnersSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
<div class="flex h-full flex-col items-center justify-center">
<p class="body-bold-large text-center text-majorelle-800">Proudly supported by</p>
<div class="mt-6 flex max-sm:flex-col max-sm:space-y-4 sm:space-x-9">
<a href="https://aleph.im" target="_blank">
<LLink href="https://aleph.im" target="_blank">
<img alt="Aleph.im logo" src="../../assets/logos/aleph.svg" />
</a>
<a href="https://twentysix.cloud" target="_blank">
</LLink>
<LLink href="https://twentysix.cloud" target="_blank">
<img alt="TwentySixCloud logo" src="../../assets/logos/twentysix.svg" />
</a>
</LLink>
</div>
</div>
</div>
</section>
</template>
<script lang="ts" setup></script>
<script lang="ts" setup>
import LLink from "@/components/LLink.vue";
</script>
Loading

0 comments on commit 5381987

Please sign in to comment.