Skip to content

Commit

Permalink
feat: website
Browse files Browse the repository at this point in the history
  • Loading branch information
congjiujiu committed Sep 1, 2022
1 parent cd72fda commit 59a4c01
Show file tree
Hide file tree
Showing 53 changed files with 1,415 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const config = {
jsx: true,
},
ecmaVersion: 2020,
project: ['tsconfig.json', 'tools/tsconfig.json', 'tsconfigs/tsconfig.eslint.json'],
project: ['tsconfig.json', 'tools/tsconfig.json', 'tsconfigs/tsconfig.eslint.json', 'docs/tsconfig.json'],
},
settings: {
react: {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
node-version: 16
cache: yarn
- name: Install dependencies
run: yarn install
run: yarn install && yarn docs install
- name: Cache lint result
uses: actions/cache@v3
with:
Expand Down
Binary file added docs/assets/pages/banner-background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/banner-bg-left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/banner-bg-right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/banner-decoration.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/bundle-baseline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/bundle-duplicate-packages.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/bundle-score.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/bundle-visualization.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/bundle.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/assets/pages/close-icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/assets/pages/github.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/assets/pages/key.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/lab-comparison.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/lab-scores.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/lab-timeline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/lab-treemap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/lab.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/assets/pages/menu-icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/assets/pages/radar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/source-flamechart.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/source-path.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/source.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/assets/pages/tips.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/pages/vscode.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/assets/pages/waterfalls.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
plugins: ['@emotion'],
}
13 changes: 11 additions & 2 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,18 @@ const config = {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/perfsee/perfsee/tree/main/docs/',
routeBasePath: '/',
routeBasePath: '/docs',
},
blog: false,
pages: {
path: 'src/pages',
routeBasePath: '/',
include: ['**/*.{js,jsx,ts,tsx,md,mdx}'],
exclude: ['**/_*.{js,jsx,ts,tsx,md,mdx}', '**/_*/**', '**/*.test.{js,jsx,ts,tsx}', '**/__tests__/**'],
rehypePlugins: [],
beforeDefaultRemarkPlugins: [],
beforeDefaultRehypePlugins: [],
},
},
],
],
Expand Down Expand Up @@ -117,7 +126,7 @@ const config = {
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Perfsee. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} Perfsee.`,
},
prism: {
theme: lightCodeTheme,
Expand Down
4 changes: 4 additions & 0 deletions docs/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.png' {
const url: string
export default url
}
2 changes: 1 addition & 1 deletion docs/i18n/cn/docusaurus-theme-classic/footer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"description": "The label of footer link with label=GitHub linking to https://github.com/perfsee/perfsee"
},
"copyright": {
"message": "Copyright © 2022 perfsee. Built with Docusaurus.",
"message": "Copyright © 2022 perfsee.",
"description": "The footer copyright"
}
}
8 changes: 7 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
},
"dependencies": {
"@docusaurus/core": "2.0.1",
"@docusaurus/plugin-content-pages": "^2.0.1",
"@docusaurus/preset-classic": "2.0.1",
"@docusaurus/theme-common": "^2.0.1",
"@easyops-cn/docusaurus-search-local": "^0.31.0",
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
Expand All @@ -26,7 +30,9 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.1",
"@tsconfig/docusaurus": "^1.0.6"
"@emotion/babel-plugin": "^11.10.0",
"@tsconfig/docusaurus": "^1.0.6",
"@typescript-eslint/parser": "^5.30.7"
},
"browserslist": {
"production": [
Expand Down
53 changes: 53 additions & 0 deletions docs/src/components/advantages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import KeySvg from '@site/assets/pages/key.svg'
import RadarSvg from '@site/assets/pages/radar.svg'
import TipsSvg from '@site/assets/pages/tips.svg'
import WaterfallSvg from '@site/assets/pages/waterfalls.svg'
import React from 'react'

import { Card, Container, IconWrap } from './styled'

export const Advantages = () => {
return (
<Container>
<Card>
<IconWrap bgColor="#e1eaff">
<RadarSvg />
</IconWrap>
<h2>In-depth details and analysis</h2>
<span>
Pioneering analyze front-end application's performance from perspectives, including packaged products,
integrated test environments, and back to source code.
</span>
</Card>
<Card>
<IconWrap bgColor="#d5f6f2">
<TipsSvg />
</IconWrap>
<h2>Lower threshold for performance analysis</h2>
<span>
Provide professional optimization advice based on multiple perspectives. Even newcomers with little experience
in performance optimization can follow the diagram.
</span>
</Card>
<Card>
<IconWrap bgColor="#d9f3fd">
<KeySvg />
</IconWrap>
<h2>Bridging the R&D process</h2>
<span>
From development to deployment, the Perfsee toolset has been permeated through the development process,
tracking performance changes between releases in real time.
</span>
</Card>
<Card>
<IconWrap bgColor="#d9f5d6">
<WaterfallSvg />
</IconWrap>
<h2>Data interfacing with RUM</h2>
<span>
Based on RUM data, gives further guidance on performance analysis and comparison with the online version.
</span>
</Card>
</Container>
)
}
51 changes: 51 additions & 0 deletions docs/src/components/advantages/styled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import styled from '@emotion/styled'

export const Container = styled.div({
margin: '60px 0 150px',
padding: '0 60px',

display: 'flex',
justifyContent: 'space-around',

'@media(max-width: 960px)': {
flexWrap: 'wrap',
},

'@media(max-width: 480px)': {
margin: '60px 0 90px',
},
})

export const Card = styled.div({
maxWidth: '320px',
minWidth: '230px',
padding: '10px',
textAlign: 'center',
marginBottom: '30px',

h2: {
fontSize: '24px',
fontWeight: 'bold',
margin: '12px 0',
},

span: {
fontSize: '14px',
},
})

export const IconWrap = styled.div<{ bgColor: string }>(({ bgColor }) => ({
width: '48px',
height: '48px',
margin: '0 auto',
borderRadius: '24px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: bgColor,

svg: {
width: '24px',
height: '24px',
},
}))
30 changes: 30 additions & 0 deletions docs/src/components/banner/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import BannerLeftImage from '@site/assets/pages/banner-bg-left.png'
import BannerRightImage from '@site/assets/pages/banner-bg-right.png'
import React from 'react'

import { PrimaryButton, DefaultButton } from '../button'

import { BannerContainer, BannerLeftBgWrap, BannerRightBgWrap, ButtonsWrap, ContentWrap, Slogan } from './styled'

export const HomeBanner = () => {
return (
<BannerContainer>
<BannerLeftBgWrap>
<img src={BannerLeftImage} />
</BannerLeftBgWrap>
<BannerRightBgWrap>
<img src={BannerRightImage} />
</BannerRightBgWrap>
<ContentWrap>
<Slogan>
<p>Care more about your</p>
<b>website performance</b>
</Slogan>
<ButtonsWrap>
<PrimaryButton href="https://perfsee.com">Try now</PrimaryButton>
<DefaultButton href="/docs">Docs</DefaultButton>
</ButtonsWrap>
</ContentWrap>
</BannerContainer>
)
}

0 comments on commit 59a4c01

Please sign in to comment.