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

complete refactor and upgrade #56

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

42 changes: 42 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
jsxPragma: "null",
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
extraFileExtensions: [],
},
ignorePatterns: ["**/lib", "**/dist", "**/*.json"],
extends: [
"react-app", // provides @typescript-eslint DO NOT added it twice
"react-app/jest",
"plugin:jsx-a11y/recommended",
"prettier",
],
// @see https://eslint.org/docs/latest/user-guide/configuring/rules
// @see https://typescript-eslint.io/rules/some-rule-name-here
// 0 off
// 1 warn
// 2 error
rules: {
// use what makes sense
"@typescript-eslint/prefer-nullish-coalescing": 0,
// force error
"@typescript-eslint/restrict-template-expressions": 2,
// too many false positives/TSC does it better
"@typescript-eslint/await-thenable": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unnecessary-condition": 0,
"@typescript-eslint/no-unnecessary-type-assertion": 0,
"@typescript-eslint/no-unsafe-argument": 1,
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-call": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/no-unsafe-return": 0,
},
};
13 changes: 0 additions & 13 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ node_modules

# builds
build
dist

# misc
.DS_Store
Expand All @@ -21,3 +20,4 @@ yarn-debug.log*
yarn-error.log*

_crea
tsconfig.tsbuildinfo
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

173 changes: 58 additions & 115 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,129 +1,72 @@
# @ap.cx/react-fullpage
# react-fullerpage

https://thierryc.github.io/react-fullpage/

another demo:

https://thierryc.github.io/react-fullpage-example/

This project is still in a very **early stage**.
You shouldn't use this for production unless you really know what you're doing. 🖖

## Features

- Design for Mobile, Tablet, and Desktop
- Nested Component (simple to use)
- Hide safari's header on Scroll on iphone and ipad
- Hide Google Chrome's header on Scroll on iOS and Android
- Drived by the scroll
- CSS animation
- GPU/CPU swtich
- Very Small ( ~ 25kB )
- MIT License (no fullpage.js dependency)

> Create Fullscreen Scrolling Websites

[![NPM](https://img.shields.io/npm/v/@ap.cx/react-fullpage.svg)](https://www.npmjs.com/package/react-fullpage)
[![MIT](https://img.shields.io/packagist/l/doctrine/orm.svg)](https://github.com/thierryc/react-fullpage/blob/master/LICENSE)
- typescript first via bun.sh
- original work by [thierryc](https://github.com/thierryc)
- dependencies
- [react-fullscreen](https://github.com/snakesilk/react-fullscreen)
- peer dependencies
- react18
- react-dom 18
- [framer-motion](https://github.com/framer/motion/tree/main/packages/framer-motion)

## Install

```bash
npm install --save @ap.cx/react-fullpage
```
## Usage

```jsx

import React, { Component } from 'react'
import Fullpage, { FullPageSections, FullpageSection } from '@ap.cx/react-fullpage'

export default class App extends Component {
render () {
return (
<Fullpage>

<FullPageSections>

<FullpageSection style={{
backgroundColor: 'lime',
height: '80vh',
padding: '1em',
}}>1</FullpageSection>
<FullpageSection style={{
backgroundColor: 'coral',
padding: '1em',
}}>2</FullpageSection>
<FullpageSection style={{
backgroundColor: 'firebrick',
padding: '1em',
}}>3</FullpageSection>

</FullPageSections>

</Fullpage>
)
}
}

Migation from previous version.
Add the ``` <FullPageSections> ... </FullPageSections>```

```

### For IE

```

npm i babel-polyfill

```
bun add \
framer-motion \
react \
react-dom \
github:noahehall/react-fullerpage

```
import "babel-polyfill";

```


## Mobile First

![Android Phone](https://raw.githubusercontent.com/thierryc/react-fullpage/master/static/images/android-phone.jpg)


## Dev

open 2 terminal

In the first terminals windows.


```

> npm i
> npm link
> npm start

```


In the second terminal

```

> cd example
> npm i
> npm link @ap.cx/react-fullpage
> npm start
## Usage

```jsx
/**
* FYI-1: all elements take a motionProps={any motion prop}
* please check the source, or submit a PR if you want to document the source
*
* FYI-2: you need to set backgroundColor for fullscreen mode
* else it goes black, dunno, ignoring
*/
import { ReactFP, FPContainer, FPItem } from "react-fullerpage";

export const App = () => (
<ReactFP>
<FPContainer>
<FPItem
style={{
backgroundColor: "lime",
height: "80vh", // defaults to 100vh
padding: "1em",
}}
>
1
</FPItem>

<FPItem
style={{
backgroundColor: "coral",
padding: "1em",
}}
>
2
</FPItem>

<FPItem
style={{
backgroundColor: "firebrick",
padding: "1em",
}}
>
3
</FPItem>
</FPContainer>
</ReactFP>
);
```


## Thanks

Special thanks to [BrowserStack](https://www.browserstack.com/users/sign_up) for sponsoring this plugin. 👍

[![Browserstack](https://raw.githubusercontent.com/thierryc/react-fullpage/master/static/images/[email protected])](https://www.browserstack.com/users/sign_up)

## License (MIT)

```
Expand Down
27 changes: 0 additions & 27 deletions _old.eslintrc

This file was deleted.

8 changes: 8 additions & 0 deletions barrels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"delete": true,
"directory": ["src"],
"exclude": ".*.d.ts",
"local": false,
"location": "all",
"structure": "flat"
}
Binary file added bun.lockb
Binary file not shown.
Loading