Skip to content

Commit de30ecb

Browse files
authored
Merge pull request #184 from cryptomator/feature/product-hero-redesign
Redesign the product page heroes and roll out the Hub brand color
2 parents 288555c + 35c8c7d commit de30ecb

49 files changed

Lines changed: 1148 additions & 346 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Using WebP (for smaller images) or AVIF (for >80 kiB due to larger overhead) may
3939
* `brew install libavif` (see [GitHub Project Page](https://github.com/AOMediaCodec/libavif?tab=readme-ov-file#installation) for other installation methods)
4040
* Example (lossless): `avifenc -l input.png output.avif`
4141
* Example (lossy): `avifenc --qcolor 70 --qalpha 100 --depth 8 input.png output.avif`
42+
* Example (lossy, mostly transparent image): `avifenc --qcolor 60 --qalpha 50 --depth 10 -s 0 input.png output.avif`
43+
* Alpha is coded separately. For an image with large transparent areas, `--qalpha 100` can be most of the file, and a lower `--qalpha` (around 50) shrinks it several times over with no visible difference. Speed `-s 0` is slow but gives the smallest file.
4244
* `brew install libwebm`
4345
* Example (lossless): `cwebp -preset drawing -lossless -z 6 -metadata all input.png -o output.webp`
4446
* Example (lossy): `cwebp -preset drawing -q 90 -alpha_q 100 -metadata all input.png -o output.webp`

‎assets/css/custom.css‎

Lines changed: 106 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,96 @@
11
/* custom classes: */
22
.header-bg {
3-
background-image: url(/img/home/header-background.avif), linear-gradient(to bottom, rgb(4.31% 5.88% 9.02%) 0%, rgb(7.84% 20.39% 32.94%) 38%, rgb(24.71% 54.51% 85.1%) 72%, rgb(60.39% 78.04% 96.08%) 90%);
3+
background-image: url(/img/home/header-background.avif), linear-gradient(to bottom, var(--color-dark) 0%, rgb(7.84% 20.39% 32.94%) 38%, rgb(24.71% 54.51% 85.1%) 72%, rgb(60.39% 78.04% 96.08%) 90%);
44
background-size: auto 100%;
55
}
66

7+
/* Two stacked icons per slot; `.is-locked` on the .finder-hero root, set by
8+
script, picks the visible face. */
9+
.finder-swap-icon {
10+
@apply relative inline-flex flex-none size-5;
11+
}
12+
13+
.finder-swap-icon i,
14+
.finder-swap-icon img {
15+
@apply absolute inset-0 flex items-center justify-center object-contain;
16+
transition: opacity 0.4s ease;
17+
}
18+
19+
.finder-hero.is-locked .finder-when-unlocked,
20+
.finder-hero:not(.is-locked) .finder-when-locked {
21+
opacity: 0;
22+
}
23+
24+
.finder-hero.is-locked .finder-flap-name {
25+
@apply font-mono text-[13px] text-gray-600;
26+
}
27+
28+
/* The title-bar path flips as one whole panel between its locked and unlocked
29+
label instead of per-letter flapping. */
30+
.finder-path {
31+
@apply inline-flex min-w-0 perspective-[400px];
32+
}
33+
34+
.finder-path-inner {
35+
@apply transform-3d transition-transform duration-600 ease-in-out;
36+
}
37+
38+
.finder-path-front,
39+
.finder-path-back {
40+
@apply backface-hidden;
41+
}
42+
43+
.finder-path-back,
44+
.finder-hero:not(.is-locked) .finder-path-inner {
45+
@apply rotate-x-180;
46+
}
47+
48+
/* Crossfade rotator for exactly three children: the :nth-child delays carve the
49+
12s cycle into three 4s slots, so a fourth child fades in on top of the first. */
50+
.idp-swap {
51+
display: inline-grid;
52+
place-items: center;
53+
}
54+
55+
/* Every delay is shifted by -0.48s, the length of the 4% fade-in, so the first
56+
child is already opaque on load instead of fading in. */
57+
.idp-swap > * {
58+
grid-area: 1 / 1;
59+
opacity: 0;
60+
animation: idp-cycle 12s infinite backwards;
61+
animation-delay: -0.48s;
62+
}
63+
64+
.idp-swap > :nth-child(2) {
65+
animation-delay: 3.52s;
66+
}
67+
68+
.idp-swap > :nth-child(3) {
69+
animation-delay: 7.52s;
70+
}
71+
72+
@keyframes idp-cycle {
73+
0% { opacity: 0; }
74+
4% { opacity: 1; }
75+
33% { opacity: 1; }
76+
37% { opacity: 0; }
77+
100% { opacity: 0; }
78+
}
79+
80+
@media (prefers-reduced-motion: reduce) {
81+
.ad-pulse {
82+
display: none;
83+
}
84+
85+
.idp-swap > * {
86+
animation: none;
87+
}
88+
89+
.idp-swap > :first-child {
90+
opacity: 1;
91+
}
92+
}
93+
794
.container-prose {
895
@apply w-full mx-auto;
996
max-width: 768px;
@@ -34,22 +121,22 @@
34121
@apply bg-secondary border-secondary text-white;
35122
}
36123

37-
.btn-tertiary2 {
38-
@apply bg-tertiary2 border-tertiary2 text-white;
124+
.btn-hub {
125+
@apply bg-hub border-hub text-white;
39126
}
40127

41128
.btn-primary:hover,
42129
.btn-primary:focus,
43130
.btn-secondary:hover,
44131
.btn-secondary:focus,
45-
.btn-tertiary2:hover,
46-
.btn-tertiary2:focus {
132+
.btn-hub:hover,
133+
.btn-hub:focus {
47134
@apply text-white transition transform duration-200 ease-in-out shadow-md -translate-y-px;
48135
}
49136

50137
.btn-primary:disabled,
51138
.btn-secondary:disabled,
52-
.btn-tertiary2:disabled {
139+
.btn-hub:disabled {
53140
@apply shadow-none translate-y-0;
54141
}
55142

@@ -62,6 +149,15 @@
62149
@apply bg-primary text-white transition transform duration-200 ease-in-out;
63150
}
64151

152+
.btn-outline-hub {
153+
@apply border border-hub text-hub;
154+
}
155+
156+
.btn-outline-hub:hover,
157+
.btn-outline-hub:focus {
158+
@apply bg-hub text-white transition transform duration-200 ease-in-out;
159+
}
160+
65161
.btn-outline-secondary {
66162
@apply border border-secondary text-secondary;
67163
}
@@ -99,6 +195,10 @@
99195
@apply text-primary no-underline hover:underline;
100196
}
101197

198+
.text-link-hub {
199+
@apply text-hub no-underline hover:underline;
200+
}
201+
102202
.font-h1 {
103203
@apply font-headline font-medium text-3xl md:text-4xl leading-tight text-balance;
104204
}

‎assets/css/hero.css‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
.hero-aura-secondary {
5454
right: -12%;
55-
background: radial-gradient(circle, color-mix(in srgb, var(--color-tertiary2) 14%, transparent) 0%, transparent 70%);
55+
background: radial-gradient(circle, color-mix(in srgb, var(--color-hub) 14%, transparent) 0%, transparent 70%);
5656
}
5757

5858
/* Uses the same `container` constraint as the content sections below, so the
@@ -70,7 +70,7 @@
7070
}
7171

7272
.hero-panel-primary { --accent: var(--color-primary); }
73-
.hero-panel-secondary { --accent: var(--color-tertiary2); }
73+
.hero-panel-secondary { --accent: var(--color-hub); }
7474

7575
.hero-panel-content {
7676
@apply flex-1 flex flex-col items-center;
@@ -142,7 +142,7 @@
142142
- encrypted vault / key → secondary (teal) — the right segment */
143143
.hero-cryp-link { stroke: var(--color-primary); }
144144

145-
.hero-hub-link { stroke: var(--color-tertiary2); }
145+
.hero-hub-link { stroke: var(--color-hub); }
146146

147147
/* Anchor: the icon/logo is centered on its declared point so the connecting
148148
dashed lines (drawn to that point) pass through the disc's centre. The label
@@ -167,9 +167,9 @@
167167
}
168168

169169
.hero-hub-scene {
170-
--scene-accent: var(--color-tertiary2);
170+
--scene-accent: var(--color-hub);
171171
--scene-disc: #f1f6fb;
172-
--scene-token: var(--color-tertiary2);
172+
--scene-token: var(--color-hub);
173173
--scene-glow: color-mix(in srgb, var(--color-gray-600) 40%, transparent);
174174
--scene-cycle: 10s;
175175
}

‎assets/css/theme.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
--color-primary-l2: #ebf5eb;
114114
--color-secondary: #008a7b;
115115
--color-tertiary: #005e71;
116-
--color-tertiary2: #354960;
116+
--color-hub: #354960;
117117
--color-dark: #1e2b33;
118118

119119
--font-*: initial;

‎assets/js/finder-hero.js‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
"use strict";
2+
3+
/* One interval drives both halves of the effect: the per-element split-flap
4+
text here, and the `.is-locked` icon and panel swap done in CSS. */
5+
6+
class FinderFlap {
7+
constructor(el) {
8+
this.el = el;
9+
this.lockedText = el.dataset.locked;
10+
this.unlockedText = el.dataset.unlocked;
11+
this.chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
12+
this.raf = null;
13+
}
14+
15+
show(locked) {
16+
const newText = locked ? this.lockedText : this.unlockedText;
17+
const oldText = this.el.textContent;
18+
const length = Math.max(oldText.length, newText.length);
19+
this.queue = [];
20+
for (let i = 0; i < length; i++) {
21+
const from = oldText[i] || '';
22+
const to = newText[i] || '';
23+
const start = Math.floor(i * 0.8);
24+
const end = start + 8 + Math.floor(Math.random() * 8);
25+
this.queue.push({ from, to, start, end, char: null });
26+
}
27+
cancelAnimationFrame(this.raf);
28+
this.frame = 0;
29+
this.update();
30+
}
31+
32+
update() {
33+
let output = '';
34+
let complete = 0;
35+
for (const item of this.queue) {
36+
if (this.frame >= item.end) {
37+
complete++;
38+
output += item.to;
39+
} else if (this.frame >= item.start) {
40+
if (!item.char || Math.random() < 0.35) {
41+
item.char = this.chars[Math.floor(Math.random() * this.chars.length)];
42+
}
43+
output += item.char;
44+
} else {
45+
output += item.from;
46+
}
47+
}
48+
this.el.textContent = output;
49+
if (complete < this.queue.length) {
50+
this.frame++;
51+
this.raf = requestAnimationFrame(() => this.update());
52+
}
53+
}
54+
}
55+
56+
function initFinderHero() {
57+
const root = document.querySelector('.finder-hero');
58+
if (!root) {
59+
return;
60+
}
61+
const flapElements = root.querySelectorAll('.finder-flap');
62+
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
63+
root.classList.remove('is-locked');
64+
flapElements.forEach((el) => {
65+
el.textContent = el.dataset.unlocked;
66+
});
67+
return;
68+
}
69+
const flaps = Array.from(flapElements, (el) => new FinderFlap(el));
70+
const providers = [
71+
{ name: 'Google Drive', src: '/img/clouds/google-drive.svg' },
72+
{ name: 'iCloud Drive', src: '/img/clouds/icloud.svg' },
73+
{ name: 'OneDrive', src: '/img/clouds/onedrive.svg' },
74+
{ name: 'Dropbox', src: '/img/clouds/dropbox.svg' },
75+
];
76+
const providerName = root.querySelector('[data-finder-provider-name]');
77+
const providerIcon = root.querySelector('[data-finder-provider-icon]');
78+
let providerIndex = 0;
79+
let locked = true;
80+
setInterval(() => {
81+
locked = !locked;
82+
if (locked) {
83+
providerIndex = (providerIndex + 1) % providers.length;
84+
providerName.textContent = providers[providerIndex].name;
85+
providerIcon.src = providers[providerIndex].src;
86+
}
87+
root.classList.toggle('is-locked', locked);
88+
flaps.forEach((flap, index) => {
89+
setTimeout(() => flap.show(locked), index * 140);
90+
});
91+
}, 5000);
92+
}
93+
94+
initFinderHero();

‎content/for-individuals.de.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
22
title: "Cryptomator"
33
type: for-individuals
4+
darkNav: true
5+
flushHero: true
46
---

‎content/for-individuals.en.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
22
title: "Cryptomator"
33
type: for-individuals
4+
darkNav: true
5+
flushHero: true
46
---

‎content/for-teams.de.html‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: "Cryptomator Hub"
33
type: for-teams
4+
hubNav: true
5+
darkNav: true
6+
flushHero: true
47
aliases: ["/hub"]
58
---

‎content/for-teams.en.html‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: "Cryptomator Hub"
33
type: for-teams
4+
hubNav: true
5+
darkNav: true
6+
flushHero: true
47
aliases: ["/hub"]
58
---

0 commit comments

Comments
 (0)