Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add glossary #529

Merged
merged 50 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
9dfb213
feat: update navigation
abtx Aug 7, 2023
52463aa
feat: update navigation / mobile
abtx Aug 7, 2023
4254eca
feat: optimize mobile
abtx Aug 8, 2023
a57ede3
design: make nav dropdown wider
abtx Aug 8, 2023
071503f
chore: change Glossary name and order
abtx Aug 8, 2023
3037924
feat: add glossary page
abtx Aug 8, 2023
e97acee
feat: add glossaryTerms.json
abtx Aug 8, 2023
479bcb3
feat: add page header and search input styling
abtx Aug 8, 2023
2140a2b
feat: add fuzzy search functionality
abtx Aug 8, 2023
5a2e3b0
feat: add GlossaryTerm card
abtx Aug 8, 2023
7efd996
feat: sort alphabetically
abtx Aug 8, 2023
d1e1a8d
feat: improve styling
abtx Aug 8, 2023
62746bd
feat: add search params
abtx Aug 8, 2023
2d5cc25
feat: add finops glossary page
abtx Aug 9, 2023
ff3c12c
feat: add BackButton to GlossaryPage
abtx Aug 9, 2023
4a4181b
feat: desing enhancements
abtx Aug 9, 2023
e4fe64c
enhance: use slug in place of href
abtx Aug 9, 2023
a94ffe5
enhance: search input design
abtx Aug 10, 2023
7010154
fix: exclude DocSearch-Input in components.css
abtx Aug 10, 2023
7474121
enhance: add Kbd in search input
abtx Aug 10, 2023
90ac81d
enhance: make search input wide on smaller res
abtx Aug 10, 2023
90c93c6
fix: safari drowdown button margin
abtx Aug 10, 2023
e2e52ce
enhance: add book icon to definition
abtx Aug 10, 2023
e41dd40
enhance: make term link text explicit
abtx Aug 10, 2023
9cdee1e
seo: add better page descriptions
abtx Aug 10, 2023
5c5e433
enhance: make term page white bg
abtx Aug 10, 2023
43adc81
enhance: make search page white bg
abtx Aug 10, 2023
91b2c7c
fix: hover triggers
abtx Aug 10, 2023
16204fc
enahnce: no results design
abtx Aug 10, 2023
fffee25
enhance: add hover over to nav dropdown
abtx Aug 10, 2023
fd9bf0b
enhance: animations
abtx Aug 11, 2023
b4a799e
fix: naming
abtx Aug 11, 2023
003c0e6
fix: h3
abtx Aug 11, 2023
9bd228f
feat: add cta
abtx Aug 11, 2023
aba22f2
fix: formatting
abtx Aug 11, 2023
0b4fab9
chore: improve alignment
abtx Aug 21, 2023
ba695ca
chore: add content
abtx Aug 21, 2023
d7581f1
chore: add react-markdown
abtx Aug 22, 2023
0575ad2
chore: improve styling
abtx Aug 22, 2023
d6fdbca
chore: add images
abtx Aug 22, 2023
0c6f0ee
Fixing up some text
hassankhosseini Aug 23, 2023
aa0feb3
chore: add images
abtx Aug 23, 2023
bac2d2e
fix: bad rebase
abtx Aug 23, 2023
830f6e5
fix: typos
abtx Aug 23, 2023
7c64999
chore: use flex-start instead of start
abtx Aug 23, 2023
fc22278
fix: build and refactor pages
abtx Aug 23, 2023
5aff2e2
design: cta copy size
abtx Aug 23, 2023
246398b
Apply suggestions from code review
abtx Aug 24, 2023
b3b2bec
chore: formatting
abtx Aug 24, 2023
ef15eb0
chore: add terraform logo
abtx Aug 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,633 changes: 1,630 additions & 3 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@
"@docusaurus/preset-classic": "2.2.0",
"@docusaurus/theme-classic": "2.2.0",
"@docusaurus/theme-common": "2.2.0",
"@headlessui/react": "^1.7.16",
"@mdx-js/react": "^1.6.17",
"@react-spring/parallax": "^9.7.3",
"@react-spring/web": "^9.7.3",
"clsx": "^1.1.1",
"docusaurus-plugin-plausible": "0.0.5",
"dotenv": "^16.3.1",
"fuse.js": "^6.6.2",
"prettier": "^2.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-helmet-async": "^1.3.0",
"react-markdown": "^8.0.7",
"remark-external-links": "^8.0.0"
},
"browserslist": {
Expand Down
11 changes: 11 additions & 0 deletions src/components/BackButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ArrowIcon from './icons/ArrowIcon';

const BackButton = ({ toPath, toText }) => (
<a href={toPath} className="back-button" rel="noopener noreferrer">
<ArrowIcon />
Back to {toText}
</a>
);

export default BackButton;
33 changes: 33 additions & 0 deletions src/components/GlossaryPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';
import PageLayout from '../PageLayout';
import GlossaryTermPageIntro from '../GlossaryTermPage/GlossaryTermPageIntro';
import GlossaryTermPage from '../GlossaryTermPage';
import terms from '../GlossarySearch/glossaryTerms.json';
import GlossaryTermPageAside from '../GlossaryTermPage/GlossaryTermPageAside';
import GlossaryTermPageContent from '../GlossaryTermPage/GlossaryTermPageContent';

const Term = ({ slug }: { slug: string }) => {
const term = terms.filter((term) => term.slug === slug)[0];
abtx marked this conversation as resolved.
Show resolved Hide resolved

if (!term) {
return null;
}

return (
<PageLayout
title={`${term.termTitle} - Infracost Glossary`}
description={term.pageTitle}
pageClass="glossary-term__page"
hideCTA={true}
noIndex={false}
>
<GlossaryTermPageIntro title={term.pageTitle} toPath="/glossary" toText="FinOps Glossary" />
<GlossaryTermPage>
<GlossaryTermPageContent term={term} />
<GlossaryTermPageAside term={term} />
</GlossaryTermPage>
</PageLayout>
);
};

export default Term;
72 changes: 72 additions & 0 deletions src/components/GlossarySearch/GlossaryCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/* GLOSSARY TERM CARD */

.glossary-term__card {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: .5rem;
padding: 1rem 1.5rem;
border: 1px solid var(--border-color);
border-radius: 8px;
transition: all 0.2s ease-in-out;
border: 1px solid var(--border-light);
}


.glossary-term__card-title {
font-size: 1.5rem;
margin-bottom: .5rem;
font-weight: bold;
display: flex;
gap: 0.5rem;
align-items: baseline;
}

/* Hover animations */
.glossary-term__card-title,
.glossary-term__card-description,
.glossary-term__card-link .arrow-icon {
transition: all 0.2s ease-in-out;
}

.glossary-term__card:hover {
background-color: #fafafa;
transform: translateY(-.25rem) scale(1.02);
}


.glossary-term__card:hover .glossary-term__card-description {
background-position: -100% 0;
}

.glossary-term__card-description {
background-size: 200%;
background-position: 0 0;
display: inline;
transition: .2s ease-in;

}

/* link */

.glossary-term__card-link {
font-size: 1rem;
margin-bottom: 0;
display: flex;
align-items: center;
gap: 0.325rem;
width: fit-content;
}

.glossary-term__card-link:hover .arrow-icon {
animation: slideRight 0.5s ease-in-out;
}

@keyframes slideRight {
50% {
transform: translateX(5px);
}
100% {
transform: translateX(0);
}
}
abtx marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 28 additions & 0 deletions src/components/GlossarySearch/GlossaryCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { GlossaryTermType } from './index';
import './GlossaryCard.css';
import ArrowIcon from '../icons/ArrowIcon';

const GlossaryTerm = ({ term }: { term: GlossaryTermType }) => (
<div className="glossary-term__card">
<div>
<div className="glossary-term__card-header">
<h2 className="glossary-term__card-title">{term.termTitle}</h2>
</div>

<div className="glossary-term__card-description">{term.definition}</div>
</div>

{term.slug && (
<a
href={`/glossary/${term.slug}`}
className="glossary-term__card-link"
rel="noopener noreferrer"
>
More about {term.termTitle}
<ArrowIcon />
</a>
)}
</div>
);
export default GlossaryTerm;
84 changes: 84 additions & 0 deletions src/components/GlossarySearch/GlossarySearch.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* FINOPS GLOSSARY SEARCH PAGE */

/* Intro */
.glossary-search__intro-container {
display: flex;
flex-direction: column;
gap: 2rem;
justify-content: center;
}

.glossary-search__intro-container .tagline {
display: flex;
gap: .5rem;
align-items: center;
}

/* Content */
.glossary-search__content-wrapper {
padding: 4rem 1.5rem;
}

.glossary-search__content-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
grid-gap: 1rem;
}

