Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Shan-Weaviate committed Nov 13, 2024
1 parent 52fa2c3 commit e412604
Show file tree
Hide file tree
Showing 5 changed files with 2,643 additions and 32 deletions.
28 changes: 2 additions & 26 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ const config = {
// hideOnScroll: true,
logo: {
alt: 'Weaviate',
src: '/img/site/weaviate-nav-logo-light.svg',
src: '/img/site/weaviate-logo-horizontal-light-1.svg',
srcDark: '/img/site/weaviate-logo-horizontal-dark-1.svg',
},
items: [
{
Expand Down Expand Up @@ -686,31 +687,6 @@ const config = {
label: 'Slack',
to: 'https://weaviate.io/slack',
},
{
label: 'Meetups',
to: '#',
className: 'footer__title subtitle',
},
{
label: 'Amsterdam',
to: 'https://www.meetup.com/weaviate-amsterdam',
},
{
label: 'Boston',
to: 'https://www.meetup.com/weaviate-boston',
},
{
label: 'New York',
to: 'https://www.meetup.com/weaviate-NYC',
},
{
label: 'San Francisco',
to: 'https://www.meetup.com/weaviate-san-francisco',
},
{
label: 'Toronto',
to: 'https://www.meetup.com/weaviate-toronto',
},
],
},

Expand Down
15 changes: 9 additions & 6 deletions src/css/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ button.close {
img {
display: none;
}
background-image: url('/img/site/weaviate-nav-logo-light.svg');
background-image: url('/img/site/weaviate-logo-horizontal-dark-1.svg');
}
}

Expand Down Expand Up @@ -573,7 +573,10 @@ button.close {
img {
display: none;
}
background-image: url('/img/site/weaviate-nav-logo-dark.svg');

background-image: url('/img/site/weaviate-logo-horizontal-light-1.svg');
background-size: contain;
background-repeat: no-repeat;
}

.footer--dark {
Expand Down Expand Up @@ -752,13 +755,13 @@ Dropdown style removed.

.custom-page .footer__links:before {
content: '';
background-image: url('/img/site/weaviate-nav-logo-dark.svg');
background-image: url('/img/site/weaviate-logo-horizontal-light-1.svg');

background-size: contain;
background-repeat: no-repeat;
width: 11rem;
height: 11rem;
margin: -21px 0px 0px 0px;
width: 9rem;
height: 2rem;
margin: -2px 0px 0px;
}

.content_node_modules-\@docusaurus-theme-classic-lib-theme-AnnouncementBar-Content-styles-module {
Expand Down
67 changes: 67 additions & 0 deletions src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React, { useEffect, useState } from 'react';
import OriginalNavbar from '@theme-original/Navbar';


console.log("Custom Navbar component is being rendered");

export default function Navbar(props) {
const [showTooltip, setShowTooltip] = useState(false);

useEffect(() => {
// Target the existing logo element by class
const logoElement = document.querySelector('.navbar__logo');

if (logoElement) {
// Log to confirm logo is targeted
console.log("Navbar logo element found");

// Right-click event to trigger download
const handleRightClick = (e) => {
e.preventDefault(); // Prevent the default context menu
console.log("Right-click download triggered from existing logo");


const link = document.createElement('a');
link.href = '/img/site/weaviate-logo-horizontal-light-1.svg';
link.download = 'weaviate-logo.svg';
link.click();
};


logoElement.addEventListener('contextmenu', handleRightClick);


return () => {
logoElement.removeEventListener('contextmenu', handleRightClick);
};
}
}, []);


const handleMouseEnter = () => setShowTooltip(true);
const handleMouseLeave = () => setShowTooltip(false);

return (
<div style={{ position: 'relative' }} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>
<OriginalNavbar {...props} />
{showTooltip && (
<div
style={{
position: 'absolute',
top: '100%',
marginTop: '8px',
padding: '4px 8px',
background: 'black',
color: 'white',
borderRadius: '4px',
fontSize: '0.75rem',
whiteSpace: 'nowrap',
zIndex: 1000,
}}
>
Right-click to download the logo
</div>
)}
</div>
);
}
Loading

0 comments on commit e412604

Please sign in to comment.