Skip to content

Commit 2bc8f3f

Browse files
[DOCS] Homepage redesign (#2296)
* Started working oon a new homepage * Finished page * Fixed typed animation, adjusted tabs jumping * Hid the reviews * Changed industries logos, reduced header size * Changed code in code tabs sections, removed typed cursor * Upadted CTA heading * Updated links in footer * Fixed typed animation jumbping * Run precommit * added gulpfile and missing files * Updated gitignore * Removed .min files from repo * Updated code tabs to prevent escaped html console errors * Removed .min.map from the repo * Removed windows .idenfier files * Renamed Images * Updated gulpfile and extra rousrces files * Added delay between typying animation * Removed .main.min.js and converted mountains images to SVGs * Fix pre-commit * Removed extra files * Remorked template without overwriting base.html * Fetching vendors from node_modules * Add gulp to CI * Fixed header & footer, js subscribe fix * Added partials * Added missing svg images --------- Co-authored-by: Jia Yu <[email protected]>
1 parent 664768c commit 2bc8f3f

Some content is hidden

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

70 files changed

+18092
-122
lines changed

.github/workflows/docs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ jobs:
4949
run: mvn -q clean install -DskipTests && mkdir -p docs/api/javadoc/spark && cp -r spark/common/target/apidocs/* docs/api/javadoc/spark/
5050
- name: Compile ScalaDoc
5151
run: mvn generate-sources scala:doc -pl !common,!snowflake,!flink && mkdir -p docs/api/scaladoc/spark && cp -r spark/common/target/site/scaladocs/* docs/api/scaladoc/spark
52+
- name: Set up Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: '18'
56+
cache: 'npm'
57+
cache-dependency-path: 'docs-overrides/package-lock.json'
58+
- name: Install docs-overrides dependencies
59+
run: |
60+
cd docs-overrides
61+
npm ci
62+
- name: Build docs-overrides assets
63+
run: |
64+
cd docs-overrides
65+
npx gulp build
5266
- uses: actions/setup-python@v5
5367
with:
5468
python-version: '3.11'
@@ -121,3 +135,10 @@ jobs:
121135
path: ~/.m2
122136
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
123137
restore-keys: ${{ runner.os }}-m2
138+
- name: Cache Node modules
139+
uses: actions/cache@v4
140+
with:
141+
path: docs-overrides/node_modules
142+
key: ${{ runner.os }}-node-${{ hashFiles('docs-overrides/package-lock.json') }}
143+
restore-keys: |
144+
${{ runner.os }}-node-

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,14 @@
3737
__pycache__
3838
dependency-reduced-pom.xml
3939
target
40+
41+
# Windows WSL Images copy
42+
.Identifier
43+
*:Zone.Identifier
44+
*.Identifier
45+
46+
# Ignore minified files and source maps
47+
*.min.css
48+
*.min.css.map
49+
*.min.js
50+
*.min.js.map

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ repos:
217217
name: run codespell
218218
description: check spelling with codespell
219219
args: [--ignore-words=.github/linters/codespell.txt]
220-
exclude: ^docs/image|^spark/common/src/test/resources|^docs/usecases|^tools/maven/scalafmt|osmpbf/build|^docker/zeppelin
220+
exclude: ^docs/image|^spark/common/src/test/resources|^docs/usecases|^tools/maven/scalafmt|osmpbf/build|^docker/zeppelin|^docs-overrides
221221
- repo: https://github.com/gitleaks/gitleaks
222222
rev: v8.27.2
223223
hooks:
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import hljs from 'highlight.js/lib/core';
2+
import bash from 'highlight.js/lib/languages/bash';
3+
import python from 'highlight.js/lib/languages/python';
4+
import java from 'highlight.js/lib/languages/java';
5+
import powershell from 'highlight.js/lib/languages/powershell';
6+
import sql from 'highlight.js/lib/languages/sql';
7+
8+
// Register the languages
9+
hljs.registerLanguage('bash', bash);
10+
hljs.registerLanguage('python', python);
11+
hljs.registerLanguage('java', java);
12+
hljs.registerLanguage('powershell', powershell);
13+
hljs.registerLanguage('sql', sql);
14+
15+
hljs.configure({
16+
ignoreUnescapedHTML: true,
17+
});
18+
19+
export const codeTabs = () => {
20+
const initHljsSnippet = (root) => {
21+
const tabs = root.querySelectorAll('.hljs-snippet__tab');
22+
const panels = root.querySelectorAll('.hljs-snippet__panel');
23+
const copyBtn = root.querySelector('.hljs-snippet__copy');
24+
25+
// Helper to highlight code safely
26+
const highlight = (codeEl) => {
27+
codeEl.removeAttribute('data-highlighted'); // remove previous flag
28+
hljs.highlightElement(codeEl);
29+
};
30+
31+
// Highlight all panels on load
32+
panels.forEach((p) => highlight(p.querySelector('code')));
33+
34+
// Activate a specific language
35+
const activate = (lang) => {
36+
tabs.forEach((btn) => {
37+
const active = btn.dataset.lang === lang;
38+
btn.classList.toggle('is-active', active);
39+
btn.setAttribute('aria-selected', String(active));
40+
});
41+
42+
panels.forEach((panel) => {
43+
const show = panel.dataset.lang === lang;
44+
panel.hidden = !show;
45+
if (show) highlight(panel.querySelector('code')); // safe re-highlight
46+
});
47+
};
48+
49+
// Initial tab
50+
const initial = root.dataset.initial || tabs[0]?.dataset.lang;
51+
if (initial) activate(initial);
52+
53+
// Tab click handling
54+
tabs.forEach((btn) => {
55+
btn.addEventListener('click', () => activate(btn.dataset.lang));
56+
});
57+
58+
// Copy to clipboard
59+
const copyCurrent = async () => {
60+
const current = [...panels].find((p) => !p.hidden);
61+
if (!current) return;
62+
63+
const code = current.querySelector('code').textContent;
64+
65+
const showCopied = () => {
66+
copyBtn.classList.add('copied');
67+
setTimeout(() => copyBtn.classList.remove('copied'), 1200);
68+
};
69+
70+
try {
71+
await navigator.clipboard.writeText(code);
72+
showCopied();
73+
} catch {
74+
const area = document.createElement('textarea');
75+
area.value = code;
76+
area.style.position = 'fixed';
77+
area.style.opacity = '0';
78+
document.body.appendChild(area);
79+
area.select();
80+
try {
81+
document.execCommand('copy');
82+
} catch {}
83+
document.body.removeChild(area);
84+
showCopied();
85+
}
86+
};
87+
88+
if (copyBtn) {
89+
copyBtn.addEventListener('click', (e) => {
90+
e.preventDefault();
91+
e.stopPropagation();
92+
copyCurrent();
93+
});
94+
}
95+
};
96+
97+
// Initialize all snippet instances
98+
document.querySelectorAll('.hljs-snippet').forEach(initHljsSnippet);
99+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use strict';
2+
3+
export const industriesTabs = () => {
4+
// Loop through all tab components on the page
5+
document.querySelectorAll('.industries-tabs').forEach((tabs) => {
6+
const tabHeads = tabs.querySelectorAll('.industries-tabs__head-item');
7+
const tabBodies = tabs.querySelectorAll('.industries-tabs__body-item');
8+
9+
tabHeads.forEach((head, index) => {
10+
head.addEventListener('click', () => {
11+
// Remove active class from all
12+
tabHeads.forEach((h) => h.classList.remove('active'));
13+
tabBodies.forEach((b) => b.classList.remove('active'));
14+
15+
// Add active class to clicked head & corresponding body
16+
head.classList.add('active');
17+
tabBodies[index].classList.add('active');
18+
});
19+
});
20+
});
21+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import Typewriter from 'typewriter-effect/dist/core';
2+
3+
export const typedAnimation = () => {
4+
const container = document.querySelector('.typed');
5+
const stringsContainer = document.querySelectorAll('.typed-strings p');
6+
7+
if (container && stringsContainer.length) {
8+
const stringsArray = Array.from(stringsContainer).map((el) =>
9+
el.textContent.trim(),
10+
);
11+
12+
const typewriter = new Typewriter(container, {
13+
loop: true,
14+
delay: 95, // typing speed
15+
deleteSpeed: 65, // deleting speed
16+
});
17+
18+
stringsArray.forEach((text) => {
19+
typewriter
20+
.typeString(text)
21+
.pauseFor(500) // no pause after typing
22+
.deleteAll();
23+
});
24+
25+
typewriter.start();
26+
}
27+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {industriesTabs} from './components/industries-tabs';
2+
import {codeTabs} from './components/code-tabs';
3+
import {typedAnimation} from './components/typed-animation';
4+
5+
document.addEventListener('DOMContentLoaded', () => {
6+
industriesTabs();
7+
codeTabs();
8+
typedAnimation();
9+
});
10+
11+
document$.subscribe(function () {
12+
industriesTabs();
13+
codeTabs();
14+
typedAnimation();
15+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:root {
2+
--color-red: #CA463A;
3+
--color-red-hover: #EA5547;
4+
--color-white: #fff;
5+
--color-dark: #1C1C1C;
6+
--color-light-blue: #E2ECF3;
7+
--color-violet: #7142FF;
8+
9+
--font-inter: 'Inter', sans-serif;
10+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
.btn {
2+
font-family: var(--font-inter);
3+
font-style: normal;
4+
font-weight: 600;
5+
font-size: 16px;
6+
justify-content: center;
7+
align-items: center;
8+
display: inline-flex;
9+
padding-left: 24px;
10+
padding-right: 24px;
11+
height: 44px;
12+
min-width: 130px;
13+
border-radius: 12px;
14+
transition: 0.3s all ease;
15+
gap: 4px;
16+
17+
.icon {
18+
transition: 0.3s all ease;
19+
color: var(--color-red);
20+
--size: 19px;
21+
width: var(--size);
22+
min-width: var(--size);
23+
height: var(--size);
24+
display: flex;
25+
justify-content: center;
26+
align-items: center;
27+
svg,img {
28+
width: 100%;
29+
height: 100%;
30+
max-height: 11.5px;
31+
display: block;
32+
object-fit: contain;
33+
path {
34+
transition: 0.3s all ease;
35+
stroke: currentColor;
36+
}
37+
}
38+
39+
&.icon-lg{
40+
svg,img{
41+
max-height: 20px;
42+
}
43+
}
44+
}
45+
}
46+
47+
.btn-black {
48+
color: #FFFFFF;
49+
background-color: #000000;
50+
51+
&:hover {
52+
background-color: var(--color-red);
53+
}
54+
}
55+
56+
.btn-rd, .btn-red {
57+
color: #FFFFFF;
58+
background-color: var(--color-red);
59+
60+
&:hover {
61+
background-color: var(--color-red-hover);
62+
}
63+
}
64+
65+
.btn-link {
66+
display: inline-flex;
67+
align-items: center;
68+
justify-content: flex-start;
69+
gap: 4px;
70+
min-height: 35px;
71+
72+
.caption {
73+
font-family: var(--font-inter);
74+
font-style: normal;
75+
font-weight: 500;
76+
font-size: 14px;
77+
color: var(--color-red);
78+
transition: 0.3s all ease;
79+
}
80+
81+
.icon {
82+
transition: 0.3s all ease;
83+
color: var(--color-red);
84+
--size: 19px;
85+
width: var(--size);
86+
min-width: var(--size);
87+
height: var(--size);
88+
display: flex;
89+
justify-content: center;
90+
align-items: center;
91+
92+
svg {
93+
width: 100%;
94+
height: 100%;
95+
display: block;
96+
object-fit: contain;
97+
98+
path {
99+
transition: 0.3s all ease;
100+
stroke: currentColor;
101+
}
102+
}
103+
}
104+
105+
&:hover {
106+
.caption {
107+
color: var(--color-red-hover);
108+
}
109+
110+
.icon {
111+
color: var(--color-red-hover);
112+
transform: translateX(5px);
113+
}
114+
}
115+
}
116+
117+
.btn-light-red {
118+
background: rgba(202, 70, 58, 0.1);
119+
border: 1px solid rgba(202, 70, 58, 0.32);
120+
color: var(--color-red);
121+
122+
&:hover {
123+
background: rgba(202, 70, 58, 0.15);
124+
}
125+
}

0 commit comments

Comments
 (0)