Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Commit bdd05e6

Browse files
authored
Merge pull request #42 from agile-ts/newdessign
Newdessign
2 parents 9d8dbc1 + a724199 commit bdd05e6

File tree

16 files changed

+225
-122
lines changed

16 files changed

+225
-122
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from 'react';
2+
import { FiChevronRight } from 'react-icons/all';
3+
import { useHistory } from 'react-router-dom';
4+
import styles from './styles.module.css';
5+
import clsx from 'clsx';
6+
7+
export type Props = { to: string; className?: string; name: string };
8+
9+
const PlainButton: React.FC<Props> = (props) => {
10+
const { to, className, name } = props;
11+
const history = useHistory();
12+
13+
return (
14+
<button
15+
className={clsx(styles.ButtonContainer, className)}
16+
onClick={() => {
17+
if (to.startsWith('http')) {
18+
window.open(to, '_blank');
19+
return;
20+
}
21+
history.push(to);
22+
}}>
23+
<div>{name}</div>
24+
<FiChevronRight size={16} className={styles.Chevron} />
25+
</button>
26+
);
27+
};
28+
29+
export default PlainButton;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.ButtonContainer {
2+
background: transparent;
3+
border: none;
4+
5+
color: var(--ifm-color-on-background-2);
6+
7+
font-size: var(--ifm-font-size-12);
8+
font-weight: bold;
9+
10+
cursor: pointer;
11+
12+
display: flex;
13+
flex-direction: row;
14+
align-items: center;
15+
justify-content: center;
16+
17+
18+
transition: 0.3s ease all;
19+
}
20+
21+
.ButtonContainer:hover {
22+
color: var(--ifm-color-on-background-3);
23+
}
24+
25+
.Chevron {
26+
margin-left: 2px;
27+
margin-top: 2px;
28+
}

src/components/buttons/PrimaryButton/styles.module.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.ButtonContainer {
22
color: var(--ifm-color-on-primary);
33
background-color: var(--ifm-color-primary);
4+
45
border-radius: 3px;
56
border: none;
67

@@ -9,9 +10,12 @@
910

1011
cursor: pointer;
1112

12-
padding: 15px 30px;
13+
display: flex;
14+
flex-direction: row;
1315
align-items: center;
1416
justify-content: center;
17+
padding: 15px 30px;
18+
box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.3);
1519

1620
transition: 0.3s ease all;
1721
}

src/components/other/MouseScroller/styles.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
transform: translateX(-50%);
44
position: absolute;
55
bottom: 40px;
6+
z-index: 1;
67
}
78

