Skip to content

Commit 296efee

Browse files
ostermanclaude
andauthored
Make Cloud Posse watermark clickable and link to cloudposse.com (#1820)
Convert the watermark from a non-interactive CSS background image to a clickable anchor element that links to cloudposse.com. The watermark now appears on all pages with proper theme switching (light/dark mode) and responsive behavior (hidden on mobile). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent 49caeb9 commit 296efee

File tree

4 files changed

+96
-9
lines changed

4 files changed

+96
-9
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* Cloud Posse Logo - Fixed position in bottom right corner */
2+
.cloudposse-logo {
3+
position: fixed;
4+
bottom: 2%;
5+
right: 2%;
6+
width: 15em;
7+
z-index: 100;
8+
opacity: 0.5;
9+
transition: opacity 0.2s ease-in-out;
10+
text-decoration: none;
11+
}
12+
13+
.cloudposse-logo:hover {
14+
opacity: 0.8;
15+
}
16+
17+
.cloudposse-logo img {
18+
width: 100%;
19+
height: auto;
20+
display: block;
21+
}
22+
23+
/* Theme-based logo switching */
24+
/* Light mode: show light logo, hide dark logo */
25+
.cloudposse-logo__light {
26+
display: block;
27+
}
28+
29+
.cloudposse-logo__dark {
30+
display: none;
31+
}
32+
33+
/* Dark mode: show dark logo, hide light logo */
34+
html[data-theme='dark'] .cloudposse-logo__light {
35+
display: none;
36+
}
37+
38+
html[data-theme='dark'] .cloudposse-logo__dark {
39+
display: block;
40+
}
41+
42+
/* Hide on mobile to avoid interfering with content */
43+
@media (max-width: 768px) {
44+
.cloudposse-logo {
45+
display: none;
46+
}
47+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
import './index.css';
3+
4+
/**
5+
* Watermark renders a fixed-position clickable Cloud Posse logo
6+
* in the bottom-right corner of the page.
7+
*
8+
* Theme switching is handled via CSS using [data-theme] selectors.
9+
*/
10+
export default function Watermark(): JSX.Element {
11+
return (
12+
<a
13+
href="https://cloudposse.com"
14+
target="_blank"
15+
rel="noopener noreferrer"
16+
className="cloudposse-logo"
17+
aria-label="Cloud Posse - Visit cloudposse.com"
18+
title="Cloud Posse"
19+
>
20+
<img
21+
src="/img/cloudposse-light.svg"
22+
alt="Cloud Posse"
23+
loading="lazy"
24+
className="cloudposse-logo__light"
25+
/>
26+
<img
27+
src="/img/cloudposse-opaque.svg"
28+
alt="Cloud Posse"
29+
loading="lazy"
30+
className="cloudposse-logo__dark"
31+
/>
32+
</a>
33+
);
34+
}

website/src/css/custom.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,8 @@ div.atmos__effect::before, html[data-theme='dark'] div.navbar__logo::before {
115115
color: black;
116116
}
117117

118-
html[data-theme='dark'] body {
119-
background-image: url("/static/img/cloudposse-opaque.svg");
120-
}
121-
122118
body {
123119
background-color: var(--ifm-background-color);
124-
background-image: url("/static/img/cloudposse-light.svg");
125-
background-position: 98% 98%;
126-
background-repeat: no-repeat;
127-
background-size: 15em;
128-
background-attachment: fixed;
129120
font-family: 'Optimistic Text', -apple-system, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
130121
font-size: 17px;
131122
line-height: 30px;

website/src/theme/Root.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import Watermark from '@site/src/components/Watermark';
3+
4+
/**
5+
* Root component that wraps the entire site.
6+
* Used to add global elements like the watermark.
7+
*/
8+
export default function Root({ children }: { children: React.ReactNode }): JSX.Element {
9+
return (
10+
<>
11+
{children}
12+
<Watermark />
13+
</>
14+
);
15+
}

0 commit comments

Comments
 (0)