Skip to content

Commit 4abd2cb

Browse files
authored
fix: fix change folder, name (#926)
* fix: fix change folder, name * docs: add parallax demo * fix: fix camel case name * chore: remove console log
1 parent 153db86 commit 4abd2cb

File tree

27 files changed

+1911
-934
lines changed

27 files changed

+1911
-934
lines changed

debug/state-api/index.html renamed to debug/reactive/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@
129129
renderOnlyVisible: true,
130130
// circular: true
131131
});
132-
const { connectFlickingStateApi } = Flicking;
133-
const reactiveObj = connectFlickingStateApi(flicking);
132+
const { connectFlickingReactiveAPI } = Flicking;
133+
const reactiveObj = connectFlickingReactiveAPI(flicking);
134134
const {
135135
isReachStart,
136136
isReachEnd,

docs/docusaurus.config.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @type {import('@docusaurus/types').DocusaurusConfig} */
2-
2+
const path = require("path");
33
const isDev = process.env.NODE_ENV === "development";
44

55
/** @type {import('@docusaurus/types').Config} */
@@ -14,7 +14,24 @@ module.exports = {
1414
projectName: "naver.github.io",
1515
trailingSlash: false,
1616
organizationName: "naver",
17-
plugins: ["docusaurus-plugin-sass"],
17+
plugins: [
18+
"docusaurus-plugin-sass",
19+
() => {
20+
return {
21+
name: "custom-webpack-alias",
22+
configureWebpack: (config, isServer, utils) => {
23+
return {
24+
resolve: {
25+
alias: {
26+
react: path.resolve(__dirname, "./node_modules/react"),
27+
"react-dom": path.resolve(__dirname, "./node_modules/react-dom"),
28+
}
29+
}
30+
};
31+
}
32+
};
33+
}
34+
],
1835
themeConfig: {
1936
navbar: {
2037
logo: {

docs/package-lock.json

Lines changed: 1402 additions & 753 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@
1111
"clear": "docusaurus clear",
1212
"serve": "docusaurus serve",
1313
"write-translations": "docusaurus write-translations",
14-
"write-heading-ids": "docusaurus write-heading-ids"
14+
"write-heading-ids": "docusaurus write-heading-ids",
15+
"postinstall": "yarn link:react-flicking && yarn link:flicking && yarn link:docs",
16+
"link:flicking": "cd ../ && npm link",
17+
"link:react-flicking": "cd ../packages/react-flicking && npm link @egjs/flicking && npm link",
18+
"link:docs": "npm link @egjs/react-flicking"
19+
1520
},
1621
"dependencies": {
1722
"@docusaurus/core": "2.4.3",
1823
"@docusaurus/preset-classic": "2.4.3",
1924
"@egjs/flicking-plugins": "^4.6.0",
20-
"@egjs/react-flicking": "^4.13.0",
25+
"@egjs/flicking": "*",
26+
"@egjs/react-flicking": "*",
2127
"@egjs/react-grid": "^1.1.2",
2228
"@emotion/react": "^11.14.0",
2329
"@emotion/styled": "^11.14.0",
@@ -31,6 +37,10 @@
3137
"react-tabs": "^3.2.2",
3238
"react-toggle": "^4.1.2"
3339
},
40+
"overrides": {
41+
"react": "^17.0.1",
42+
"react-dom": "^17.0.1"
43+
},
3444
"browserslist": {
3545
"production": [
3646
">0.5%",
@@ -47,6 +57,8 @@
4757
"@babel/plugin-proposal-class-properties": "^7.14.5",
4858
"@babel/plugin-proposal-decorators": "^7.13.15",
4959
"@types/react": "^17.0.19",
50-
"remark-breaks": "^2.0.2"
60+
"remark-breaks": "^2.0.2",
61+
"tslib": "^2.2.0",
62+
"typescript": "4.8.4"
5163
}
5264
}

docs/src/css/custom.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,31 @@ article a {
189189
margin-right: 0px;
190190
margin-left: 0px;
191191
}
192+
193+
194+
195+
196+
.skelton-panel {
197+
display: flex;
198+
flex-direction: column;
199+
gap: 14px;
200+
justify-content: center;
201+
align-items: flex-start;
202+
}
203+
.skeleton-bar {
204+
height: 10px;
205+
border-radius: 5px;
206+
background: white;
207+
}
208+
.skeleton-bar-size1 {
209+
width: 100px;
210+
}
211+
.skeleton-bar-size2 {
212+
width: 120px;
213+
}
214+
.skeleton-bar-size3 {
215+
width: 160px;
216+
}
217+
.skeleton-bar-size4 {
218+
width: 200px;
219+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from "react";
2+
import Flicking, { useFlickingReactiveAPI } from "@egjs/react-flicking";
3+
4+
export default () => {
5+
const flickingRef = React.createRef<Flicking>();
6+
const {
7+
indexProgress
8+
} = useFlickingReactiveAPI(flickingRef);
9+
10+
return (
11+
<Flicking ref={flickingRef}>
12+
{[0, 1, 2, 3, 4].map((index) => {
13+
14+
const childProgress = index - indexProgress;
15+
const opacity = Math.min(Math.max(1 - Math.abs(childProgress), 0), 1);
16+
17+
return <div className={"flicking-panel skelton-panel has-background-primary is-size-1"}>
18+
<span className="skeleton-bar skeleton-bar-size4" style={{
19+
transform: `translate(${childProgress * 180}px)`,
20+
opacity
21+
}}></span>
22+
<span className="skeleton-bar skeleton-bar-size1" style={{
23+
transform: `translate(${childProgress * 160}px)`,
24+
opacity
25+
}}></span>
26+
<span className="skeleton-bar skeleton-bar-size3" style={{
27+
transform: `translate(${childProgress * 140}px)`,
28+
opacity
29+
}}></span>
30+
<span className="skeleton-bar skeleton-bar-size2" style={{
31+
transform: `translate(${childProgress * 120}px)`,
32+
opacity
33+
}}></span>
34+
<span className="skeleton-bar skeleton-bar-size3" style={{
35+
transform: `translate(${childProgress * 100}px)`,
36+
opacity
37+
}}></span>
38+
</div>;
39+
})}
40+
</Flicking>
41+
);
42+
};

docs/src/pages/Reactive.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import CFCTabs from "@site/src/component/CFCTabs"
1313
import Columns from "@site/src/component/Columns";
1414
import ColumnItem from "@site/src/component/ColumnItem";
1515
import AutoInit from "@site/src/demo/AutoInit";
16+
import Parallax from "@site/src/demo/reactive/Parallax";
1617
import Pagination from '@mui/material/Pagination';
1718
import LinearProgress from '@mui/material/LinearProgress';
1819
import Tabs from "@theme/Tabs";
@@ -414,16 +415,13 @@ module.exports = {
414415
</Tabs>
415416

416417

417-
### Fade
418-
> `.indexedProgress`를 이용하여 각 Panel의 Fade를 만들 수 있습니다.
418+
### Parallax
419+
> `.indexProgress`를 이용하여 각 Panel의 Parallax 효과를를 만들 수 있습니다.
419420
420421
<Columns>
421422
<ColumnItem is={12} className="is-flex is-flex-direction-column is-align-items-center">
422-
<Flicking align={{ camera: "20%", panel: "40px" }}>
423-
{ Panels(4) }
424-
</Flicking>
425-
<Pagination page={1} count={10} />
426-
</ColumnItem>
423+
<Parallax />
424+
</ColumnItem>
427425
</Columns>
428426

429427

docs/tsconfig.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
9+
"allowJs": true,
10+
"skipLibCheck": true,
11+
"strictNullChecks": true,
12+
"esModuleInterop": true,
13+
"importHelpers": true,
14+
"experimentalDecorators": true,
15+
"suppressImplicitAnyIndexErrors": true,
16+
"allowSyntheticDefaultImports": true,
17+
"forceConsistentCasingInFileNames": true,
18+
"module": "esnext",
19+
"moduleResolution": "node",
20+
"resolveJsonModule": true,
21+
"jsx": "react",
22+
"strict": false,
23+
"isolatedModules": true,
24+
"noEmit": true,
25+
"noFallthroughCasesInSwitch": true
26+
},
27+
"include": [
28+
"src"
29+
]
30+
}

0 commit comments

Comments
 (0)