Skip to content

Commit

Permalink
feat: add intersection observer + latest articles
Browse files Browse the repository at this point in the history
  • Loading branch information
fbuireu committed Dec 20, 2023
1 parent ecc20f1 commit 480e405
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 154 deletions.
57 changes: 29 additions & 28 deletions src/content/articles/markdown-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ within a `footer` or `cite` element, and optionally with in-line changes such as
> Don't communicate by sharing memory, share memory by communicating.<br> — <cite>Rob Pike[^1]</cite>
[^1]:

The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest,
November 18, 2015.

Expand All @@ -97,7 +98,7 @@ November 18, 2015.
#### Output

| Italics | Bold | Code |
|-----------|----------|--------|
| --------- | -------- | ------ |
| _italics_ | **bold** | `code` |

## Code Blocks
Expand Down Expand Up @@ -128,13 +129,13 @@ Output
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
<head>
<meta charset="utf-8" />
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```

Expand All @@ -161,40 +162,40 @@ Output
#### Syntax

```markdown
- List item
- Another item
- And another item
- List item
- Another item
- And another item
```

#### Output

- List item
- Another item
- And another item
- List item
- Another item
- And another item

### Nested list

#### Syntax

```markdown
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
```

#### Output

- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese

## Other Elements — abbr, sub, sup, kbd, mark

Expand Down
8 changes: 2 additions & 6 deletions src/content/articles/using-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ If you have existing content authored in MDX, this integration will hopefully ma
Here is how you import and use a UI component inside of MDX.
When you open this page in the browser, you should see the clickable button below.





import HeaderLink from '../../ui/components/atoms/headerLink/HeaderLink.astro';

<HeaderLink href="#" onclick="alert('clicked!')">
Expand All @@ -38,5 +34,5 @@ import HeaderLink from '../../ui/components/atoms/headerLink/HeaderLink.astro';
- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx)
- [Astro Usage Documentation](https://docs.astro.build/en/guides/markdown-content/#markdown-and-mdx-pages)
- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are
still required to create interactive components. Otherwise, all components in your MDX will render as static HTML
(no JavaScript) by default.
still required to create interactive components. Otherwise, all components in your MDX will render as static HTML
(no JavaScript) by default.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@layer testimonials.testimonial.author {
.testimonial__author {
font-size: 1.25rem;
grid-area: Testimonial-Author;
isolation: isolate;
text-transform: uppercase;
transition-duration: 450ms;
transition-property: translate;
transition-timing-function: ease-in;
}
.testimonial__author {
font-size: 1.25rem;
grid-area: Testimonial-Author;
isolation: isolate;
text-transform: uppercase;
transition-duration: 450ms;
transition-property: translate;
transition-timing-function: ease-in;
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@layer testimonials.testimonial.description {
.testimonial__description {
color: var(--neutral-light-2);
grid-area: Testimonial-Description;
isolation: isolate;
transition-duration: 350ms;
transition-property: translate;
transition-timing-function: ease-in;
}
.testimonial__description {
color: var(--neutral-light-2);
grid-area: Testimonial-Description;
isolation: isolate;
transition-duration: 350ms;
transition-property: translate;
transition-timing-function: ease-in;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@layer testimonials.testimonial.image {
.testimonial__image {
grid-area: Testimonial-Image;
isolation: isolate;
}
.testimonial__image {
grid-area: Testimonial-Image;
isolation: isolate;
}
}
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
@layer testimonials.testimonial.quote {
.testimonial__quote__wrapper {
display: grid;
gap: 1rem 0;
grid:
'Testimonial-Quotation Testimonial-Quotation' min-content
'Testimonial-Quote Testimonial-Quote' min-content
/ 1fr;
grid-area: Testimonial-Quote;
isolation: isolate;
padding-inline-end: 1rem;
}
.testimonial__quote__wrapper {
display: grid;
gap: 1rem 0;
grid:
'Testimonial-Quotation Testimonial-Quotation' min-content
'Testimonial-Quote Testimonial-Quote' min-content
/ 1fr;
grid-area: Testimonial-Quote;
isolation: isolate;
padding-inline-end: 1rem;
}

.testimonial__quote {
grid-area: Testimonial-Quote;
transition-duration: 350ms;
transition-property: translate;
transition-timing-function: ease-in;
.testimonial__quote {
grid-area: Testimonial-Quote;
transition-duration: 350ms;
transition-property: translate;
transition-timing-function: ease-in;

@supports (text-wrap: pretty) {
text-wrap: pretty;
}
@supports (text-wrap: pretty) {
text-wrap: pretty;
}

@supports not (text-wrap: pretty) {
text-wrap: balance;
@supports not (text-wrap: pretty) {
text-wrap: balance;
}
}
}

.testimonial__quote-symbol {
grid-area: Testimonial-Quotation;
height: 4rem;
transition: opacity 200ms linear 400ms;
width: 4rem;
}
.testimonial__quote-symbol {
grid-area: Testimonial-Quotation;
height: 4rem;
transition: opacity 200ms linear 400ms;
width: 4rem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import 'src/ui/components/molecules/testimonial/components/testimonialQuote/test
import doubleQuote from '@assets/images/svg/double-quote.svg';

export interface TestimonialQuoteProps {
children: ReactNode;
children: ReactNode;
}

export const TestimonialQuote: FC<TestimonialQuoteProps> = ({ children }) => (
<div className="testimonial__quote__wrapper">
<img className="testimonial__quote-symbol" src={doubleQuote.src} alt={'Quote'} />
<blockquote className="testimonial__quote">{children}</blockquote>
</div>
<div className="testimonial__quote__wrapper">
<img className="testimonial__quote-symbol" src={doubleQuote.src} alt={'Quote'} />
<blockquote className="testimonial__quote">{children}</blockquote>
</div>
);
52 changes: 26 additions & 26 deletions src/ui/components/molecules/testimonial/testimonial.css
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
@layer testimonials.testimonial {
.testimonial__content {
background-color: var(--white);
cursor: grab;
display: grid;
gap: 0 1rem;
grid:
'Testimonial-Image Testimonial-Image . . ' 1rem
'Testimonial-Image Testimonial-Image Testimonial-Quote Testimonial-Quote' min-content
'Testimonial-Image Testimonial-Image Testimonial-Quote Testimonial-Quote' calc(100% - 7rem)
'Testimonial-Image Testimonial-Image Testimonial-Author Testimonial-Author' 1.5rem
'Testimonial-Image Testimonial-Image Testimonial-Description Testimonial-Description' min-content
/ calc(100% / 4) calc(100% / 4) 1fr 1fr;
width: 100%;
.testimonial__content {
background-color: var(--white);
cursor: grab;
display: grid;
gap: 0 1rem;
grid:
'Testimonial-Image Testimonial-Image . . ' 1rem
'Testimonial-Image Testimonial-Image Testimonial-Quote Testimonial-Quote' min-content
'Testimonial-Image Testimonial-Image Testimonial-Quote Testimonial-Quote' calc(100% - 7rem)
'Testimonial-Image Testimonial-Image Testimonial-Author Testimonial-Author' 1.5rem
'Testimonial-Image Testimonial-Image Testimonial-Description Testimonial-Description' min-content
/ calc(100% / 4) calc(100% / 4) 1fr 1fr;
width: 100%;

&:not(.--is-active) {
opacity: 0.25;
&:not(.--is-active) {
opacity: 0.25;
}
}
}

.swiper-slide-prev {
.testimonial__content {
grid:
'. . Testimonial-Image Testimonial-Image ' 1rem
'Testimonial-Quote Testimonial-Quote Testimonial-Image Testimonial-Image' min-content
'Testimonial-Quote Testimonial-Quote Testimonial-Image Testimonial-Image' calc(100% - 7rem)
'Testimonial-Author Testimonial-Author Testimonial-Image Testimonial-Image' 1.5rem
'Testimonial-Description Testimonial-Description Testimonial-Image Testimonial-Image' min-content
/ 1fr 1fr calc(100% / 4) calc(100% / 4);
.swiper-slide-prev {
.testimonial__content {
grid:
'. . Testimonial-Image Testimonial-Image ' 1rem
'Testimonial-Quote Testimonial-Quote Testimonial-Image Testimonial-Image' min-content
'Testimonial-Quote Testimonial-Quote Testimonial-Image Testimonial-Image' calc(100% - 7rem)
'Testimonial-Author Testimonial-Author Testimonial-Image Testimonial-Image' 1.5rem
'Testimonial-Description Testimonial-Description Testimonial-Image Testimonial-Image' min-content
/ 1fr 1fr calc(100% / 4) calc(100% / 4);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
@layer testimonials.navigation {
.testimonials__navigation {
gap: 0 1rem;
position: absolute;
right: 0;
z-index: 10;
.testimonials__navigation {
gap: 0 1rem;
position: absolute;
right: 0;
z-index: 10;

img {
width: 3rem;
img {
width: 3rem;
}
}
}

.testimonials__navigation__button {
cursor: pointer;
.testimonials__navigation__button {
cursor: pointer;

&.--right {
rotate: 180deg;
&.--right {
rotate: 180deg;
}
}
}
}
36 changes: 9 additions & 27 deletions tsconfig.paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,15 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@ui/*": [
"./src/ui/*"
],
"@components/*": [
"./src/ui/components/*"
],
"@utils/*": [
"./src/utils/*"
],
"@assets/*": [
"./src/ui/assets/*"
],
"@styles/*": [
"./src/ui/styles/*"
],
"@articles/*": [
"./src/content//*"
],
"@i18n/*": [
"./src/i18n/*"
],
"@mocks/*": [
"./src/mocks/*"
],
"@types/*": [
"./src/types/*"
]
"@ui/*": ["./src/ui/*"],
"@components/*": ["./src/ui/components/*"],
"@utils/*": ["./src/utils/*"],
"@assets/*": ["./src/ui/assets/*"],
"@styles/*": ["./src/ui/styles/*"],
"@articles/*": ["./src/content//*"],
"@i18n/*": ["./src/i18n/*"],
"@mocks/*": ["./src/mocks/*"],
"@types/*": ["./src/types/*"]
}
}
}

0 comments on commit 480e405

Please sign in to comment.