7 Commits

Author SHA1 Message Date
9fcc8bd343 Update src/app/page.tsx 2026-02-23 20:43:28 +00:00
93d8dea429 Update src/app/layout.tsx 2026-02-23 20:43:27 +00:00
0e521d36b6 Merge version_5 into main
Merge version_5 into main
2026-02-23 20:42:01 +00:00
51eaa7b135 Merge version_5 into main
Merge version_5 into main
2026-02-23 20:41:28 +00:00
436e3b6dfc Merge version_5 into main
Merge version_5 into main
2026-02-23 20:40:50 +00:00
77b53b3108 Merge version_5 into main
Merge version_5 into main
2026-02-23 20:40:27 +00:00
a2d78c7fd0 Bob AI: Add a navigation link to the products page in the navbar men 2026-02-23 20:33:37 +00:00
3 changed files with 69 additions and 47 deletions

View File

@@ -3,24 +3,15 @@ import { Plus_Jakarta_Sans } from "next/font/google";
import "./globals.css";
import { ServiceWrapper } from "@/components/ServiceWrapper";
import Tag from "@/tag/Tag";
import { Libre_Baskerville } from "next/font/google";
import { Inter } from "next/font/google";
const plusJakartaSans = Plus_Jakarta_Sans({
variable: "--font-plus-jakarta-sans", subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Champion's Journey | Professional Tennis Player", description: "Witness the inspiring career of a professional tennis player. Explore training excellence, career highlights, and upcoming tournaments with exclusive insights into grand slam glory.", keywords: ["professional tennis", "tennis player", "grand slam", "training regimen", "sports career"]
};
const libreBaskerville = Libre_Baskerville({
variable: "--font-libre-baskerville",
subsets: ["latin"],
weight: ["400", "700"],
});
const inter = Inter({
variable: "--font-inter",
subsets: ["latin"],
});
export default function RootLayout({
children,
}: Readonly<{
@@ -29,7 +20,9 @@ export default function RootLayout({
return (
<html lang="en" suppressHydrationWarning>
<ServiceWrapper>
<body className={`${libreBaskerville.variable} ${inter.variable} antialiased`}>
<body
className={`${plusJakartaSans.variable} antialiased`}
>
<Tag />
{children}
@@ -274,7 +267,9 @@ export default function RootLayout({
const getElementInfo = (element, assignId = false) => {
const rect = element.getBoundingClientRect();
const tagName = element.tagName.toLowerCase();
const selector = getUniqueSelector(element, assignId);
const sectionId = getSectionId(element);
let className = undefined;
try {
if (element.className) {
@@ -302,7 +297,8 @@ export default function RootLayout({
};
if (tagName === 'img') {
info.imageData = {
const originalSrc = extractOriginalUrl(element.src);
info.imageData = {
src: originalSrc,
alt: element.alt || undefined,
naturalWidth: element.naturalWidth,
@@ -313,7 +309,8 @@ export default function RootLayout({
if (tagName === 'video') {
const rawSrc = element.src || element.currentSrc || (element.querySelector('source') && element.querySelector('source').src) || '';
info.imageData = {
const resolvedSrc = extractOriginalUrl(rawSrc);
info.imageData = {
src: resolvedSrc,
alt: element.getAttribute('aria-label') || undefined,
isBackground: false,
@@ -326,7 +323,8 @@ export default function RootLayout({
if (backgroundImage && backgroundImage !== 'none') {
const urlMatch = backgroundImage.match(/url(['"]?([^'")]+)['"]?)/);
if (urlMatch) {
if (tagName !== 'img') {
const originalBgSrc = extractOriginalUrl(urlMatch[1]);
if (tagName !== 'img') {
info.imageData = {
src: originalBgSrc,
isBackground: true
@@ -338,7 +336,8 @@ export default function RootLayout({
}
}
info.elementType = elementType;
const elementType = getElementType(element);
info.elementType = elementType;
if (elementType === 'Button') {
const buttonText = element.textContent?.trim() || element.value || element.getAttribute('aria-label') || '';
@@ -431,11 +430,13 @@ export default function RootLayout({
};
const isTextElement = (element) => {
return elementType === 'Text';
const elementType = getElementType(element);
return elementType === 'Text';
};
const isButtonElement = (element) => {
return elementType === 'Button';
const elementType = getElementType(element);
return elementType === 'Button';
};
const updateButtonText = (element, newText) => {
@@ -510,7 +511,8 @@ export default function RootLayout({
};
const handleInput = () => {
let currentText = element.textContent;
const elementInfo = getElementInfo(element);
let currentText = element.textContent;
// Ensure there's always at least a space to keep the element editable
if (currentText === '' || currentText === null || currentText.length === 0) {
@@ -623,7 +625,8 @@ export default function RootLayout({
}, '*');
if (save && originalContent !== element.textContent) {
let finalText = element.textContent;
const elementInfo = getElementInfo(element);
let finalText = element.textContent;
// Trim the final text and convert space-only to empty string for saving
if (finalText === ' ' || finalText.trim() === '') {
@@ -752,7 +755,7 @@ export default function RootLayout({
lastMouseX = e.clientX;
lastMouseY = e.clientY;
|| e.target;
const target = getMostSpecificElement(e.clientX, e.clientY) || e.target;
if (!isValidElement(target) || target === hoveredElement || target === selectedElement) {
return;
@@ -784,7 +787,8 @@ export default function RootLayout({
hoverOverlay = createHoverOverlay(target);
}
showElementTypeLabel(target, elementType);
const elementType = getElementType(target);
showElementTypeLabel(target, elementType);
window.parent.postMessage({
type: 'webild-element-hover',
@@ -826,7 +830,7 @@ export default function RootLayout({
e.preventDefault();
e.stopPropagation();
|| e.target;
const target = getMostSpecificElement(e.clientX, e.clientY) || e.target;
if (!isValidElement(target)) return;
if (selectedElement && selectedElement !== target) {
@@ -871,7 +875,8 @@ export default function RootLayout({
hoveredElement = null;
}
selectedElement.dataset.webildSelector = elementInfo.selector;
const elementInfo = getElementInfo(target, true);
selectedElement.dataset.webildSelector = elementInfo.selector;
showElementTypeLabel(target, elementInfo.elementType);
window.parent.postMessage({
@@ -954,7 +959,8 @@ export default function RootLayout({
isScrolling = false;
if (lastMouseX > 0 && lastMouseY > 0) {
if (target && isValidElement(target) && target !== selectedElement) {
const target = getMostSpecificElement(lastMouseX, lastMouseY);
if (target && isValidElement(target) && target !== selectedElement) {
hoveredElement = target;
const computedStyle = window.getComputedStyle(target);
@@ -968,7 +974,8 @@ export default function RootLayout({
hoveredElement.classList.add(hoverClass);
hoverOverlay = createHoverOverlay(target);
showElementTypeLabel(target, elementType);
const elementType = getElementType(target);
showElementTypeLabel(target, elementType);
window.parent.postMessage({
type: 'webild-element-hover',
@@ -991,7 +998,8 @@ export default function RootLayout({
const saveChangeToStorage = (change) => {
try {
const existingChanges = JSON.parse(localStorage.getItem(storageKey) || '[]');
const storageKey = getStorageKey();
const existingChanges = JSON.parse(localStorage.getItem(storageKey) || '[]');
const filteredChanges = existingChanges.filter(c => {
return !(c.oldValue === change.oldValue && c.sectionId === change.sectionId);
@@ -1011,7 +1019,8 @@ export default function RootLayout({
const clearLocalChanges = () => {
try {
localStorage.removeItem(storageKey);
const storageKey = getStorageKey();
localStorage.removeItem(storageKey);
window.parent.postMessage({
type: 'webild-local-changes-cleared',
data: {}
@@ -1060,7 +1069,8 @@ export default function RootLayout({
if (e.data.type === 'webild-cancel-changes') {
try {
const savedChanges = localStorage.getItem(storageKey);
const storageKey = getStorageKey();
const savedChanges = localStorage.getItem(storageKey);
if (savedChanges) {
const changes = JSON.parse(savedChanges);
changes.forEach(change => {
@@ -1082,7 +1092,8 @@ export default function RootLayout({
if (isBackground) {
element.style.backgroundImage = change.oldValue ? 'url(' + change.oldValue + ')' : '';
} else {
if (revertTag === 'video' && oldMediaType === 'image') {
const oldMediaType = getMediaTypeFromUrl(change.oldValue);
if (revertTag === 'video' && oldMediaType === 'image') {
swapMediaElement(element, 'img', change.oldValue);
} else if (revertTag === 'img' && oldMediaType === 'video') {
swapMediaElement(element, 'video', change.oldValue);
@@ -1130,7 +1141,8 @@ export default function RootLayout({
const el = textElements[i];
if (isTextElement(el) && el.textContent.trim() === (oldValue || '').trim()) {
element = el;
if (newSelector) {
const newSelector = getUniqueSelector(element, true);
if (newSelector) {
element.dataset.webildSelector = newSelector;
}
break;
@@ -1221,8 +1233,10 @@ export default function RootLayout({
replaced = true;
} else if (element.tagName.toLowerCase() === 'img') {
oldValue = element.src;
if (newMediaType === 'video' && allowMediaTypeSwap) {
if (selectedElement === element) selectedElement = swapped;
const newMediaType = getMediaTypeFromUrl(newSrc);
if (newMediaType === 'video' && allowMediaTypeSwap) {
const swapped = swapMediaElement(element, 'video', newSrc);
if (selectedElement === element) selectedElement = swapped;
element = swapped;
} else {
element.src = newSrc;
@@ -1230,9 +1244,11 @@ export default function RootLayout({
replaced = true;
} else if (element.tagName.toLowerCase() === 'video') {
oldValue = element.src || element.currentSrc || '';
const sources = element.querySelectorAll('source');
const newMediaType = getMediaTypeFromUrl(newSrc);
const sources = element.querySelectorAll('source');
if (newMediaType === 'image' && allowMediaTypeSwap) {
if (selectedElement === element) selectedElement = swapped;
const swapped = swapMediaElement(element, 'img', newSrc);
if (selectedElement === element) selectedElement = swapped;
element = swapped;
} else {
if (sources.length > 0) {
@@ -1254,7 +1270,8 @@ export default function RootLayout({
}
if (replaced) {
const elementInfo = getElementInfo(element);
let cleanOldValue = oldValue;
if (oldValue.includes('url(')) {
const urlMatch = oldValue.match(/url(['"]?([^'")]+)['"]?)/);
@@ -1325,7 +1342,13 @@ export default function RootLayout({
}
}, true);
const urlCheckInterval = setInterval(() => {
if (lastPathname !== window.location.pathname) {
lastPathname = window.location.pathname;
notifyPageChange();
}
}, 500);
notifyPageChange();
window.webildCleanup = () => {

View File

@@ -45,7 +45,7 @@ export default function LandingPage() {
<div id="hero-section" data-section="hero-section">
<HeroSplitKpi
title="Champion's Journey: From Court to Glory"
description=""
description="Witness the extraordinary rise of a professional tennis star, showcasing unparalleled dedication, strategic brilliance, and unmatched performance on the world's most prestigious courts."
background={{ variant: "radial-gradient" }}
kpis={[
{ value: "12", label: "Grand Slam Titles" },
@@ -106,7 +106,7 @@ export default function LandingPage() {
features={[
{
id: 1,
title: "Precision Serve Technique", description: "", imageSrc: "https://img.b2bpic.net/free-photo/full-length-portrait-fit-sportsman-stretching-hands_171337-9454.jpg", imageAlt: "Tennis player executing a precise serve"
title: "Precision Serve Technique", description: "Master the art of the perfect serve with biomechanical analysis and real-time feedback.", imageSrc: "https://img.b2bpic.net/free-photo/full-length-portrait-fit-sportsman-stretching-hands_171337-9454.jpg", imageAlt: "Tennis player executing a precise serve"
},
{
id: 2,
@@ -161,7 +161,6 @@ export default function LandingPage() {
/>
</div>
<div id="contact-section" data-section="contact-section">
<ContactSplit
tag="Get In Touch"

View File

@@ -13,7 +13,7 @@ import type { ButtonConfig } from "@/types/button";
import "./NavbarStyleFullscreen.css";
interface NavLinkProps {
item: NavItem;
item: NavItem & { href?: string };
onClose: () => void;
}
@@ -21,13 +21,13 @@ const NavLink = ({ item, onClose }: NavLinkProps) => {
const handleClick = useButtonClick(item.id, onClose);
return (
<button
type="button"
className="navbar-fullscreen__link text-background font-normal leading-[1.15] no-underline text-9xl bg-transparent border-none cursor-pointer"
<a
href={item.href || "#"}
className="navbar-fullscreen__link text-background font-normal leading-[1.15] no-underline text-9xl bg-transparent border-none cursor-pointer block"
onClick={handleClick}
>
<span className="navbar-fullscreen__link-text block relative">{item.name}</span>
</button>
</a>
);
};