89
.Mouse {

src/components/other/SectionScroller/components/SectionLeftItem/index.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export type Props = {
1111
};
1212

1313
const SectionLeftItem: React.FC<Props> = (props) => {
14-
const { code, active, forwardRef, style } = props;
14+
const { code, active, forwardRef, style } = props;
1515

16-
return (
17-
<div
18-
style={style}
19-
ref={forwardRef}
20-
className={clsx(styles.Container, {
21-
[styles.Container_Active]: active,
22-
})}>
23-
<CodeBlock style={{ position: 'relative' }} className={'javascript'}>
24-
{code}
25-
</CodeBlock>
26-
</div>
27-
);
16+
return (
17+
<div
18+
style={style}
19+
ref={forwardRef}
20+
className={clsx(styles.Container, {
21+
[styles.Container_Active]: active,
22+
})}>
23+
<CodeBlock style={{ position: 'relative' }} className={'javascript'}>
24+
{code}
25+
</CodeBlock>
26+
</div>
27+
);
2828
};
2929

3030
export default SectionLeftItem;

src/components/other/SectionScroller/components/SectionLeftItem/styles.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.Container {
22
width: 100%;
33
position: relative;
4+
margin-left: -1px;
45
font-size: var(--ifm-font-size-16);
56
transform: translateZ(0);
67
transition: top 100ms cubic-bezier(0.17, 0.67, 0.83, 0.67);

src/components/other/SectionScroller/styles.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
overflow: hidden;
1212
font-size: var(--ifm-font-size-18);
1313
background-color: var(--ifm-color-surface);
14+
filter: drop-shadow(0px 8px 10px rgba(0, 0, 0, 0.25));
1415
}
1516

1617
.SectionInnerContainer {

src/pages/LandingPage/components/HeaderView/styles.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
margin: 0 auto;
66
max-width: var(--ifm-container-width);
7-
padding: 8rem 0 16rem 0;
7+
padding: 8rem 1rem 16rem 1rem;
88
}
99

1010
.AstronautImage {
@@ -75,7 +75,7 @@
7575

7676
@media (max-width: 768px) {
7777
.Container {
78-
padding: 8rem 1rem;
78+
padding: 8rem 1rem 10rem 1rem;
7979
}
8080

8181
.HeaderTitle {

src/pages/LandingPage/components/StraightforwardView/index.tsx

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,90 @@
11
import React from 'react';
22
import styles from './styles.module.css';
33
import Spacer from '../../../../components/other/Spacer';
4-
import SectionScroller from '../../../../components/other/SectionScroller';
5-
import { sections } from './sections';
4+
import SectionScroller, {
5+
SectionInterface,
6+
} from '../../../../components/other/SectionScroller';
7+
import { FiEdit, FiRepeat, FiServer, FiUsers, FiZap } from 'react-icons/all';
8+
import PlainButton from '../../../../components/buttons/PlainButton';
9+
10+
const sections: SectionInterface[] = [
11+
{
12+
code: `
13+
const App = new Agile();
14+
const MY_STATE = App.createState("Jeff");
15+
MY_STATE.set("Frank");
16+
`,
17+
codeWithComment: `
18+
// Create State
19+
const App = new Agile();
20+
const MY_STATE = App.createState("Jeff");
21+
MY_STATE.set("Frank");
22+
`,
23+
title: 'Create State',
24+
description:
25+
'Create an Information we need to remember at a later point in time.',
26+
icon: <FiZap />,
27+
},
28+
{
29+
code: `
30+
// MyComponent.whatever
31+
const myState = useAgile(MY_STATE);
32+
`,
33+
codeWithComment: `
34+
// Subscribe State in MyComponent.whatever
35+
const myState = useAgile(MY_STATE);
36+
`,
37+
title: 'Subscribe State',
38+
description: 'Bind any State to any Component.',
39+
icon: <FiRepeat />,
40+
},
41+
{
42+
code: `
43+
const App = new Agile();
44+
const MY_COLLECTION = App.createState();
45+
MY_COLLECTION.collect({id: 1, name: "Jeff"})
46+
`,
47+
codeWithComment: `
48+
// Create set of States
49+
const App = new Agile();
50+
const MY_COLLECTION = App.createState();
51+
MY_COLLECTION.collect({id: 1, name: "Jeff"});
52+
`,
53+
title: 'Create set of States',
54+
description: 'Create a dynamic and reactive set of States.',
55+
icon: <FiUsers />,
56+
},
57+
{
58+
code: `
59+
MY_STATE.persist();
60+
`,
61+
codeWithComment: `
62+
// Persist State
63+
MY_STATE.persist();
64+
`,
65+
title: 'Persist State',
66+
description: 'Store State permanently in any Storage.',
67+
icon: <FiServer />,
68+
},
69+
{
70+
code: `
71+
const App = new Agile();
72+
const IS_AUTH = App.createComputed(() => {
73+
return AUTH_TOKEN.exists;
74+
});
75+
`,
76+
codeWithComment: `
77+
// Compute State
78+
const App = new Agile();
79+
const IS_AUTH = App.createComputed(() => {
80+
return AUTH_TOKEN.exists;
81+
});
82+
`,
83+
title: 'Compute State',
84+
description: 'Compute State depending on other States.',
85+
icon: <FiEdit />,
86+
},
87+
];
688

789
const StraightforwardView: React.FC = () => {
890
return (
@@ -21,6 +103,11 @@ const StraightforwardView: React.FC = () => {
21103
<Spacer height={50} />
22104
<Spacer height={10} />
23105
<SectionScroller sections={sections} startIndex={1} />
106+
<PlainButton
107+
to={'docs/introduction'}
108+
name={'Find out more'}
109+
className={styles.FoundOutMoreButton}
110+
/>
24111
</div>
25112
</div>
26113
);

src/pages/LandingPage/components/StraightforwardView/sections.tsx

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)