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

Commit 85b2fba

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 41e6478 + 71b23a8 commit 85b2fba

Some content is hidden

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

60 files changed

+2005
-131
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: 🐛 Bug report about: Create a report to help us improve AgileTs title: ''
3+
labels: 'Type: Bug' assignees: ''
4+
5+
---
6+
7+
## 🐛 Bug report
8+
9+
### 🤖 Current Behavior
10+
11+
<!-- Explain your problem (with screenshots, videos, text) in detail -->
12+
13+
### 🎯 Expected behavior
14+
15+
<!-- A clear and concise description of what you expected to happen. -->
16+
17+
### 💡 Suggested solution(s)
18+
19+
<!-- How could we solve this bug? What changes would need to made to AgileTs? -->
20+
21+
### ➕ Additional notes
22+
23+
<!-- Add any other context about the problem here. -->
24+
25+
### 💻 Your environment
26+
27+
<!-- PLEASE FILL THIS OUT -->
28+
29+
| Software | Name | Version |
30+
| ----------------------| ---------- | ---------- |
31+
| Browser (Chrome, ..) | | |
32+
| System(macOS, ..) | | |
33+
34+
<!-- Any additional important Version Notes? -->

.github/ISSUE_TEMPLATE/custom.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: 🔨 Custom issue template about: Describe this issue template's purpose here. title: ''
3+
labels: ''
4+
assignees: ''
5+
6+
---
7+
8+
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: 🆕 Feature request about: Suggest an idea for this project title: ''
3+
labels: 'Type: Enhancement' assignees: ''
4+
5+
---
6+
7+
## 🆕 Feature Request
8+
9+
### ❓ Is your feature request related to a problem?
10+
11+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
12+
13+
### 📄 Describe the solution you'd like
14+
15+
<!-- A clear and concise description of what you want to happen. -->
16+
17+
### 📃 Describe alternatives you've considered
18+
19+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
20+
21+
### ➕ Additional Notes
22+
23+
<!-- Add any other context or screenshots about the feature request here. -->

.github/PULL_REQUEST_TEMPLATE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!--- Please provide a general summary of your changes in the title above -->
2+
3+
## 📄 Description
4+
5+
<!--- Please describe all your changes in detail -->
6+
7+
## 🔴 Related Issue
8+
9+
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
10+
<!--- Please provide a link to the issue here -->
11+
12+
## 📃 Context
13+
14+
<!--- Why is this change required/wanted? What problem does it solve? -->
15+
<!--- If this fixes an open issue, please provide a link to the issue here. -->
16+
17+
## 🛠 How Has This Been Tested?
18+
19+
<!--- Please describe in detail how you tested your changes. -->
20+
<!--- Include information about your testing environment, and the tests you ran to -->
21+
<!--- see how your change might have affects other areas of the code, etc. -->

.github/static/landing.png

109 KB
Loading

