Skip to content

Commit

Permalink
Add storysnap
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaapple committed Nov 14, 2024
1 parent cecf0e5 commit c7ffbf7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
39 changes: 30 additions & 9 deletions frontend/components/layout/hero-landing.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
'use server';

import { PageGenUrl } from '@/config';
import { PageGenUrl, StorySnapUrl } from '@/config';
import { getTranslations } from 'next-intl/server';
import Link from 'next/link';
import Image from 'next/image';

export async function HeroLanding() {
const t = await getTranslations('HomePage');
const isPageGen = Math.random() >= 0.5;

const PageGenElement = (
<Link href={PageGenUrl} target="_blank">
<div className="rounded-full px-6 py-2 flex items-center gap-2 hover:bg-primary/10 transition-all duration-300">
<Image src="/logo.png" alt="Penguin" width={30} height={30} className="size-6" />
<span>PageGen - AI Page Generator</span>
<span className="ml-2 bg-gradient-to-r from-blue-500 to-purple-500 text-white px-4 py-1 rounded-full text-sm font-medium hover:shadow-lg transition-all">
Try Free Now
</span>
</div>
</Link>
);

const StorySnapElement = (
<Link href={StorySnapUrl} target="_blank">
<div className="rounded-full px-6 py-2 flex items-center gap-2 hover:bg-primary/10 transition-all duration-300">
<Image src="/penguin.png" alt="Penguin" width={30} height={30} className="size-6" />
<span>Transform Images into Stories with AI</span>
<span className="ml-2 bg-gradient-to-r from-blue-500 to-purple-500 text-white px-4 py-1 rounded-full text-sm font-medium hover:shadow-lg transition-all">
Try Free Now
</span>
</div>
</Link>
);
return (
<section className="py-10">
<div className="flex flex-col items-center text-center space-y-4">
<h1 className="text-balance text-4xl md:text-5xl font-semibold text-gradient_indigo-purple">{t('hero')}</h1>
<h2 className="text-balance leading-normal text-muted-foreground font-semibold sm:text-xl sm:leading-8 underline">
<Link href={PageGenUrl} prefetch={false} className="text-[#6C09C8] dark:text-purple-500 hover:text-purple-600">
PageGen - AI Page Generator
</Link>
</h2>
<h1 className="text-balance text-4xl md:text-5xl font-bold">{t('hero')}</h1>
<h2 className="hidden ">MemFree - Hybrid AI Search</h2>
{isPageGen ? <>{PageGenElement}</> : <>{StorySnapElement}</>}
</div>
</section>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/search/search-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const SearchBar: React.FC<Props> = ({
<TextareaAutosize
value={content}
placeholder={t('search-tip')}
minRows={2}
minRows={3}
maxRows={10}
aria-label="Search"
className="w-full border-0 bg-transparent p-4 mb-8 text-sm placeholder:text-muted-foreground overflow-y-auto outline-0 ring-0 focus-visible:outline-none focus-visible:ring-0 resize-none"
Expand Down
1 change: 1 addition & 0 deletions frontend/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {

const site_url = 'https://www.memfree.me';
export const PageGenUrl = 'https://pagegen.ai';
export const StorySnapUrl = 'https://www.snapstoryai.com';
export const SearchUrl = 'https://www.memfree.me';
export const ReactShadcnUrl = 'https://reactshadcn.com';

Expand Down
Binary file added frontend/public/penguin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c7ffbf7

Please sign in to comment.