Skip to content

Commit be98d58

Browse files
authored
Merge pull request #118 from ab7022/main
added sticky navbar for VS Code Extention
2 parents a12c852 + f880424 commit be98d58

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

components/hero.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import CopyButton from './utils/copyButton';
99
import { TrustedBy } from './trustedBy';
1010
import Link from 'next/link';
1111
import APItext from "@/public/images/apiText.png";
12+
import Banner from './ui/banner';
1213

1314
export default function Hero() {
1415
return (
@@ -112,7 +113,7 @@ export default function Hero() {
112113
</div>
113114
</div>
114115
</div>
115-
116+
<Banner />
116117
<ModalVideo
117118
thumb={VideoThumb}
118119
thumbWidth={768}

components/ui/banner.tsx

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
"use client";
2+
3+
import React, { useState } from "react";
4+
import { FiX } from "react-icons/fi";
5+
6+
const Banner = () => {
7+
const [showBanner, setShowBanner] = useState(true);
8+
9+
if (!showBanner) return null;
10+
11+
return (
12+
<div className="fixed top-16 lg:top-20 left-0 right-0 z-50 flex flex-row lg:flex-row items-center justify-between bg-gradient-to-r from-secondary-300 to-secondary-100 py-2 px-2 sm:px-6 lg:py-0 shadow-lg shadow-gray-400">
13+
14+
{/* Banner Content */}
15+
<div className="flex flex-col sm:flex-row items-center gap-3 sm:gap-4 lg:gap-6 w-full lg:w-auto text-center lg:text-left">
16+
{/* Logo and title */}
17+
<div className=" items-center gap-2 sm:gap-3 hidden lg:flex">
18+
<div className="flex items-center p-1 sm:p-2">
19+
<img
20+
src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/vscode/vscode-original.svg"
21+
alt="VS Code logo"
22+
className="h-10 w-10 sm:h-12 sm:w-12 bg-white rounded-full border-2 border-gray-200 shadow-xl"
23+
/>
24+
</div>
25+
<h2 className="font-bold text-white font-inter text-sm sm:text-base lg:text-xl ">
26+
Supercharge Your Development
27+
</h2>
28+
</div>
29+
30+
{/* Divider for desktop view */}
31+
<div className="hidden lg:block border-l border-accent-500 h-10 opacity-80" />
32+
33+
{/* Description */}
34+
<p className="text-white opacity-90 text-xs sm:text-sm lg:text-base max-w-full lg:max-w-lg leading-snug sm:leading-tight">
35+
Discover how the Keploy VS Code extension lets you easily record and
36+
replay test cases within your IDE.
37+
</p>
38+
</div>
39+
40+
{/* Action buttons and close button */}
41+
<div className="flex flex-row sm:flex-row sm:items-center justify-center gap-1 sm:gap-3 lg:gap-4 sm:mt-0">
42+
<a
43+
href="https://marketplace.visualstudio.com/items?itemName=Keploy.keployio"
44+
target="_blank"
45+
rel="noopener noreferrer"
46+
className="bg-primary-400 hover:bg-primary-500 text-neutral-100 font-inter rounded px-0 sm:px-2 ml-1 lg:px-6 py-1 lg:py-2 text-xs sm:text-sm lg:text-base text-center transition-all duration-200 shadow-md"
47+
>
48+
Get Started for Free
49+
</a>
50+
<button
51+
onClick={() => setShowBanner(false)}
52+
className="text-gray-300 hover:text-white font-semibold text-lg sm:text-xl lg:text-2xl cursor-pointer transition-transform transform hover:scale-110"
53+
aria-label="Close Banner"
54+
>
55+
<FiX />
56+
</button>
57+
</div>
58+
</div>
59+
);
60+
};
61+
62+
export default Banner;

0 commit comments

Comments
 (0)