/* Glossary search */

.finops-glossary__search {
position: relative;
border-radius: 3rem;
padding: 2px;
width: 50%;
margin: 0 auto;
}

input.glossary-search__input {
width: 100%;
padding: 1.5rem 2rem 1.5rem 4rem;
background-color: #2a2a5b;
border-radius: 3rem;
}

.finops-glossary__search > .search-icon {
position: absolute;
top: 50%;
left: 2rem;
transform: translateY(-50%);
}

/* Search clear */
.glossary-search__clear-button {
position: absolute;
top: 50%;
right: 2rem;
display: flex;
align-items: center;
gap: 0.5rem;
transform: translateY(-50%);
background-color: #1e1e48;
}

/* Hide the html5 button */
.intro input[type="search"]::-webkit-search-decoration,
.intro input[type="search"]::-webkit-search-cancel-button,
.intro input[type="search"]::-webkit-search-results-button,
.intro input[type="search"]::-webkit-search-results-decoration {
-webkit-appearance:none;
}

/* Search no results */
.finops-glossary__search-no-results {
padding: 1.5rem;
background-color: var(--nu10);
border: 1px solid var(--border-light);
border-radius: 8px;
}

@media screen and (max-width: 1080px) {
.finops-glossary__search {
width: 100%;
}
}
Loading