.github/workflows/test-website.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test Website
2+
on:
3+
pull_request:
4+
branches: [ "*" ]
5+
types: [ "opened", "reopened" ]
6+
7+
jobs:
8+
publish:
9+
name: Test Website
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
# Checkout Project
14+
- name: 📚 Checkout
15+
uses: actions/checkout@v2
16+
17+
# Setup NodeJS
18+
- name: 🟢 Setup Node ${{ matrix.node_version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12
22+
23+
# Install Dependencies
24+
- name: ⏳ Install
25+
run: yarn install
26+
27+
# Run Tests
28+
- name: 🤔 Test
29+
run: yarn test
30+
31+
# Run Linter
32+
- name: 🤖 Lint
33+
run: yarn run lint
34+
35+
# Build Packages for Testing
36+
- name: 🔨 Build Packages
37+
run: yarn run build

README.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
# Website
2-
3-
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
1+
# agile-ts.org
2+
3+
<div align="center">
4+
<a href="https://agile-ts.org">
5+
<img src=".github/static/landing.png"/>
6+
</a>
7+
</div>
8+
9+
[This website](https://agile-ts.org) is built using
10+
[Docusaurus 2](https://v2.docusaurus.io/). Pages & components are written in TypeScript, the styles in vanilla CSS with
11+
variables using
12+
[CSS Modules](https://github.com/css-modules/css-modules).
13+
(We would have preferred using [styled-components](https://styled-components.com/) but docusaurus has no ssr support for
14+
it yet)
415

516
## Installation
617

docusaurus.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const config = {
4949
projectName: 'agilets',
5050
themes: ['@docusaurus/theme-live-codeblock'],
5151
plugins: [
52-
'docusaurus-plugin-sass' /* @docusaurus/plugin-google-analytics (Not necessary because it automatically gets added) */,
52+
'docusaurus-plugin-sass',
53+
// @docusaurus/plugin-google-analytics (Not necessary because it automatically gets added)
5354
],
5455
customFields: { ...customFields },
5556
themeConfig: {

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
"docusaurus": "docusaurus",
77
"start": "docusaurus start",
88
"build": "docusaurus build",
9+
"build:serve": "yarn run build && yarn run serve",
910
"swizzle": "docusaurus swizzle",
1011
"deploy": "docusaurus deploy",
1112
"serve": "docusaurus serve",
12-
"buildserve": "yarn run build && yarn run serve",
13+
"test": "jest --passWithNoTests",
1314
"install-docusaurus": "yalc add @docusaurus/core & yarn install",
1415
"prettier": "prettier --config .prettierrc --write \"**/*.{js,ts}\"",
1516
"lint": "eslint --cache \"**/*.{js,jsx,ts,tsx}\"",
@@ -43,11 +44,15 @@
4344
"@types/react-helmet": "^6.1.0",
4445
"@types/react-router-dom": "^5.1.6",
4546
"@types/styled-components": "^5.1.0",
47+
"@types/jest": "^26.0.15",
48+
"@typescript-eslint/eslint-plugin": "^4.12.0",
49+
"@typescript-eslint/parser": "^4.12.0",
4650
"eslint": "^7.17.0",
4751
"eslint-config-node": "^4.1.0",
4852
"eslint-config-prettier": "^6.11.0",
4953
"eslint-plugin-node": "^11.1.0",
5054
"eslint-plugin-prettier": "^3.3.1",
55+
"jest": "^26.6.3",
5156
"prettier": "2.1.2",
5257
"ts-node": "^8.10.2",
5358
"typescript": "^4.1.5"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import { animated, useSpring } from 'react-spring';
2+
import React, { useEffect, useRef, useState } from 'react';
3+
import { useAgile } from '@agile-ts/react';
4+
import core from '../../../../../../core';
5+
import styles from './styles.module.css';
6+
import clsx from 'clsx';
7+
8+
type Props = { className?: string };
9+
10+
const Astronaut: React.FC<Props> = (props) => {
11+
const { className } = props;
12+
const [timing] = useState(200);
13+
const [isRaised, setIsRaised] = React.useState(false);
14+
const animated_Astronaut = useSpring({
15+
transform: isRaised ? `translateY(-${30}px)` : `translateY(0px)`,
16+
config: {
17+
mass: 1,
18+
tension: 400,
19+
friction: 15,
20+
},
21+
});
22+
const dark = useAgile(core.ui.ASTRONAUT_DARK);
23+
24+
useEffect(() => {
25+
if (!isRaised) {
26+
return;
27+
}
28+
29+
const timeoutId = setTimeout(() => {
30+
core.ui.toggleAstronautColor(!dark);
31+
setIsRaised(false);
32+
}, timing);
33+
34+
return () => clearTimeout(timeoutId);
35+
}, [isRaised, timing]);
36+
37+
const imageRef = useRef<HTMLImageElement>(null);
38+
const ctx = document.createElement('canvas').getContext('2d');
39+
40+
// https://medium.com/@pdx.lucasm/canvas-with-react-js-32e133c05258
41+
// https://stackoverflow.com/questions/38487569/click-through-png-image-only-if-clicked-coordinate-is-transparent
42+
function trigger(event: React.MouseEvent<HTMLImageElement, MouseEvent>) {
43+
console.log('on click');
44+
45+
console.log(event);
46+
console.log(ctx);
47+
48+
// Get click coordinates
49+
const x = event.pageX - imageRef.current.offsetLeft;
50+
const y = event.pageY - imageRef.current.offsetTop;
51+
const w = (ctx.canvas.width = imageRef.current.width);
52+
const h = (ctx.canvas.height = imageRef.current.height);
53+
54+
// Draw image to canvas
55+
// and read Alpha channel value
56+
ctx.drawImage(imageRef.current, 0, 0, w, h);
57+
const alpha = ctx.getImageData(x, y, 1, 1).data[3]; // [0]R [1]G [2]B [3]A
58+
59+
console.log(ctx.getImageData(x, y, 1, 1));
60+
61+
// If pixel is transparent,
62+
// retrieve the element underneath and trigger it's click event
63+
if (alpha === 0) {
64+
console.log('alpha0');
65+
imageRef.current.style.pointerEvents = 'none';
66+
const element = document.elementFromPoint(event.clientX, event.clientY);
67+
// element.trigger('click');
68+
imageRef.current.style.pointerEvents = 'auto';
69+
} else {
70+
setIsRaised(true);
71+
console.log('LOGO clicked!');
72+
}
73+
}
74+
75+
return (
76+
<div className={clsx(styles.Container, className)}>
77+
<animated.img
78+
ref={imageRef}
79+
onMouseEnter={trigger}
80+
style={animated_Astronaut}
81+
className={styles.Image}
82+
src={`img/astronaut-${dark ? 'dark' : 'light'}.svg`}
83+
alt={'Astronaut'}
84+
/>
85+
<div className={styles.Text}>Poke me 👆 to mutate my color State.</div>
86+
</div>
87+
);
88+
};
89+
90+
export default Astronaut;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.Container {
2+
display: flex;
3+
flex-direction: column;
4+
align-items: flex-end;
5+
}
6+
7+
.Text {
8+
color: var(--ifm-color-on-background-2);
9+
margin-top: 30px;
10+
align-self: center;
11+
}
12+
13+
.Image {
14+
width: 100%;
15+
max-width: 800px;
16+
background-color: red;
17+
}

src/pages/LandingPage/components/HeaderView/index.tsx renamed to src/_pages/LandingPage/components/HeaderView/index.tsx

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import React, { useState } from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
3-
import HeaderTyper from '../../../../components/other/HeaderTyper';
3+
import HeaderTyper from './components/HeaderTyper';
44
import Spacer from '../../../../components/other/Spacer';
55
import PrimaryButton from '../../../../components/buttons/PrimaryButton';
66
import GithubButton from '../../../../components/buttons/GithubButton';
77
import styles from './styles.module.css';
88
import { useWindowSize } from '../../../../hooks/useWindowSize';
9-
import MouseScroller from '../../../../components/other/MouseScroller';
9+
import MouseScroller from './components/MouseScroller';
10+
import { animated, useSpring } from 'react-spring';
11+
import Astronaut from './components/Astronaut';
1012

1113
const HeaderView: React.FC = () => {
1214
const { siteConfig } = useDocusaurusContext();
@@ -52,11 +54,7 @@ const HeaderView: React.FC = () => {
5254
/>
5355
</div>
5456
</div>
55-
<img
56-
className={styles.AstronautImage}
57-
src={'img/astronaut-light.svg'}
58-
alt={'Astronaut'}
59-
/>
57+
<Astronaut className={styles.AstronautImage} />
6058
{windowHeight > 850 && windowHeight < 1200 && <MouseScroller />}
6159
</div>
6260
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react';
2+
3+
export interface CardInterface {
4+
title: string;
5+
description: string;
6+
imagePath: string;
7+
}
8+
9+
export type Props = { cards: CardInterface[]; startIndex?: number };
10+
11+
const Cards: React.FC<CardInterface> = (props) => {
12+
return (
13+
<div>
14+
<div>much todo</div>
15+
</div>
16+
);
17+
};
18+
19+
export default Cards;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import styles from './styles.module.css';
3+
import Spacer from '../../../../components/other/Spacer';
4+
5+
const OtherFeaturesView: React.FC = () => {
6+
return (
7+
<div className={styles.Container}>
8+
<Spacer height={30} />
9+
<div>todo</div>
10+
</div>
11+
);
12+
};
13+
14+
export default OtherFeaturesView;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.Container {
2+
display: flex;
3+
flex-direction: column;
4+
align-items: center;
5+
width: 95%;
6+
max-width: var(--ifm-container-width);
7+
margin: 0 auto;
8+
padding: 8rem 0;
9+
}

0 commit comments

Comments
 (0)