From e2b3f0b69b25322ef34b525d0677eab7b8c5654e Mon Sep 17 00:00:00 2001 From: srgooglo <38926803+srgooglo@users.noreply.github.com> Date: Fri, 17 Apr 2020 19:59:19 +0200 Subject: [PATCH] improve: secondary model 2 --- .prev/.editorconfig | 16 + .prev/.env | 2 + .prev/.eslintignore | 7 + .prev/.eslintrc | 8 + .prev/.gitignore | 24 + .prev/.prettierignore | 6 + .prev/.prettierrc | 5 + .prev/.stylelintrc.json | 9 + .prev/.travis.yml | 27 + .prev/.umirc.js | 91 + .prev/.vsls.json | 4 + .prev/LICENSE | 201 +++ .prev/capacitor.config.json | 8 + .prev/comty_dev.service | 11 + .prev/comty_dist.service | 11 + .prev/config/app.settings.js | 36 + .prev/config/id_rsa.enc | Bin 0 -> 116 bytes .prev/config/keys.js | 6 + .prev/config/theme.config.js | 8 + .prev/config/ycore.config.js | 35 + .prev/dev-server.sh | 64 + .prev/dist-server.sh | 59 + .prev/globals/badges_list.js | 45 + .prev/globals/debug.json | 23 + .prev/globals/endpoints.js | 23 + .prev/globals/endpoints/comty_endpoints.js | 23 + .prev/globals/endpoints/index.js | 2 + .prev/globals/endpoints/twitter_endpoints.js | 6 + .prev/globals/post_options.js | 22 + .prev/globals/settings.js | 62 + .prev/jest.config.js | 3 + .prev/manifest.json | 12 + .prev/package.json | 131 ++ .prev/public/dark_full_logo.svg | 1 + .prev/public/dark_logo.svg | 1 + .prev/public/favicon.ico | Bin 0 -> 16958 bytes .prev/public/full_logo.svg | 1 + .prev/public/logo.svg | 1 + .prev/service-worker.js | 133 ++ .prev/setupTests.js | 6 + .prev/src/@ycore/libs.js | 8 + .prev/src/@ycore/libs/app_functions/modals.js | 126 ++ .../src/@ycore/libs/app_functions/modals.less | 9 + .prev/src/@ycore/libs/app_functions/pre.js | 219 +++ .prev/src/@ycore/libs/comty_ng/comty_get.js | 65 + .prev/src/@ycore/libs/comty_ng/comty_post.js | 209 +++ .../libs/comty_ng/comty_post_comment.js | 41 + .../src/@ycore/libs/comty_ng/comty_search.js | 23 + .prev/src/@ycore/libs/comty_ng/comty_user.js | 75 + .prev/src/@ycore/libs/comty_ng/pre.js | 64 + .prev/src/@ycore/libs/rs_cloud/api_call.js | 95 ++ .prev/src/@ycore/libs/rs_cloud/pre.js | 101 ++ .prev/src/@ycore/libs/ycore_sdcp/pre.js | 67 + .prev/src/@ycore/libs/ycore_styles/pre.js | 11 + .../@ycore/libs/ycore_styles/ycore_style.scss | 1488 +++++++++++++++++ .prev/src/@ycore/libs/ycore_sync/pre.js | 50 + .prev/src/@ycore/libs/yulio_id/ctid_gen.js | 32 + .prev/src/@ycore/libs/yulio_id/pre.js | 59 + .prev/src/@ycore/libs/yulio_id/token_data.js | 45 + .prev/src/@ycore/libs/yulio_id/validate.js | 55 + .prev/src/@ycore/ycore_worker.js | 333 ++++ .prev/src/components/App_about/index.js | 29 + .prev/src/components/App_about/index.less | 18 + .prev/src/components/CustomIcons/index.js | 11 + .prev/src/components/HeaderSearch/index.js | 83 + .prev/src/components/HeaderSearch/index.less | 78 + .prev/src/components/Layout/Control.js | 67 + .prev/src/components/Layout/Control.less | 26 + .../src/components/Layout/Secondary/index.js | 254 +++ .../components/Layout/Secondary/index.less | 230 +++ .../components/Layout/Secondary/renders.js | 336 ++++ .../components/Layout/Secondary/renders.less | 356 ++++ .prev/src/components/Layout/Sider/default.js | 107 ++ .../src/components/Layout/Sider/default.less | 137 ++ .prev/src/components/Layout/Sider/index.js | 51 + .prev/src/components/Layout/Sider/mobile.js | 51 + .prev/src/components/Layout/Sider/mobile.less | 50 + .prev/src/components/Layout/index.js | 5 + .prev/src/components/Like_button/index.js | 106 ++ .prev/src/components/Like_button/index.scss | 205 +++ .prev/src/components/Loader/Loader.js | 28 + .prev/src/components/Loader/Loader.less | 118 ++ .../components/MainFeed/components/index.js | 5 + .../MainFeed/components/invalid/index.js | 24 + .../MainFeed/components/invalid/invalid.less | 0 .../MainFeed/components/newav/index.js | 11 + .../MainFeed/components/newav/newav.less | 3 + .../components/renderFeedPosts/index.js | 43 + .prev/src/components/MainFeed/index.js | 186 +++ .prev/src/components/MainFeed/index.less | 4 + .prev/src/components/MediaPlayer/index.js | 65 + .prev/src/components/MediaPlayer/index.less | 80 + .prev/src/components/MediaPlayer/plyr.js | 134 ++ .prev/src/components/MobileWarning/index.js | 48 + .prev/src/components/MobileWarning/index.less | 18 + .../components/PageTransition/animations.js | 780 +++++++++ .prev/src/components/PageTransition/index.js | 80 + .../src/components/PageTransition/presets.js | 552 ++++++ .prev/src/components/PageTransition/styles.js | 54 + .prev/src/components/PostCard/index.js | 272 +++ .prev/src/components/PostCard/index.less | 230 +++ .prev/src/components/PostCreator/index.js | 407 +++++ .prev/src/components/PostCreator/index.less | 313 ++++ .../local_components/post_options.js | 151 ++ .../local_components/post_options.less | 57 + .prev/src/components/ScrollBar/index.js | 5 + .prev/src/components/ScrollBar/index.less | 35 + .prev/src/components/SearchCard/index.js | 88 + .prev/src/components/SearchCard/index.less | 105 ++ .prev/src/components/UserBadges/index.js | 29 + .prev/src/components/UserBadges/index.less | 0 .../UserProfile/components/Follow_btn.js | 17 + .../UserProfile/components/follow_btn.scss | 65 + .prev/src/components/UserProfile/index.js | 232 +++ .prev/src/components/UserProfile/styles.less | 166 ++ .prev/src/components/YulioID/index.js | 240 +++ .prev/src/components/YulioID/index.less | 485 ++++++ .prev/src/components/index.js | 47 + .prev/src/layouts/BaseLayout.js | 57 + .prev/src/layouts/BaseLayout.less | 74 + .prev/src/layouts/PrimaryLayout.js | 130 ++ .prev/src/layouts/PrimaryLayout.less | 51 + .prev/src/layouts/PublicLayout.js | 3 + .prev/src/layouts/index.js | 74 + .prev/src/locales/en/messages.json | 54 + .prev/src/models/app.js | 82 + .prev/src/pages/$page/index.js | 38 + .prev/src/pages/$page/index.less | 14 + .prev/src/pages/404.js | 16 + .prev/src/pages/404.less | 55 + .prev/src/pages/__m/index.js | 232 +++ .prev/src/pages/__m/style.less | 31 + .prev/src/pages/about/index.js | 9 + .prev/src/pages/about/index.less | 18 + .prev/src/pages/events/index.js | 10 + .prev/src/pages/events/index.less | 1 + .prev/src/pages/g/$group/index.js | 99 ++ .prev/src/pages/g/$group/styles.less | 20 + .prev/src/pages/index.js | 10 + .prev/src/pages/login/index.js | 132 ++ .prev/src/pages/login/index.less | 235 +++ .prev/src/pages/login/login.js | 221 +++ .prev/src/pages/login/register.js | 162 ++ .prev/src/pages/main/index.js | 15 + .prev/src/pages/main/index.less | 6 + .prev/src/pages/marketplace/index.js | 10 + .prev/src/pages/marketplace/index.less | 1 + .prev/src/pages/p/$post/index.js | 47 + .prev/src/pages/pro/index.js | 7 + .prev/src/pages/s/$search/index.js | 163 ++ .prev/src/pages/s/$search/styles.less | 20 + .prev/src/pages/saves/index.js | 47 + .prev/src/pages/saves/index.less | 14 + .prev/src/pages/settings/components/about.js | 9 + .prev/src/pages/settings/components/base.js | 146 ++ .../settings/components/earnings/index.js | 16 + .../settings/components/notification/index.js | 17 + .../components/notification/index.less | 17 + .../settings/components/security/index.js | 65 + .../settings/components/security/index.less | 17 + .../settings/components/security/sessions.js | 39 + .prev/src/pages/settings/index.js | 108 ++ .prev/src/pages/settings/style.less | 77 + .prev/src/themes/antd-design.less | 839 ++++++++++ .prev/src/themes/base/index.less | 222 +++ .prev/src/themes/base/resolutions.less | 20 + .prev/src/themes/fonts-imports.css | 5 + .prev/src/themes/index.less | 3 + .prev/src/utils/index.js | 247 +++ .prev/src/utils/model.js | 39 + .prev/src/utils/request.js | 96 ++ .prev/src/utils/theme.js | 14 + package.json | 3 + src/@ycore/libs/app_functions/pre.js | 16 +- src/@ycore/ycore_worker.js | 3 +- src/components/HeaderSearch/index.js | 8 +- src/components/Layout/Control.js | 6 +- src/components/Layout/Control.less | 5 + .../Layout/Secondary/components/__sec.less | 74 + .../Layout/Secondary/components/__sec.tsx | 78 + .../Layout/Secondary/components/index.js | 3 + src/components/Layout/Secondary/index.js | 374 +++-- src/components/Layout/Secondary/index.less | 220 ++- src/components/Layout/Secondary/renders.js | 4 +- src/components/Layout/Secondary/renders.less | 2 +- src/components/PostCard/index.js | 12 +- src/components/YulioID/index.js | 240 +++ src/components/YulioID/index.less | 485 ++++++ src/layouts/PrimaryLayout.js | 2 +- src/models/app.js | 5 +- src/pages/__m/index.js | 98 +- src/pages/debug_test/drag.css | 13 + src/pages/debug_test/drag.js | 38 + src/pages/debug_test/drag_t.tsx | 44 + src/pages/debug_test/index.js | 13 + src/pages/debug_test/upload.js | 0 src/pages/settings/components/base.js | 2 +- src/themes/base/index.less | 6 + src/utils/index.js | 20 +- 199 files changed, 17185 insertions(+), 428 deletions(-) create mode 100644 .prev/.editorconfig create mode 100644 .prev/.env create mode 100644 .prev/.eslintignore create mode 100644 .prev/.eslintrc create mode 100644 .prev/.gitignore create mode 100644 .prev/.prettierignore create mode 100644 .prev/.prettierrc create mode 100644 .prev/.stylelintrc.json create mode 100644 .prev/.travis.yml create mode 100644 .prev/.umirc.js create mode 100644 .prev/.vsls.json create mode 100644 .prev/LICENSE create mode 100644 .prev/capacitor.config.json create mode 100644 .prev/comty_dev.service create mode 100644 .prev/comty_dist.service create mode 100644 .prev/config/app.settings.js create mode 100644 .prev/config/id_rsa.enc create mode 100644 .prev/config/keys.js create mode 100644 .prev/config/theme.config.js create mode 100644 .prev/config/ycore.config.js create mode 100644 .prev/dev-server.sh create mode 100644 .prev/dist-server.sh create mode 100644 .prev/globals/badges_list.js create mode 100644 .prev/globals/debug.json create mode 100644 .prev/globals/endpoints.js create mode 100644 .prev/globals/endpoints/comty_endpoints.js create mode 100644 .prev/globals/endpoints/index.js create mode 100644 .prev/globals/endpoints/twitter_endpoints.js create mode 100644 .prev/globals/post_options.js create mode 100644 .prev/globals/settings.js create mode 100644 .prev/jest.config.js create mode 100644 .prev/manifest.json create mode 100644 .prev/package.json create mode 100644 .prev/public/dark_full_logo.svg create mode 100644 .prev/public/dark_logo.svg create mode 100644 .prev/public/favicon.ico create mode 100644 .prev/public/full_logo.svg create mode 100644 .prev/public/logo.svg create mode 100644 .prev/service-worker.js create mode 100644 .prev/setupTests.js create mode 100644 .prev/src/@ycore/libs.js create mode 100644 .prev/src/@ycore/libs/app_functions/modals.js create mode 100644 .prev/src/@ycore/libs/app_functions/modals.less create mode 100644 .prev/src/@ycore/libs/app_functions/pre.js create mode 100644 .prev/src/@ycore/libs/comty_ng/comty_get.js create mode 100644 .prev/src/@ycore/libs/comty_ng/comty_post.js create mode 100644 .prev/src/@ycore/libs/comty_ng/comty_post_comment.js create mode 100644 .prev/src/@ycore/libs/comty_ng/comty_search.js create mode 100644 .prev/src/@ycore/libs/comty_ng/comty_user.js create mode 100644 .prev/src/@ycore/libs/comty_ng/pre.js create mode 100644 .prev/src/@ycore/libs/rs_cloud/api_call.js create mode 100644 .prev/src/@ycore/libs/rs_cloud/pre.js create mode 100644 .prev/src/@ycore/libs/ycore_sdcp/pre.js create mode 100644 .prev/src/@ycore/libs/ycore_styles/pre.js create mode 100644 .prev/src/@ycore/libs/ycore_styles/ycore_style.scss create mode 100644 .prev/src/@ycore/libs/ycore_sync/pre.js create mode 100644 .prev/src/@ycore/libs/yulio_id/ctid_gen.js create mode 100644 .prev/src/@ycore/libs/yulio_id/pre.js create mode 100644 .prev/src/@ycore/libs/yulio_id/token_data.js create mode 100644 .prev/src/@ycore/libs/yulio_id/validate.js create mode 100644 .prev/src/@ycore/ycore_worker.js create mode 100644 .prev/src/components/App_about/index.js create mode 100644 .prev/src/components/App_about/index.less create mode 100644 .prev/src/components/CustomIcons/index.js create mode 100644 .prev/src/components/HeaderSearch/index.js create mode 100644 .prev/src/components/HeaderSearch/index.less create mode 100644 .prev/src/components/Layout/Control.js create mode 100644 .prev/src/components/Layout/Control.less create mode 100644 .prev/src/components/Layout/Secondary/index.js create mode 100644 .prev/src/components/Layout/Secondary/index.less create mode 100644 .prev/src/components/Layout/Secondary/renders.js create mode 100644 .prev/src/components/Layout/Secondary/renders.less create mode 100644 .prev/src/components/Layout/Sider/default.js create mode 100644 .prev/src/components/Layout/Sider/default.less create mode 100644 .prev/src/components/Layout/Sider/index.js create mode 100644 .prev/src/components/Layout/Sider/mobile.js create mode 100644 .prev/src/components/Layout/Sider/mobile.less create mode 100644 .prev/src/components/Layout/index.js create mode 100644 .prev/src/components/Like_button/index.js create mode 100644 .prev/src/components/Like_button/index.scss create mode 100644 .prev/src/components/Loader/Loader.js create mode 100644 .prev/src/components/Loader/Loader.less create mode 100644 .prev/src/components/MainFeed/components/index.js create mode 100644 .prev/src/components/MainFeed/components/invalid/index.js create mode 100644 .prev/src/components/MainFeed/components/invalid/invalid.less create mode 100644 .prev/src/components/MainFeed/components/newav/index.js create mode 100644 .prev/src/components/MainFeed/components/newav/newav.less create mode 100644 .prev/src/components/MainFeed/components/renderFeedPosts/index.js create mode 100644 .prev/src/components/MainFeed/index.js create mode 100644 .prev/src/components/MainFeed/index.less create mode 100644 .prev/src/components/MediaPlayer/index.js create mode 100644 .prev/src/components/MediaPlayer/index.less create mode 100644 .prev/src/components/MediaPlayer/plyr.js create mode 100644 .prev/src/components/MobileWarning/index.js create mode 100644 .prev/src/components/MobileWarning/index.less create mode 100644 .prev/src/components/PageTransition/animations.js create mode 100644 .prev/src/components/PageTransition/index.js create mode 100644 .prev/src/components/PageTransition/presets.js create mode 100644 .prev/src/components/PageTransition/styles.js create mode 100644 .prev/src/components/PostCard/index.js create mode 100644 .prev/src/components/PostCard/index.less create mode 100644 .prev/src/components/PostCreator/index.js create mode 100644 .prev/src/components/PostCreator/index.less create mode 100644 .prev/src/components/PostCreator/local_components/post_options.js create mode 100644 .prev/src/components/PostCreator/local_components/post_options.less create mode 100644 .prev/src/components/ScrollBar/index.js create mode 100644 .prev/src/components/ScrollBar/index.less create mode 100644 .prev/src/components/SearchCard/index.js create mode 100644 .prev/src/components/SearchCard/index.less create mode 100644 .prev/src/components/UserBadges/index.js create mode 100644 .prev/src/components/UserBadges/index.less create mode 100644 .prev/src/components/UserProfile/components/Follow_btn.js create mode 100644 .prev/src/components/UserProfile/components/follow_btn.scss create mode 100644 .prev/src/components/UserProfile/index.js create mode 100644 .prev/src/components/UserProfile/styles.less create mode 100644 .prev/src/components/YulioID/index.js create mode 100644 .prev/src/components/YulioID/index.less create mode 100644 .prev/src/components/index.js create mode 100644 .prev/src/layouts/BaseLayout.js create mode 100644 .prev/src/layouts/BaseLayout.less create mode 100644 .prev/src/layouts/PrimaryLayout.js create mode 100644 .prev/src/layouts/PrimaryLayout.less create mode 100644 .prev/src/layouts/PublicLayout.js create mode 100644 .prev/src/layouts/index.js create mode 100644 .prev/src/locales/en/messages.json create mode 100644 .prev/src/models/app.js create mode 100644 .prev/src/pages/$page/index.js create mode 100644 .prev/src/pages/$page/index.less create mode 100644 .prev/src/pages/404.js create mode 100644 .prev/src/pages/404.less create mode 100644 .prev/src/pages/__m/index.js create mode 100644 .prev/src/pages/__m/style.less create mode 100644 .prev/src/pages/about/index.js create mode 100644 .prev/src/pages/about/index.less create mode 100644 .prev/src/pages/events/index.js create mode 100644 .prev/src/pages/events/index.less create mode 100644 .prev/src/pages/g/$group/index.js create mode 100644 .prev/src/pages/g/$group/styles.less create mode 100644 .prev/src/pages/index.js create mode 100644 .prev/src/pages/login/index.js create mode 100644 .prev/src/pages/login/index.less create mode 100644 .prev/src/pages/login/login.js create mode 100644 .prev/src/pages/login/register.js create mode 100644 .prev/src/pages/main/index.js create mode 100644 .prev/src/pages/main/index.less create mode 100644 .prev/src/pages/marketplace/index.js create mode 100644 .prev/src/pages/marketplace/index.less create mode 100644 .prev/src/pages/p/$post/index.js create mode 100644 .prev/src/pages/pro/index.js create mode 100644 .prev/src/pages/s/$search/index.js create mode 100644 .prev/src/pages/s/$search/styles.less create mode 100644 .prev/src/pages/saves/index.js create mode 100644 .prev/src/pages/saves/index.less create mode 100644 .prev/src/pages/settings/components/about.js create mode 100644 .prev/src/pages/settings/components/base.js create mode 100644 .prev/src/pages/settings/components/earnings/index.js create mode 100644 .prev/src/pages/settings/components/notification/index.js create mode 100644 .prev/src/pages/settings/components/notification/index.less create mode 100644 .prev/src/pages/settings/components/security/index.js create mode 100644 .prev/src/pages/settings/components/security/index.less create mode 100644 .prev/src/pages/settings/components/security/sessions.js create mode 100644 .prev/src/pages/settings/index.js create mode 100644 .prev/src/pages/settings/style.less create mode 100644 .prev/src/themes/antd-design.less create mode 100644 .prev/src/themes/base/index.less create mode 100644 .prev/src/themes/base/resolutions.less create mode 100644 .prev/src/themes/fonts-imports.css create mode 100644 .prev/src/themes/index.less create mode 100644 .prev/src/utils/index.js create mode 100644 .prev/src/utils/model.js create mode 100644 .prev/src/utils/request.js create mode 100644 .prev/src/utils/theme.js create mode 100644 src/components/Layout/Secondary/components/__sec.less create mode 100644 src/components/Layout/Secondary/components/__sec.tsx create mode 100644 src/components/Layout/Secondary/components/index.js create mode 100644 src/components/YulioID/index.js create mode 100644 src/components/YulioID/index.less create mode 100644 src/pages/debug_test/drag.css create mode 100644 src/pages/debug_test/drag.js create mode 100644 src/pages/debug_test/drag_t.tsx create mode 100644 src/pages/debug_test/index.js create mode 100644 src/pages/debug_test/upload.js diff --git a/.prev/.editorconfig b/.prev/.editorconfig new file mode 100644 index 00000000..7e3649ac --- /dev/null +++ b/.prev/.editorconfig @@ -0,0 +1,16 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/.prev/.env b/.prev/.env new file mode 100644 index 00000000..45da7143 --- /dev/null +++ b/.prev/.env @@ -0,0 +1,2 @@ +UMI_UI=none +NODE_ENV=production \ No newline at end of file diff --git a/.prev/.eslintignore b/.prev/.eslintignore new file mode 100644 index 00000000..96a82dff --- /dev/null +++ b/.prev/.eslintignore @@ -0,0 +1,7 @@ +src/**/*-test.js +src/public +src/routes/chart/ECharts/theme +src/routes/chart/highCharts/mapdata +src/locales/_build/ +src/locales/**/*.js +docs/**/*.js diff --git a/.prev/.eslintrc b/.prev/.eslintrc new file mode 100644 index 00000000..e71ebc80 --- /dev/null +++ b/.prev/.eslintrc @@ -0,0 +1,8 @@ +{ + "extends": "react-app", + "rules": { + "jsx-a11y/href-no-hash": "off", + "no-console": "warn", + "valid-jsdoc": "warn" + } +} diff --git a/.prev/.gitignore b/.prev/.gitignore new file mode 100644 index 00000000..500b786a --- /dev/null +++ b/.prev/.gitignore @@ -0,0 +1,24 @@ +coverage +dist +node_modules +npm-debug.log +yarn-error.log +yarn.lock +package-lock.json + +# ide +.idea + +# Mac General +.DS_Store +.AppleDouble +.LSOverride + +# umi +.umi +.umi-production + +# jslingui +src/locales/_build +src/locales/**/*.js +android/ diff --git a/.prev/.prettierignore b/.prev/.prettierignore new file mode 100644 index 00000000..1e879f7a --- /dev/null +++ b/.prev/.prettierignore @@ -0,0 +1,6 @@ +*.svg +*.ejs +.DS_Store +.umi +.umi-production +src/locales/**/*.json \ No newline at end of file diff --git a/.prev/.prettierrc b/.prev/.prettierrc new file mode 100644 index 00000000..36301bc5 --- /dev/null +++ b/.prev/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "trailingComma": "es5" +} diff --git a/.prev/.stylelintrc.json b/.prev/.stylelintrc.json new file mode 100644 index 00000000..b533bdd6 --- /dev/null +++ b/.prev/.stylelintrc.json @@ -0,0 +1,9 @@ +{ + "extends": ["stylelint-config-standard", "stylelint-config-prettier"], + "rules": { + "declaration-empty-line-before": null, + "no-descending-specificity": null, + "selector-pseudo-class-no-unknown": null, + "selector-pseudo-element-colon-notation": null + } +} diff --git a/.prev/.travis.yml b/.prev/.travis.yml new file mode 100644 index 00000000..4789d27f --- /dev/null +++ b/.prev/.travis.yml @@ -0,0 +1,27 @@ +language: node_js +node_js: + - node +script: + - npm run build +before_install: + - | + if [ "$TRAVIS_BRANCH" = "develop" ]; then + for prefixed_envvar in ${!DEV_*}; do + eval export ${prefixed_envvar#DEV_}="${!prefixed_envvar}" + done + elif [ "$TRAVIS_BRANCH" = "master" ]; then + for prefixed_envvar in ${!PROD_*}; do + eval export ${prefixed_envvar#PROD_}="${!prefixed_envvar}" + done + else + for prefixed_envvar in ${!TEST_*}; do + eval export ${prefixed_envvar#TEST_}="${!prefixed_envvar}" + done + fi + - openssl aes-256-cbc -K $encrypted_18b2305b78c9_key -iv $encrypted_18b2305b78c9_iv -in config/id_rsa.enc -out ~/.ssh/id_rsa -d + - chmod 600 ~/.ssh/id_rsa + - echo -e "Host $HOST\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config + - yarn global add now +after_script: + - scp -o stricthostkeychecking=no -r ./dist root@$HOST:$BUILD_DIR + - cd ./docs && now -A $DOC_NOW_CONFIG -t $NOW_TOKEN && now alias -A $DOC_NOW_CONFIG -t $NOW_TOKEN diff --git a/.prev/.umirc.js b/.prev/.umirc.js new file mode 100644 index 00000000..e081b1e4 --- /dev/null +++ b/.prev/.umirc.js @@ -0,0 +1,91 @@ +// https://umijs.org/config/ +import { resolve } from 'path' +import { i18n } from './config/ycore.config.js' +export default { + ignoreMomentLocale: true, + hash: true, + targets: { ie: 9,}, + treeShaking: true, + plugins: [ + [ + 'umi-plugin-react', + { + dva: { + immer: true, + }, + antd: true, + dynamicImport: { + webpackChunkName: true, + loadingComponent: './components/Loader/Loader', + }, + + routes: { + exclude: [ + /model\.(j|t)sx?$/, + /service\.(j|t)sx?$/, + /models\//, + /components\//, + /services\//, + ], + update: routes => { + if (!i18n) return routes + const newRoutes = [] + + for (const item of routes[0].routes) { + newRoutes.push(item) + + if (item.path) { + newRoutes.push( + Object.assign({}, item, { + path: + `/:lang(${i18n.languages + .map(item => item.key) + .join('|')})` + item.path, + }) + ) + } + } + + routes[0].routes = newRoutes + return routes + }, + }, + dll:false, + pwa: { + manifestOptions: { + srcPath: 'manifest.json', + }, + }, + }, + ], + ], + // Theme for antd + // https://ant.design/docs/react/customize-theme + theme: './config/theme.config.js', + // Webpack Configuration + alias: { + ycore: resolve(__dirname, './src/@ycore/ycore_worker.js'), + globals: resolve(__dirname, './globals'), + components: resolve(__dirname, './src/components'), + config: resolve(__dirname, './config/ycore.config.js'), + models: resolve(__dirname, './src/models'), + routes: resolve(__dirname, './src/routes'), + themes: resolve(__dirname, './src/themes'), + utils: resolve(__dirname, './src/utils'), + }, + extraBabelPresets: ['@lingui/babel-preset-react'], + extraBabelPlugins: [ + [ + 'import', + { + libraryName: 'lodash', + libraryDirectory: '', + camel2DashComponentName: false, + }, + 'lodash', + ], + ], + + + +} diff --git a/.prev/.vsls.json b/.prev/.vsls.json new file mode 100644 index 00000000..197e41f6 --- /dev/null +++ b/.prev/.vsls.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json.schemastore.org/vsls", + "gitignore":"none" +} \ No newline at end of file diff --git a/.prev/LICENSE b/.prev/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/.prev/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/.prev/capacitor.config.json b/.prev/capacitor.config.json new file mode 100644 index 00000000..542d7ae1 --- /dev/null +++ b/.prev/capacitor.config.json @@ -0,0 +1,8 @@ +{ + "appId": "com.ragestudio.comty", + "appName": "comty-development", + "bundledWebRuntime": false, + "npmClient": "npm", + "webDir": "dist", + "cordova": {} +} diff --git a/.prev/comty_dev.service b/.prev/comty_dev.service new file mode 100644 index 00000000..7ac93caa --- /dev/null +++ b/.prev/comty_dev.service @@ -0,0 +1,11 @@ +[Unit] +Description=Comty_Development + +[Service] +ExecStart=npm start +Restart=always +User=root +WorkingDirectory=/ycore/development/comty-development + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/.prev/comty_dist.service b/.prev/comty_dist.service new file mode 100644 index 00000000..09c4cc50 --- /dev/null +++ b/.prev/comty_dist.service @@ -0,0 +1,11 @@ +[Unit] +Description=Comty_Development + +[Service] +ExecStart=serve ./dist +Restart=always +User=root +WorkingDirectory=/ycore/development/comty-development + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/.prev/config/app.settings.js b/.prev/config/app.settings.js new file mode 100644 index 00000000..baafa2a0 --- /dev/null +++ b/.prev/config/app.settings.js @@ -0,0 +1,36 @@ +function SettingStoragedValue(e){ + try { + const fromStorage = JSON.parse(localStorage.getItem('app_settings')) + const Ite = fromStorage.map(item => { + return item.SettingID === e? item.value : null + }) + const fr = Ite.filter(Boolean) + return fr.toString() + } + catch (error) { + return null + } +} +const fromStorage = JSON.parse(localStorage.getItem('app_settings')) + +export var AppSettings = { + __global_server_prexif: 'https://api.ragestudio.net/RSA-COMTY/r/', + // Global Behaviors + InfiniteLoading: false, + InfiniteLogin: false, + InfiniteRegister: false, + DisableLogin: false, + DisableRegister: true, + DisablePasswordRecover: true, + disable_pro_tool: fromStorage? SettingStoragedValue('disable_pro_tool') : false, + force_showDevLogs: fromStorage? SettingStoragedValue('force_showDevLogs') : false, + SignForNotExpire: fromStorage? SettingStoragedValue('sessions_noexpire') : false, + auto_search_ontype: fromStorage? SettingStoragedValue('auto_search_ontype') : false, + auto_feedrefresh: fromStorage? SettingStoragedValue('auto_feedrefresh') : false, + auto_hide_postbar: fromStorage? SettingStoragedValue('auto_hide_postbar') : true, + MaxLengthPosts: '512', + CurrentBundle: 'light_ng', + // In KB + MaximunAPIPayload: '101376', + limit_post_catch: '20' +} \ No newline at end of file diff --git a/.prev/config/id_rsa.enc b/.prev/config/id_rsa.enc new file mode 100644 index 0000000000000000000000000000000000000000..5c41e85f3a3518c3b3d24513d7e0d0a00d78c93a GIT binary patch literal 116 zcmeZ`c)x!y12Y2y0}BuX*&r^62J%3_0ZfucKy>rT18F{xQJg@m2*iv&AVx?A05{Vb AssI20 literal 0 HcmV?d00001 diff --git a/.prev/config/keys.js b/.prev/config/keys.js new file mode 100644 index 00000000..5b5f8792 --- /dev/null +++ b/.prev/config/keys.js @@ -0,0 +1,6 @@ +module.exports = { + // Global Server Key (Requiered for RS-YIBTP), Not autogenerated, must be included on. (Recommended not modify this constants) + + server_key: + 'f706b0a535b6c2d36545c4137a0a3a26853ea8b5-1223c9ba7923152cae28e5a2e7501b2b-50600768', +} diff --git a/.prev/config/theme.config.js b/.prev/config/theme.config.js new file mode 100644 index 00000000..6dab2f79 --- /dev/null +++ b/.prev/config/theme.config.js @@ -0,0 +1,8 @@ +const fs = require('fs') +const path = require('path') +const lessToJs = require('less-vars-to-js') + +module.exports = () => { + const themePath = path.join(__dirname, `../src/themes/index.less`) + return lessToJs(fs.readFileSync(themePath, 'utf8')) +} diff --git a/.prev/config/ycore.config.js b/.prev/config/ycore.config.js new file mode 100644 index 00000000..b6383eb2 --- /dev/null +++ b/.prev/config/ycore.config.js @@ -0,0 +1,35 @@ +module.exports = { + server_endpoint: 'https://comty.julioworld.club', + siteName: 'Comty', + copyright: 'RageStudio©', + + LogoPath: '/logo.svg', + FullLogoPath: '/full_logo.svg', + DarkFullLogoPath: '/dark_full_logo.svg', + DarkLogoPath: '/dark_logo.svg', + + resource_bundle: 'light_ng', + sync_server: 'http://eu653-node.ragestudio.net:5500', + + g_recaptcha_key: '6Lc55uUUAAAAAEIACMVf3BUzAJSNCmI3RrjEirZ6', + g_recaptcha_secret: '6Lc55uUUAAAAAOP4OgUa5DpqJC-70t53AmW0lyYf', + + /* Layout configuration, specify which layout to use for route. */ + layouts: [ + { + name: 'primary', + include: [/.*/], + exclude: [/\/login/, /\/socket\/(.*)/, /\/publics/, /\/authorize/], + }, + ], + + i18n: { + languages: [ + { + key: 'en', + title: 'English', + }, + ], + defaultLanguage: 'en', + }, +} diff --git a/.prev/dev-server.sh b/.prev/dev-server.sh new file mode 100644 index 00000000..1dc991f4 --- /dev/null +++ b/.prev/dev-server.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +pause(){ + read -p "Press [Enter] key to continue..." fackEnterKey +} + +start_cli_dev(){ + sudo npm start +} + +start_dev(){ + sudo systemctl start comty_dev + echo "Starting dev server..." +} + +stop_dev(){ + sudo systemctl stop comty_dev + echo "Stoping dev server..." +} +show_logs(){ + sudo journalctl -u comty_dev +} +update(){ + git reset --merge&&git fetch --all&&git reset --hard origin/master + + +} + +show_menus() { + clear + echo "~~~~~~~~~~~~~~~~~~~~~" + echo " Development Server " + echo "~~~~~~~~~~~~~~~~~~~~~" + echo "1. Start CLI Server" + echo "2. Start Server" + echo "3. Stop Server" + echo "4. Show DevServer Logs" + echo "5. Update from Git" + echo "" + echo "0. Exit" +} + +read_options(){ + local choice + read -p "Enter choice [ 1 - 5 ] " choice + case $choice in + 0) exit 0;; + 1) start_cli_dev ;; + 2) start_dev ;; + 3) stop_dev ;; + 4) show_logs;; + 5) update;; + *) echo -e "${RED}Error...${STD}" && sleep 2 + esac +} + +trap '' SIGINT SIGQUIT SIGTSTP + +while true +do + + show_menus + read_options +done \ No newline at end of file diff --git a/.prev/dist-server.sh b/.prev/dist-server.sh new file mode 100644 index 00000000..d99979fc --- /dev/null +++ b/.prev/dist-server.sh @@ -0,0 +1,59 @@ +#!/bin/sh + +pause(){ + read -p "Press [Enter] key to continue..." fackEnterKey +} + +start_cli_dev(){ + sudo serve ./dist +} + +start_dev(){ + sudo systemctl start comty_dist + echo "Starting dev server..." +} + +stop_dev(){ + sudo systemctl stop comty_dist + echo "Stoping dev server..." +} +show_logs(){ + sudo journalctl -u comty_dist + pause +} + + +show_menus() { + clear + echo "~~~~~~~~~~~~~~~~~~~~~" + echo " BuildServe Server " + echo "~~~~~~~~~~~~~~~~~~~~~" + echo "1. Start CLI Server" + echo "2. Start Server" + echo "3. Stop Server" + echo "4. Show DevServer Logs" + echo "" + echo "0. Exit" +} + +read_options(){ + local choice + read -p "Enter choice [ 1 - 4 ] " choice + case $choice in + 0) exit 0;; + 1) start_cli_dev ;; + 2) start_dev ;; + 3) stop_dev ;; + 4) show_logs;; + *) echo -e "${RED}Error...${STD}" && sleep 2 + esac +} + +trap '' SIGINT SIGQUIT SIGTSTP + +while true +do + + show_menus + read_options +done \ No newline at end of file diff --git a/.prev/globals/badges_list.js b/.prev/globals/badges_list.js new file mode 100644 index 00000000..d39f752a --- /dev/null +++ b/.prev/globals/badges_list.js @@ -0,0 +1,45 @@ +import * as Icons from '@ant-design/icons' + + +export var BadgesType = [ + { + id: 'alpha_test', + title: 'Alpha Tester', + color: 'green', + require: '', + icon: (), + tip: 'Oh yeah!' + }, + { + id: 'nsfw_flag', + title: 'NSFW', + color: 'volcano', + require: 'nsfw_flag', + icon: (), + tip: 'NSFW', + }, + { + id: 'pro', + title: 'CPRO™', + color: 'purple', + require: 'pro', + icon: (), + tip: 'CPRO™', + }, + { + id: 'dev', + title: 'DEVELOPER', + color: 'default', + require: 'dev', + icon: (), + tip: 'DEVELOPER', + }, + { + id: 'professional_retarder', + title: 'Professional Retarder', + color: 'gold', + require: '', + icon: (), + tip: 'hump....', + } +] diff --git a/.prev/globals/debug.json b/.prev/globals/debug.json new file mode 100644 index 00000000..8816f6a8 --- /dev/null +++ b/.prev/globals/debug.json @@ -0,0 +1,23 @@ +[ + { + "id": "1", + "title": "PINS", + "avatar": "https://dl.ragestudio.net/statics/icons/nxkuOJlFJuAUhzlMTCEe.png", + "description": "Debug pins functions, create, modify, delete...", + "component": "PINS_debugger" + }, + { + "id": "2", + "title": "SDCP™", + "avatar":"https://dl.ragestudio.net/statics/icons/nxkuOJlFJuAUhzlMTCEe.png", + "description": "Debug SDCP Controller and data proccess", + "component": "SDCP_debugger" + }, + { + "id": "3", + "title": "API", + "avatar": "https://dl.ragestudio.net/statics/icons/nxkuOJlFJuAUhzlMTCEe.png", + "description": "Debug API Controller and data proccess", + "component": "API_debugger" + } +] \ No newline at end of file diff --git a/.prev/globals/endpoints.js b/.prev/globals/endpoints.js new file mode 100644 index 00000000..7ddc39e1 --- /dev/null +++ b/.prev/globals/endpoints.js @@ -0,0 +1,23 @@ +module.exports = { + Endpoints: { + comments_actions: "https://api.ragestudio.net/RSA-COMTY/r/comments?access_token=", + get_post_data: "https://api.ragestudio.net/RSA-COMTY/r/get-post-data?access_token=", + get_user_tags: "https://api.ragestudio.net/RSA-COMTY/r/user_tags?access_token=", + get_general_data: "https://api.ragestudio.net/RSA-COMTY/r/get-general-data?access_token=", + follow_user: "https://api.ragestudio.net/RSA-COMTY/r/follow-user?access_token=", + action_post: "https://api.ragestudio.net/RSA-COMTY/r/post-actions?access_token=", + get_posts: "https://api.ragestudio.net/RSA-COMTY/r/posts?access_token=", + find_user: "https://api.ragestudio.net/RSA-COMTY/r/find_user?access_token=", + search_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/search?access_token=", + all_sessions: "https://api.ragestudio.net/RSA-COMTY/r/sessions?access_token=", + get_sessions: "https://api.ragestudio.net/RSA-COMTY/r/session_id?access_token=", + auth_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/auth", + new_post: "https://comty.julioworld.club/api/new_post?access_token=", + get_config_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/get-site-settings?access_token=", + get_userData_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/get-user-data?access_token=", + update_userData_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/update-user-data?access_token=", + removeToken: "https://api.ragestudio.net/RSA-COMTY/r/delete-access-token?access_token=", + register_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/create-account", + resetPassword_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/send-reset-password-email?access_token=", + } +} \ No newline at end of file diff --git a/.prev/globals/endpoints/comty_endpoints.js b/.prev/globals/endpoints/comty_endpoints.js new file mode 100644 index 00000000..f35e04ff --- /dev/null +++ b/.prev/globals/endpoints/comty_endpoints.js @@ -0,0 +1,23 @@ +module.exports={ + comty_endpoints: { + comments_actions: "https://api.ragestudio.net/RSA-COMTY/r/comments?access_token=", + get_post_data: "https://api.ragestudio.net/RSA-COMTY/r/get-post-data?access_token=", + get_user_tags: "https://api.ragestudio.net/RSA-COMTY/r/user_tags?access_token=", + get_general_data: "https://api.ragestudio.net/RSA-COMTY/r/get-general-data?access_token=", + follow_user: "https://api.ragestudio.net/RSA-COMTY/r/follow-user?access_token=", + action_post: "https://api.ragestudio.net/RSA-COMTY/r/post-actions?access_token=", + get_posts: "https://api.ragestudio.net/RSA-COMTY/r/posts?access_token=", + find_user: "https://api.ragestudio.net/RSA-COMTY/r/find_user?access_token=", + search_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/search?access_token=", + all_sessions: "https://api.ragestudio.net/RSA-COMTY/r/sessions?access_token=", + get_sessions: "https://api.ragestudio.net/RSA-COMTY/r/session_id?access_token=", + auth_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/auth", + new_post: "https://comty.julioworld.club/api/new_post?access_token=", + get_config_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/get-site-settings?access_token=", + get_userData_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/get-user-data?access_token=", + update_userData_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/update-user-data?access_token=", + removeToken: "https://api.ragestudio.net/RSA-COMTY/r/delete-access-token?access_token=", + register_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/create-account", + resetPassword_endpoint: "https://api.ragestudio.net/RSA-COMTY/r/send-reset-password-email?access_token=", + } +} \ No newline at end of file diff --git a/.prev/globals/endpoints/index.js b/.prev/globals/endpoints/index.js new file mode 100644 index 00000000..d7e3836d --- /dev/null +++ b/.prev/globals/endpoints/index.js @@ -0,0 +1,2 @@ +export * from './comty_endpoints.js' +export * from './twitter_endpoints.js' \ No newline at end of file diff --git a/.prev/globals/endpoints/twitter_endpoints.js b/.prev/globals/endpoints/twitter_endpoints.js new file mode 100644 index 00000000..ba18f6ab --- /dev/null +++ b/.prev/globals/endpoints/twitter_endpoints.js @@ -0,0 +1,6 @@ +module.exports = { + twitter_endpoints: { + oa_access: "https://api.twitter.com/oauth/access_token", + oa_request: "https://api.twitter.com/oauth/request_token", + } +} \ No newline at end of file diff --git a/.prev/globals/post_options.js b/.prev/globals/post_options.js new file mode 100644 index 00000000..740a5912 --- /dev/null +++ b/.prev/globals/post_options.js @@ -0,0 +1,22 @@ +import * as Icons from '@ant-design/icons' + +export var Post_Options = [ + { + key: 'pro_boost', + icon: , + type: 'switch', + title: 'CPRO™ Boost', + description: '', + require: 'pro', + value: false, + }, + { + key: 'allow_comments', + icon: , + type: 'switch', + title: 'Allow Comments', + description: '', + require: '', + value: true, + }, +] diff --git a/.prev/globals/settings.js b/.prev/globals/settings.js new file mode 100644 index 00000000..db006dcc --- /dev/null +++ b/.prev/globals/settings.js @@ -0,0 +1,62 @@ +const fromStorage = JSON.parse(localStorage.getItem('app_settings')) + +function SettingStoragedValue(e) { + try { + const fromStorage = JSON.parse(localStorage.getItem('app_settings')) + const Ite = fromStorage.map(item => { + return item.SettingID === e ? item.value : null + }) + const fr = Ite.filter(Boolean) + return fr.toString() + } catch (error) { + return null + } +} + +export var ListSettings = [ + { + SettingID: 'disable_pro_tool', + type: 'switch', + title: 'Hide Pro Tools', + description: 'Hide right sidebar utils of comty pro', + value: fromStorage ? SettingStoragedValue('disable_pro_tool') : false, + }, + { + SettingID: 'sessions_noexpire', + type: 'switch', + title: 'No expire session', + description: 'Force the app to not expire any session... [Developer]', + value: fromStorage ? SettingStoragedValue('sessions_noexpire') : false, + }, + { + SettingID: 'auto_feedrefresh', + type: 'switch', + title: 'Auto Feed Refresh', + description: + 'Force the app to auto refresh the posts feed when exist news posts for update', + value: fromStorage ? SettingStoragedValue('auto_feedrefresh') : false, + }, + { + SettingID: 'auto_search_ontype', + type: 'switch', + title: 'Detect input on search bar', + description: + 'Force the app to automaticly search when a type input is detected... [Developer]', + value: fromStorage ? SettingStoragedValue('auto_search_ontype') : false, + }, + { + SettingID: 'auto_hide_postbar', + type: 'switch', + title: 'Auto hide postbar', + description: + 'Force the app to dont hide the post actions (likes, comments ...etc) automaticly... [Developer]', + value: fromStorage ? SettingStoragedValue('auto_hide_postbar') : true, + }, + { + SettingID: 'force_showDevLogs', + type: 'switch', + title: 'Show Functions Logs', + description: 'Show all console logs... [Developer]', + value: fromStorage ? SettingStoragedValue('force_showDevLogs') : false, + }, +] diff --git a/.prev/jest.config.js b/.prev/jest.config.js new file mode 100644 index 00000000..c52ac835 --- /dev/null +++ b/.prev/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + testURL: 'http://localhost:8000', +} diff --git a/.prev/manifest.json b/.prev/manifest.json new file mode 100644 index 00000000..5668584c --- /dev/null +++ b/.prev/manifest.json @@ -0,0 +1,12 @@ +{ + "name": "Comty", + "start_url": ".", + "display": "standalone", + "background_color": "white", + "description": "RageStudio users dashboard", + "icons": [ + { + "src": "logo.svg" + } + ] +} diff --git a/.prev/package.json b/.prev/package.json new file mode 100644 index 00000000..0d0a8b6a --- /dev/null +++ b/.prev/package.json @@ -0,0 +1,131 @@ +{ + "name": "comty-development", + "UUID": "C8mVSr-4nmPp2-pr5Vrz-CU4kg4", + "title": "Comty™", + "DevBuild": true, + "version": "0.3.02", + "stage": "dev-pre", + "description": "", + "main": "app/main.js", + "author": "RageStudio", + "license": "ISC", + "build": { + "appId": "com.ragestudio.comtydesktop", + "mac": { + "category": "ragestudio.comty.social.desktop" + } + }, + "dependencies": { + "@ant-design/compatible": "^1.0.1", + "@ant-design/pro-layout": "^5.0.6", + "@capacitor/android": "^1.5.2", + "@capacitor/cli": "^1.5.2", + "@capacitor/core": "^1.5.2", + "@lingui/react": "^2.9.1", + "@material-ui/core": "^4.9.3", + "@material-ui/icons": "^4.9.1", + "antd": "^4.1.0", + "axios": "^0.19.2", + "bag.js": "0.0.2", + "classnames": "^2.2.6", + "cryptr": "^6.0.1", + "dotenv": "^8.2.0", + "dva": "2.4.1", + "dva-model-extend": "^0.1.2", + "enquire-js": "^0.2.1", + "jquery": "^3.4.1", + "jsonwebtoken": "^8.5.1", + "localforage": "^1.7.3", + "lodash": "^4.17.15", + "md5": "^2.2.1", + "moment": "^2.24.0", + "node-sass": "^4.13.1", + "nprogress": "^0.2.0", + "os-utils": "0.0.14", + "path-to-regexp": "^6.1.0", + "plyr-react": "^2.2.0", + "prop-types": "^15.7.2", + "radium": "^0.26.0", + "react-animations": "^1.0.0", + "react-dazzle": "^1.4.0", + "react-google-recaptcha": "^2.0.1", + "react-helmet": "^5.2.1", + "react-perfect-scrollbar": "^1.5.8", + "react-reveal": "^1.2.2", + "react-scripts": "^3.4.1", + "react-select-country-list": "^2.1.2", + "react-sound": "^1.2.0", + "react-virtualized": "^9.21.2", + "socket.io-client": "^2.3.0", + "store": "^2.0.12", + "timeago.js": "^4.0.2", + "ts-cookies": "^1.0.0", + "umi-plugin-datahub": "^4.1.0", + "validator": "^12.2.0" + }, + "devDependencies": { + "@lingui/babel-preset-react": "^2.9.1", + "@lingui/cli": "^2.9.1", + "@lingui/loader": "^2.9.1", + "@types/react": "^16.9.19", + "babel-core": "7.0.0-bridge.0", + "babel-eslint": "^10.0.3", + "babel-plugin-dev-expression": "^0.2.2", + "babel-plugin-import": "^1.13.0", + "babel-plugin-macros": "^2.8.0", + "babel-plugin-module-resolver": "^4.0.0", + "cross-env": "^7.0.0", + "eslint": "^6.8.0", + "eslint-config-react-app": "^5.2.0", + "eslint-plugin-flowtype": "^4.6.0", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-jsx-a11y": "^6.2.3", + "eslint-plugin-react": "^7.18.3", + "husky": "^4.2.3", + "less-vars-to-js": "^1.3.0", + "lint-staged": "^10.0.7", + "module": "^1.2.5", + "now": "^17.0.3", + "prettier": "^1.19.1", + "rimraf": "^3.0.2", + "stylelint": "^13.1.0", + "stylelint-config-prettier": "^8.0.1", + "stylelint-config-standard": "^20.0.0", + "typescript": "^3.8.3", + "umi": "^2.13.3", + "umi-plugin-react": "^1.15.2", + "wait-on": "^4.0.0", + "workbox-webpack-plugin": "^5.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "lingui": { + "fallbackLocale": "en", + "sourceLocale": "en", + "localeDir": "src/locales", + "srcPathDirs": [ + "src/pages", + "src/layouts", + "src/components", + "src/layouts" + ], + "format": "minimal", + "extractBabelOptions": { + "presets": [ + "umi/babel" + ] + } + }, + "scripts": { + "clean": "rimraf dist", + "analyze": "cross-env ANALYZE=1 umi build", + "build": "umi build", + "start": "umi dev", + "test": "cross-env BABELRC=none umi test", + "prettier": "prettier --write 'src/**/*.{js,less}'", + "add-locale": "lingui add-locale", + "extract": "lingui extract", + "trans": "lingui extract --clean && node ./scripts/translate.js" + } +} diff --git a/.prev/public/dark_full_logo.svg b/.prev/public/dark_full_logo.svg new file mode 100644 index 00000000..78e90e9a --- /dev/null +++ b/.prev/public/dark_full_logo.svg @@ -0,0 +1 @@ +BalckComtyNG-Logo \ No newline at end of file diff --git a/.prev/public/dark_logo.svg b/.prev/public/dark_logo.svg new file mode 100644 index 00000000..ef799d4a --- /dev/null +++ b/.prev/public/dark_logo.svg @@ -0,0 +1 @@ +black_icon_new2019_black \ No newline at end of file diff --git a/.prev/public/favicon.ico b/.prev/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..ad1b1170aed68fb9483c3823d96300560cfc0b6a GIT binary patch literal 16958 zcmeHNONbps6s_k322mUWDk{PZ$!1Xe#E2gVGeew!pOp*6r65KWMO;W+guEwy2)NQ+ zKoAiXqqtBU@JF6RjDibwCm1q8Q6qlF5Bdh5)1Fh^x2@N9efsz2y~$KKx!t$!t-j~p zs_N>ODAmHBg$0GbXVmO&rOsDM%>q!V4nVzb3$fVzdou%@8Q9DKGZ015dSe@6xDD8s zgGK1Jx+;Z!9ly)Q)hGT#mRs>W@;wfOw8Jpko5utCapEt$LpbNzFkb_C7$g3i%c1qo z<8JCWAN0C_9EbYvHG{9|nz`IL2K<}gE-Cz3a*($-gyDKn0lU-7R|lAEisewFJc9AqrHFDk{qM(N|v{cI!i_r15$ zxz9XQZIa8f(WcD%pJ$+fZ@n_(n0ux8 z*DQVKKkku*_`_blCkMWFi;iP*=e79PEN$N`cud+@%WOE-d)S&|ra9mkMaIcKK>TZ# zA!`7S9Q-Xa8=Kt2&g4!%Hk|{=QRL5L0ZHsxUcvWEm^ zDZc>D0}ADU_DLQ>_eRe30p3#QA@RQ(F`K;2>-W)jW|P|_kW=OK_DmxRe6iQm#57j-n(8jIQ@z1 z#~ktRLEmqNy~*9YehW6&JI2xZk@%}h8$GW+KF^qO%Qg3WTMg&X=bHx{=O5sC;7TBO ztg5`l-^(JpBpS9|rCLE~&~}{JlJF220V+h=cPqFIMWl0WJs9nq{uf!2J`z zDqtJKrsrP6-#hdfzKXQb^Xg+>k9%VO8vUH_wj5B;z3vELGk#=~CpM%X5;L8Kg%{)`R4y*uq{C|Od`-t!-p9_FbEU}vLv$i(?z8pyZ3~cWN zUID%WxSlxQc2(t0|I#f#e$LOnoNaI~wYSO<=Fga0zyW}D&T`JX{}OhO02cyQ&Su|;^A`@>!@dRbIOplUhwU@K zwE%M{+0ise@^1BDu>Kp@^TqCya240%mdFETdH!Wf9aN4 zkBCRO6_NZ#eiq>TcGW!FNBgM_z+ZC3_uhTLhk)ywTJrE2>^4IEg}*6xfZP5g7r#OZ zXOTQp+)+pEM_~S&yz{PS!1Z?EDS*Eh@jbc-to#0t+uc8iR zU(IO(5|6}3*`@&`Mby#qWYkp?xa;D3m63GXeKk!vuZtCRc!SpAwuRP>!#%c4rzo0O zi3e--bP^)fkFy2xxComtyNG-Logo \ No newline at end of file diff --git a/.prev/public/logo.svg b/.prev/public/logo.svg new file mode 100644 index 00000000..afd838cd --- /dev/null +++ b/.prev/public/logo.svg @@ -0,0 +1 @@ +icon_new2019_black \ No newline at end of file diff --git a/.prev/service-worker.js b/.prev/service-worker.js new file mode 100644 index 00000000..54a3962a --- /dev/null +++ b/.prev/service-worker.js @@ -0,0 +1,133 @@ +// This optional code is used to register a service worker. +// register() is not called by default. + +// This lets the app load faster on subsequent visits in production, and gives +// it offline capabilities. However, it also means that developers (and users) +// will only see deployed updates on subsequent visits to a page, after all the +// existing tabs open on the page have been closed, since previously cached +// resources are updated in the background. + +// To learn more about the benefits of this model and instructions on how to +// opt-in, read http://bit.ly/CRA-PWA + +const isLocalhost = Boolean( + window.location.hostname === 'localhost' || + // [::1] is the IPv6 localhost address. + window.location.hostname === '[::1]' || + // 127.0.0.1/8 is considered localhost for IPv4. + window.location.hostname.match( + /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ + ) +); + +export function register(config) { + if ('serviceWorker' in navigator) { + console.log("The URL constructor is available in all browsers that support SW") + const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); + if (publicUrl.origin !== window.location.origin) { + console.log("Our service worker won't work if PUBLIC_URL is on a different origin from what our page is served on.") + return; + } + + window.addEventListener('load', () => { + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + console.log('Loading event...') + if (isLocalhost) { + // This is running on localhost. Let's check if a service worker still exists or not. + checkValidServiceWorker(swUrl, config); + + // Add some additional logging to localhost, pointing developers to the + // service worker/PWA documentation. + navigator.serviceWorker.ready.then(() => { + console.log( + 'This web app is being served cache-first by a service ' + + 'worker. To learn more, visit http://bit.ly/CRA-PWA' + ); + }); + } else { + // Is not localhost. Just register service worker + registerValidSW(swUrl, config); + } + }); + } +} + +function registerValidSW(swUrl, config) { + navigator.serviceWorker + .register(swUrl) + .then(registration => { + registration.onupdatefound = () => { + const installingWorker = registration.installing; + if (installingWorker == null) { + return; + } + installingWorker.onstatechange = () => { + if (installingWorker.state === 'installed') { + if (navigator.serviceWorker.controller) { + // At this point, the updated precached content has been fetched, + // but the previous service worker will still serve the older + // content until all client tabs are closed. + console.log( + 'New content is available and will be used when all ' + + 'tabs for this page are closed. See http://bit.ly/CRA-PWA.' + ); + + // Execute callback + if (config && config.onUpdate) { + config.onUpdate(registration); + } + } else { + // At this point, everything has been precached. + // It's the perfect time to display a + // "Content is cached for offline use." message. + console.log('Content is cached for offline use.'); + + // Execute callback + if (config && config.onSuccess) { + config.onSuccess(registration); + } + } + } + }; + }; + }) + .catch(error => { + console.error('Error during service worker registration:', error); + }); +} + +function checkValidServiceWorker(swUrl, config) { + // Check if the service worker can be found. If it can't reload the page. + fetch(swUrl) + .then(response => { + // Ensure service worker exists, and that we really are getting a JS file. + const contentType = response.headers.get('content-type'); + if ( + response.status === 404 || + (contentType != null && contentType.indexOf('javascript') === -1) + ) { + // No service worker found. Probably a different app. Reload the page. + navigator.serviceWorker.ready.then(registration => { + registration.unregister().then(() => { + window.location.reload(); + }); + }); + } else { + // Service worker found. Proceed as normal. + registerValidSW(swUrl, config); + } + }) + .catch(() => { + console.log( + 'No internet connection found. App is running in offline mode.' + ); + }); +} + +export function unregister() { + if ('serviceWorker' in navigator) { + navigator.serviceWorker.ready.then(registration => { + registration.unregister(); + }); + } +} diff --git a/.prev/setupTests.js b/.prev/setupTests.js new file mode 100644 index 00000000..330f214a --- /dev/null +++ b/.prev/setupTests.js @@ -0,0 +1,6 @@ +const Enzyme = require('enzyme'); +// this is where we reference the adapter package we installed +// earlier +const EnzymeAdapter = require('enzyme-adapter-react-16'); +// This sets up the adapter to be used by Enzyme +Enzyme.configure({ adapter: new EnzymeAdapter() }); \ No newline at end of file diff --git a/.prev/src/@ycore/libs.js b/.prev/src/@ycore/libs.js new file mode 100644 index 00000000..d405bf00 --- /dev/null +++ b/.prev/src/@ycore/libs.js @@ -0,0 +1,8 @@ +// List of modules used for this app +export * from './libs/comty_ng/pre.js'; +export * from './libs/ycore_sync/pre.js'; +export * from './libs/yulio_id/pre.js'; +export * from './libs/ycore_styles/pre.js'; +export * from './libs/ycore_sdcp/pre.js'; +export * from './libs/app_functions/pre.js'; +export * from './libs/rs_cloud/pre.js'; \ No newline at end of file diff --git a/.prev/src/@ycore/libs/app_functions/modals.js b/.prev/src/@ycore/libs/app_functions/modals.js new file mode 100644 index 00000000..4ee4be38 --- /dev/null +++ b/.prev/src/@ycore/libs/app_functions/modals.js @@ -0,0 +1,126 @@ +import React from 'react' +import * as ycore from 'ycore' +import * as antd from 'antd' +import * as Icons from '@ant-design/icons' +import styles from './modals.less'; +import classnames from 'classnames' + +const isMobile = localStorage.getItem('mobile_src') + +class __Model_postreport extends React.PureComponent { + state = { + step: 1 + } + end(){ + if(this.props.id){ + const payload = { post_id: this.props.id } + ycore.comty_post.__report((err, res) => { + if (err) { + return false + } + ycore.notify.info('This post has been reported successfully, our team will review it and inform you about problem resolution ...') + ycore.FeedHandler.refresh() + ycore.FeedHandler.goToElement(this.props.id) + }, payload) + } + setTimeout(() => { + ycore.SecondarySwap.close() + }, 500) + + } + next(){ + let a = this.state.step + + if(a<3)a++ + this.setState({step: a }) + } + status(i){ + const a = this.state.step + if (a==i) return 'process' + if (a>i) return 'finish' + if (a +

Report an post

+

This tool is intended for the community in a public way to help identify problematic or abusive content and for legitimate purposes.


+

To ensure the proper use of this tool, before proceeding, you must understand the following:

+ I understand and agree that my complaint may be sent to the party that posted the content in question. + I understand that the abuse of this tool may have consequences for my account +

{this.state.term_1 && this.state.term_2? this.next()} >Next : null} + + ) + case 2: + return( +
+
+

For this report or complaint to be fair, make sure that the reason is for the following reasons:

+
+

- Harmful content or hate speech

+

- Violent or repulsive content

+

- Misleading advertising or spam

+

- Illegal activities

+

- Sexual content

+

- Or any other activity that violates the terms and conditions of use

+ I am sure and understand that the reason for this report is included in the above list. +

{this.state.term_3? this.next()} >Next : null} + +
+ ) + case 3: + return ( +
+
+

Given the above circumstances, to send this report or report please confirm that you understand and are following that you want to carry out this action

+ I am sure of what I do and I want to send this complaint or report +

{this.state.term_confirm? this.end()} >Send report : null} + +
+ ) + default: + return null + } + } + validate = { + term_1: (e) =>{this.setState({ term_1: e.target.checked })}, + term_2: (e) =>{this.setState({ term_2: e.target.checked })}, + term_3: (e) =>{this.setState({ term_3: e.target.checked })}, + confirm: (e) =>{this.setState({ term_confirm: e.target.checked })} + } + + render(){ + return( +
+
+ + } /> + } /> + } /> + +
+ {this.renderStep()} +
+ ) + } +} + + +export const app_modals = { + report_post: (post_id) => { + antd.Modal.confirm({ + title: 'Report an post', + icon: , + content: 'It seems that you want to report this post, first of all it is necessary that you take into account that this tool is only intended for serious cases and we need you to comply with some questions to be able to report this post and to guarantee the quality of service ...', + onOk() { + return ycore.SecondarySwap.openFragment(<__Model_postreport id={post_id} />) + }, + onCancel() { + return false + }, + }); + } +} \ No newline at end of file diff --git a/.prev/src/@ycore/libs/app_functions/modals.less b/.prev/src/@ycore/libs/app_functions/modals.less new file mode 100644 index 00000000..9b9266d3 --- /dev/null +++ b/.prev/src/@ycore/libs/app_functions/modals.less @@ -0,0 +1,9 @@ +.post_report_main{ + padding: 0 0 0 115px; + &.mobile{ + padding: 0 0 60px 0; + } +} +.post_report_body{ + color: #2d2d2d!important; +} \ No newline at end of file diff --git a/.prev/src/@ycore/libs/app_functions/pre.js b/.prev/src/@ycore/libs/app_functions/pre.js new file mode 100644 index 00000000..3e5c5f8d --- /dev/null +++ b/.prev/src/@ycore/libs/app_functions/pre.js @@ -0,0 +1,219 @@ +import { RenderFeed } from 'components/MainFeed' +import { transitionToogle } from '../../../pages/login' +import { SetControls, CloseControls } from '../../../components/Layout/Control' +import { SwapMode } from '../../../components/Layout/Secondary' +import umiRouter from 'umi/router' +import * as ycore from 'ycore' +import * as antd from 'antd' +import * as Icons from '@ant-design/icons' +import React from 'react' + +export * from './modals.js' + + + +export function QueryRuntime() { + const validBackup = ycore.validate.backup() + + if (!validBackup) ycore.make_data.backup() + ycore.sync.listen((data) => { + + }) + +} + +export function SetupApp() { + // TODO: Default sets + ycore.notify.success('Authorised, please wait...') + const resourceLoad = localStorage.getItem('resource_bundle') + if (!resourceLoad) { + localStorage.setItem('resource_bundle', 'light_ng') + } + setTimeout(() => { + ycore.router.push('main') + }, 500) +} + +export const CheckThisApp = { + desktop_mode: () => { + const a = localStorage.getItem('desktop_src') + if (a == 'true') { + return true + } + return false + }, +} + +export const SecondarySwap = { + close: () => { + SwapMode.close() + }, + openPost: e => { + SwapMode.openPost(e) + }, + openSearch: e => { + SwapMode.openSearch(e) + }, + openFragment: e =>{ + SwapMode.openFragment(e) + } +} + +export const ControlBar = { + set: e => { + SetControls(e) + }, + close: () => { + CloseControls() + }, +} + +export const FeedHandler = { + refresh: () => { + RenderFeed.RefreshFeed() + }, + killByID: (post_id) => { + RenderFeed.killByID(post_id) + }, + addToRend: (payload) => { + RenderFeed.addToRend(payload) + }, + goToElement: post_id => { + RenderFeed.goToElement(post_id) + }, + sync: data => { + RenderFeed.sync(data) + } +} + +export const LoginPage = { + transitionToogle: () => { + transitionToogle() + }, +} + +export const router = { + go: e => { + goTo.element('primaryContent') + umiRouter.push({ + pathname: `/${e}`, + search: window.location.search, + }) + }, + push: e => { + umiRouter.push({ + pathname: `/${e}`, + search: window.location.search, + }) + }, + goprofile: () => { + goTo.element('primaryContent') + umiRouter.push({ + pathname: `/@${ycore.userData().username}`, + search: window.location.search, + }) + } +} + +export const goTo = { + top: (id)=> { + const element = document.getElementById(id) + element.scrollTop = element.scrollHeight + element.clientHeight + }, + bottom: (id) => { + const element = document.getElementById(id) + element.scrollTop = element.scrollHeight - element.clientHeight + }, + element: (element) => { + try { + document.getElementById(element).scrollIntoView() + } catch (error) { + return false + } + } + +} + +export function RefreshONCE() { + window.location = '/' +} + +export const app_session = { + login: (callback, payload) => { + if (!payload) { + return false + } + const { EncUsername, EncPassword } = payload + + let username = atob(EncUsername) + let password = atob(EncPassword) + + const containerpayload = { username, password } + ycore.__rscloud.yulio_id.auth((err, res) => { + if (err) { + return false + } + try { + var identState = JSON.parse(res)['api_status'] + if (identState == 200) { + const UserID = JSON.parse(res)['user_id'] + const UserToken = JSON.parse(res)['access_token'] + + const preframepayload = { user_token: UserToken, user_id: UserID} + ycore.__rscloud.sdcp_cloud.get( + (err, res) => { + if (err) { + return false + } + + let framepayload = { token: { UserID, UserToken }, sdcp: res } + ycore.yconsole.log('FRAME ', framepayload) + + ycore.__CTID_GEN((err, res) => { + if (err) { + ycore.notify.error('Critical error, token declined!') + return false + } + ycore.SetupApp() + callback(null, '200') + }, framepayload) + }, + preframepayload + ) + } + if (identState == 400) { + callback(null, '400') + } + } catch (error) { + console.log(error) + callback(true, '500') + ycore.notify.error('Server bad response') + } + }, containerpayload) + }, + logout: () => { + ycore.__rscloud.yulio_id.logout((err, res) => { + if (err) { + return false + } + console.log(res) + const api_state = JSON.parse(res)['api_status'] + ycore.yconsole.log(`Exit with => ${api_state}`) + if (api_state == '404') { + antd.notification.open({ + placement: 'topLeft', + message: 'Unexpectedly failed logout in YulioID™ ', + description: + 'It seems that your token has been removed unexpectedly and could not log out from YulioID ', + icon: , + }) + ycore.yconsole.log('Failed logout with YulioID™', res) + } else { + ycore.yconsole.log('Successful logout with YulioID™', res) + } + // Runtime after dispatch API + ycore.token_data.remove() + ycore.router.push('login') + }) + }, +} diff --git a/.prev/src/@ycore/libs/comty_ng/comty_get.js b/.prev/src/@ycore/libs/comty_ng/comty_get.js new file mode 100644 index 00000000..2e0eb133 --- /dev/null +++ b/.prev/src/@ycore/libs/comty_ng/comty_get.js @@ -0,0 +1,65 @@ +import { API_Call, endpoints, sdcp } from 'ycore' + +export const comty_get = { + sessions: (callback) => { + let formdata = new FormData() + formdata.append('type', 'get') + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.all_sessions, + formdata + ) + }, + session_id: callback => { + let formdata = new FormData() + formdata.append('type', 'get') + + API_Call((err,res) => { + if (err) return false + try { + const a = JSON.parse(res)['data'] + return callback(err, a.session_id) + } catch (error) { + return callback(err, '0x0000') + } + }, + endpoints.comty_endpoints.get_sessions, + formdata) + }, + session: (callback) => { + let formdata = new FormData() + formdata.append('type', 'get') + + API_Call((err,res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.get_sessions, + formdata) + }, + general_data: (callback, payload) => { + let formdata = new FormData(); + let callOptions = { includeUserID: false }; + + if (!payload) { + callOptions = { includeUserID: true } + formdata.append('fetch', 'notifications,friend_requests,pro_users,promoted_pages,trending_hashtag,count_new_messages') + } + + if (payload) { + payload.user_id? formdata.append('user_id', payload.user_id) : null + payload.fetch? formdata.append('fetch', payload.fetch) : null + } + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.get_general_data, + formdata, callOptions + ) + + }, +} diff --git a/.prev/src/@ycore/libs/comty_ng/comty_post.js b/.prev/src/@ycore/libs/comty_ng/comty_post.js new file mode 100644 index 00000000..e7f06dc7 --- /dev/null +++ b/.prev/src/@ycore/libs/comty_ng/comty_post.js @@ -0,0 +1,209 @@ +import { API_Call, endpoints, AppSettings, yconsole } from 'ycore' + +export const comty_post = { + getFeed: (callback, payload) => { + if (!payload) { + return false + } + const { fkey, type, id } = payload + + let formdata = new FormData() + formdata.append('after_post_id', fkey || 0) + formdata.append('limit', AppSettings.limit_post_catch || 20) + switch (type) { + case 'feed': + formdata.append('type', 'get_news_feed') + break + case 'user': + formdata.append('type', 'get_user_posts') + formdata.append('id', id) + break + default: + formdata.append('type', 'get_news_feed') + break + } + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.get_posts, + formdata + ) + }, + get: (callback, payload) => { + if (!payload) { + return false + } + const { post_id, fetch } = payload + + let formdata = new FormData() + formdata.append('post_id', post_id) + formdata.append( + 'fetch', + fetch || 'post_data,post_comments,post_wondered_users,post_liked_users' + ) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.get_post_data, + formdata + ) + }, + new: (callback, payload) => { + if (!payload) { + return false + } + const { privacy, text, file } = payload + + let formdata = new FormData() + formdata.append('type', 'new_post') + formdata.append('postPrivacy', privacy) + formdata.append('postText', text) + file ? formdata.append('uploadFile', file) : null + + const callOptions = { includeUserID: true } + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.new_post, + formdata, + callOptions + ) + }, + delete: (callback, payload) => { + if (!payload) { + return false + } + const { post_id } = payload + + let formdata = new FormData() + formdata.append('action', 'delete') + formdata.append('post_id', post_id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.action_post, + formdata + ) + }, + save: (callback, payload) => { + if (!payload) { + return false + } + const { post_id } = payload + + let formdata = new FormData() + formdata.append('action', 'save') + formdata.append('post_id', post_id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.action_post, + formdata + ) + }, + like: (callback, payload) => { + if (!payload) { + return false + } + const { post_id } = payload + + let formdata = new FormData() + formdata.append('action', 'like') + formdata.append('post_id', post_id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.action_post, + formdata + ) + }, + getSaved: (callback, payload) => { + if (!payload) { + yconsole.log( + 'Calling api without Payload!!! | Limmit & OffsetKey = default |' + ) + } + if (payload) { + const { limit, fkey } = payload + } + + let formdata = new FormData() + formdata.append('type', 'saved') + formdata.append('limit', payload? limit : AppSettings.limit_post_catch || 20) + formdata.append('after_post_id', payload? fkey : 0) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.get_posts, + formdata + ) + }, + edit: (callback, payload) => {}, + __pin: (callback, payload) => {}, + __boost: (callback, payload) => { + if (!payload) { + return false + } + const { post_id } = payload + + let formdata = new FormData() + formdata.append('action', 'boost') + formdata.append('post_id', post_id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.action_post, + formdata + ) + }, + __disableComments: (callback, payload) => { + if (!payload) { + return false + } + const { post_id } = payload + + let formdata = new FormData() + formdata.append('action', 'disable_comments') + formdata.append('post_id', post_id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.action_post, + formdata + ) + }, + __report: (callback, payload) => { + if (!payload) { + return false + } + const { post_id } = payload + + let formdata = new FormData() + formdata.append('action', 'report') + formdata.append('post_id', post_id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.action_post, + formdata + ) + }, +} diff --git a/.prev/src/@ycore/libs/comty_ng/comty_post_comment.js b/.prev/src/@ycore/libs/comty_ng/comty_post_comment.js new file mode 100644 index 00000000..3e21a5a9 --- /dev/null +++ b/.prev/src/@ycore/libs/comty_ng/comty_post_comment.js @@ -0,0 +1,41 @@ +import { API_Call, endpoints } from 'ycore' + +export const comty_post_comment = { + delete: (callback, payload) => { + if (!payload) { + return false + } + const { comment_id } = payload + + let formdata = new FormData() + formdata.append('type', 'delete') + formdata.append('comment_id', comment_id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.comments_actions, + formdata + ) + }, + new: (callback, payload) => { + if (!payload) { + return false + } + const { post_id, raw_text } = payload + + let formdata = new FormData() + formdata.append('action', 'comment') + formdata.append('post_id', post_id) + formdata.append('text', raw_text) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.action_post, + formdata + ) + }, +} diff --git a/.prev/src/@ycore/libs/comty_ng/comty_search.js b/.prev/src/@ycore/libs/comty_ng/comty_search.js new file mode 100644 index 00000000..fe9da074 --- /dev/null +++ b/.prev/src/@ycore/libs/comty_ng/comty_search.js @@ -0,0 +1,23 @@ +import { API_Call, endpoints } from 'ycore' + +export const comty_search = { + keywords: (callback, payload) => { + if (!payload) { + return false + } + const { key } = payload + + let formdata = new FormData() + formdata.append('search_key', key) + + const callOptions = { timeout: 10000 } + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.search_endpoint, + formdata, + callOptions + ) + }, +} diff --git a/.prev/src/@ycore/libs/comty_ng/comty_user.js b/.prev/src/@ycore/libs/comty_ng/comty_user.js new file mode 100644 index 00000000..ac374d98 --- /dev/null +++ b/.prev/src/@ycore/libs/comty_ng/comty_user.js @@ -0,0 +1,75 @@ +import { API_Call, endpoints } from 'ycore' +import { comty_rsa } from '../rs_cloud/pre' + +export const comty_user = { + setData: () => {}, + follow: (callback, payload) => { + if (!payload) { + return false + } + const { user_id } = payload + + let formdata = new FormData() + formdata.append('user_id', user_id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.follow_user, + formdata + ) + }, + block: (callback, payload) => { + if (!payload) { + return false + } + const { user_id, block_action } = payload + let formdata = new FormData() + formdata.append('user_id', user_id) + formdata.append('block_action', block_action) + + API_Call((err,res)=>{ + return callback(err,res) + }, + comty_rsa.endpoint('block-user'), + formdata + ) + }, + find: (callback, payload) => { + if (!payload) { + return false + } + const { key } = payload + + let formdata = new FormData() + formdata.append('search_key', key) + + const callOptions = { timeout: 10000 } + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.find_user, + formdata, + callOptions + ) + }, + __tags: (callback, payload) => { + if (!payload) { + return false + } + const { id } = payload + + let formdata = new FormData() + formdata.append('user_id', id) + + API_Call( + (err, res) => { + return callback(err, res) + }, + endpoints.comty_endpoints.get_user_tags, + formdata + ) + }, +} diff --git a/.prev/src/@ycore/libs/comty_ng/pre.js b/.prev/src/@ycore/libs/comty_ng/pre.js new file mode 100644 index 00000000..273d7117 --- /dev/null +++ b/.prev/src/@ycore/libs/comty_ng/pre.js @@ -0,0 +1,64 @@ +import { token_data } from 'ycore' +import * as Icons from '@ant-design/icons' + +export * from './comty_post.js' +export * from './comty_user.js' +export * from './comty_post_comment.js' +export * from './comty_search.js' +export * from './comty_get.js' + + + +export const IsThisPost = { + owner: (post_uid) => { + const a = token_data.__id() + if (post_uid == a) { + return true + } + return false + }, + boosted: () => { + + }, + saved: () => { + + }, + pinned: () => { + + }, + flagged: () => { + + } +} + +export const GetPostPrivacy = { + bool: (e) => { + switch (e) { + case 'any': + return '0' + case 'only_followers': + return '1' + case 'only_follow': + return '2' + case 'private': + return '3' + default: + return '0' + } + }, + decorator: (e) => { + switch (e) { + case 'any': + return Share with everyone + case 'only_follow': + return Share with people I follow + case 'only_followers': + return Share with people follow me + case 'private': + return Dont share, only me + default: + return Unknown + } + }, + +} \ No newline at end of file diff --git a/.prev/src/@ycore/libs/rs_cloud/api_call.js b/.prev/src/@ycore/libs/rs_cloud/api_call.js new file mode 100644 index 00000000..41844f7a --- /dev/null +++ b/.prev/src/@ycore/libs/rs_cloud/api_call.js @@ -0,0 +1,95 @@ +import jquery from 'jquery' +import * as ycore from 'ycore' + +export function API_Call(callback, endpoint, payload, options, __token) { + var prefix = `[API_Call] ` + if (!endpoint) return false + if (!payload) { + ycore.yconsole.log(prefix, 'Calling api without Payload!!!') + } + let payloadContainer = payload ? payload : new FormData() + payloadContainer.append('server_key', ycore.__server.getKey()) + + const autoIncludeToken = endpoint.includes('?access_token=') + + const defaultOptions = { + method: 'POST', + timeout: 0, + processData: false, + includeUserID: false, + override__token: false, + disabledToken: autoIncludeToken ? false : true, + } + + let fendpoint + let method = defaultOptions.method + let timeout = defaultOptions.timeout + let processData = defaultOptions.processData + let includeUserID = defaultOptions.includeUserID + let override__token = defaultOptions.override__token + let disabledToken = defaultOptions.disabledToken + + if (options) { + options.method ? (method = options.method) : null + options.timeout ? (timeout = options.timeout) : null + options.processData ? (processData = true) : null + options.includeUserID ? (includeUserID = true) : null + options.override__token ? (override__token = true) : null + options.disabledToken ? (disabledToken = true) : null + } + + if (disabledToken) { + ycore.yconsole.log(`${prefix} Dimmissing the token generation`) + fendpoint = `${endpoint}` + } + + if (!disabledToken && !override__token) { + fendpoint = `${endpoint}${ycore.token_data.__token()}` + } + + if (override__token || __token) { + if (!__token) { + ycore.yconsole.log(`${prefix} Missing Overriding __token`) + return + } + ycore.yconsole.log(`${prefix} Overriding __token => ${__token}`) + fendpoint = `${endpoint}${__token}` + } + + if (includeUserID) { + payloadContainer.append('user_id', ycore.token_data.__id()) + } + + const requestOptions = { + url: fendpoint, + method: method, + timeout: timeout, + data: payloadContainer, + mimeType: 'multipart/form-data', + processData: processData, + contentType: false, + } + + jquery + .ajax(requestOptions) + .done(response => { + try { + const a = JSON.parse(response)['api_status'] + if (a == '404') { + ycore.Alive_API.tokenError(response) + } + } catch (error) { + ycore.yconsole.log( + '[VIOLATION] The status of the request has not been identified!' + ) + ycore.Alive_API.violation() + } + ycore.yconsole.log(response) + return callback(false, response) + }) + .fail(error => { + ycore.yconsole.log(`${prefix} (ERROR) `, error) + ycore.Alive_API.fail(error) + return callback(true, error) + }) +} diff --git a/.prev/src/@ycore/libs/rs_cloud/pre.js b/.prev/src/@ycore/libs/rs_cloud/pre.js new file mode 100644 index 00000000..f180f1c7 --- /dev/null +++ b/.prev/src/@ycore/libs/rs_cloud/pre.js @@ -0,0 +1,101 @@ +import * as ycore from 'ycore' +export * from './api_call.js' +import keys from '../../../../config/keys.js' + +export const Alive_API = { + fail: a => { + if (a) { + ycore.yconsole.log(a) + ycore.notify.error(a) + } + }, + tokenError: a => { + ycore.notify.expire( + 'It seems that your token has expired or no longer exists' + ) + ycore.router.go('login') + }, + violation: a => { + ycore.notify.expire( + 'It seems that there has been a problem with your token, we need you to log in again.' + ) + ycore.router.go('login') + }, +} +export const __server = { + getKey: () => { + return keys.server_key + }, +} +export const __rscloud = { + yulio_id: { + auth: (callback, payload) => { + if (!payload) return false + const { username, password } = payload + + const formdata = new FormData() + formdata.append('username', username) + formdata.append('password', password) + + const callOptions = { disabledToken: true } + ycore.API_Call( + (err, res) => { + return callback(err, res) + }, + ycore.endpoints.comty_endpoints.auth_endpoint, + formdata, + callOptions + ) + }, + logout: callback => { + const callOptions = { includeUserID: true } + ycore.API_Call( + (err, res) => { + return callback(err, res) + }, + ycore.endpoints.comty_endpoints.removeToken, + null, + callOptions + ) + }, + verify: (callback, payload) => {}, + sign: (callback, payload) => {}, + }, + sdcp_cloud: { + get: (callback, payload) => { + if (!payload) return false + const { user_token, user_id } = payload + const formdata = new FormData() + formdata.append('fetch', 'user_data') + formdata.append('user_id', user_id) + + const optionCall = { override__token: true } + ycore.API_Call( + (err, res) => { + try { + let cooked = JSON.parse(res)['user_data'] + let Ensamblator = btoa(JSON.stringify(cooked)) + return callback(err, Ensamblator) + } catch (error) { + return callback(true, error) + } + }, + ycore.endpoints.comty_endpoints.get_userData_endpoint, + formdata, + optionCall, + user_token + ) + }, + set: () => {}, + }, +} + +export const comty_rsa = { + endpoint: (endpoint, options) => { + let join_token = true; + if (options) { + join_token = options.join_token + } + return `${ycore.AppSettings.__global_server_prexif}${endpoint}${join_token? `?access_token=` : ``}` + } +} diff --git a/.prev/src/@ycore/libs/ycore_sdcp/pre.js b/.prev/src/@ycore/libs/ycore_sdcp/pre.js new file mode 100644 index 00000000..54191b4a --- /dev/null +++ b/.prev/src/@ycore/libs/ycore_sdcp/pre.js @@ -0,0 +1,67 @@ +import * as ycore from 'ycore' +import localforage from 'localforage' + +export const sdcp = { + isset: (value) => { + if (!value) return false + ycore.sdcp.localforage.getItem(value)? true : false + }, + set: (operator) => { + if (!operator) return false + try { + let a; + let b; + + let { callback, model } = operator + const {key, value} = model + if (!typeof key === 'string' || ! a instanceof String) return false + + a = ycore.sdcp.get(key) + if (!a.isArray()) return false + + b = JSON.parse(a).concat(value) + + localforage.setItem(key, b) + + } catch (err) { + console.log(err) + return false + } + }, + get: (key) => { + try { + return localforage.getItem(key) + } catch (err) { + return false + } + }, + +} + +export const cryptSDCP = { + atob_parse: e => { + if (e) { + try { + atob(e) + } catch (err) { + ycore.notify.error(err) + ycore.router.go('login') + return false + } + try { + let decodedSDCP = atob(e) + let parsedSDCP = JSON.parse(decodedSDCP) + return parsedSDCP + } catch (err) { + ycore.notify.error(err) + ycore.router.go('login') + return false + } + } + return false + }, + valid: () => { + const a = ycore.sdcp.get() + return a ? true : false + }, +} diff --git a/.prev/src/@ycore/libs/ycore_styles/pre.js b/.prev/src/@ycore/libs/ycore_styles/pre.js new file mode 100644 index 00000000..16f1f74f --- /dev/null +++ b/.prev/src/@ycore/libs/ycore_styles/pre.js @@ -0,0 +1,11 @@ +import {AppSettings} from 'ycore' + +export function CurrentTheme(){ + try { + const bundle = localStorage.getItem('resource_bundle') || AppSettings.resource_bundle + console.log('Loading resource Bundle =>', bundle) + return bundle + } catch (error) { + return null + } +} \ No newline at end of file diff --git a/.prev/src/@ycore/libs/ycore_styles/ycore_style.scss b/.prev/src/@ycore/libs/ycore_styles/ycore_style.scss new file mode 100644 index 00000000..5759afe8 --- /dev/null +++ b/.prev/src/@ycore/libs/ycore_styles/ycore_style.scss @@ -0,0 +1,1488 @@ +/* (2.0) YulioID V2 */ + +@import url('https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css'); +@import url('https://fonts.googleapis.com/css?family=Poppins:300,300i,500,500i,700'); + + + +.mainlp { + --neutralShade0: #f8f8f8; + --neutralShade1: #f2f2f2; + --neutralShade2: #e8e9e9; + --neutralShade3: #d1d3d4; + --neutralShade4: #babdbf; + --neutralShade5: #808488; + --neutralShade6: #666a6d; + --neutralShade7: #4d5052; + --neutralShade8: #212122; + --grayColor: #999; + --lightGrayColor: #ddd; + --borderRadius: 6px; + --boxShadow: 0 2px 5px rgba(#333, 0.2); +} + +/*overall layout*/ +.mainlp { + width: 90%; + max-width: 1050px; + margin: 3em auto 0; + display: grid; + grid: repeat(5, fit-content(300px))/100%; + color: var(--foregroundColor); + text-align: left; +} + +.mainlp .sectionlp { + border: 1px solid var(--accentColor); + position: relative; + padding: 40px 40px 50px; +} + +.mainlp .sectionlp>h6 { + color: var(--accentColor); + background: var(--canvasColor); + position: absolute; + top: -10px; + left: 20px; + padding: 0 10px; +} + +.mainlp .sectionlp .h6lp.subheader { + color: var(--grayColor); + margin-top: 20px; + margin-bottom: 20px; + width: 100%; +} + +@media (max-width: 992px) { + section:not(:last-child) { + border-width: 0 0 1px; + } + + section:last-child { + border-width: 0; + } +} + +@media (min-width: 992px) { + main { + grid: repeat(9, auto)/45% 1fr 45%; + grid-auto-flow: dense; + } + + .media-card-1 { + grid-column: 1 / 2; + border-width: 1px 0; + } + + .media-card-2 { + grid-column: 2 / 4; + border-width: 1px 0 1px 1px; + } + + .media-card-3 { + grid-column: 1 / 4; + border-width: 0; + } + + .filter-section { + grid-column: 3 / 4; + grid-row: 1 / 2; + border-width: 0 0 0 1px; + } + + .well-cta-1 { + grid-row: 3; + grid-column: 1 / 3; + border-width: 1px 1px 0 0; + } + + .well-cta-2 { + grid-row: 2; + grid-column: 2 / 4; + border-width: 1px 0 0; + } + + .tables { + grid-row: 4; + grid-column: 1 / -1; + border-width: 1px 0 0; + } + + .forms { + grid-column: 1 / 3; + border-width: 0; + } + + .comments { + grid-row: 2; + grid-column: 1 / 2; + border-width: 1px 1px 0 0; + padding-top: 60px; + } + + .modals { + grid-row: 3; + grid-column: 3 / 4; + justify-content: center; + border-width: 1px 0 0; + } +} + + +/*checkboxes*/ +input:disabled~* { + opacity: 0.3; + user-select: none; + pointer-events: none; +} + +.checkboxtoggle input { + display: none; +} + +.checkboxtoggle label { + outline: 0; + display: block; + width: 45px; + height: 16px; + background: var(--grayColor); + position: relative; + cursor: pointer; + border-radius: 2em; + padding: 2px; + transition: all 0.4s ease; + margin: 0; +} + +.checkboxtoggle .labellp:after { + position: relative; + display: block; + content: ""; + width: 20px; + height: 20px; + border-radius: 50%; + background: #fff; + transition: all 0.2s ease; + border: 1px solid var(--grayColor); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); + left: -4px; + top: -5px; +} + +.checkboxtoggle input:checked+.labellp { + background: var(--accent2Color); +} + +.checkboxtoggle input:checked+.labellp:after { + left: 52%; +} + +.checkbox { + position: relative; + user-select: none; + margin-bottom: 10px; +} + +.checkbox input { + display: none; +} + +.checkbox .labellp { + position: relative; + vertical-align: middle; + cursor: pointer; + font-weight: 500; + padding-left: 35px; +} + +.checkbox .spanlp.box { + display: inline-block; + width: 20px; + border-radius: var(--borderRadius); + border: 1px solid var(--grayColor); + width: 24px; + height: 24px; + vertical-align: middle; + margin-right: 3px; + transition: 0.3s ease; + position: absolute; + left: 0; +} + +.checkbox .spanlp.box:before, +.checkbox .spanlp.box:after { + content: ""; + position: absolute; + width: 4px; + height: 16px; + border-radius: 40px; + background: var(--backgroundColor); + transition: all 0.3s ease; +} + +.checkbox .spanlp.box:before { + transform: rotate(45deg) translateY(-5px) translateX(10px) scale(0); +} + +.checkbox .spanlp.box:after { + height: 8px; + transform: rotate(-45deg) translateY(10px) translateX(-4px) scale(0); +} + +.checkbox input:checked+.labellp .spanlp.box { + background: var(--accent2Color); + border-color: var(--accent2Color); +} + +.checkbox input:checked+.labellp .spanlp.box:before { + transform: rotate(45deg) translateY(-5px) translateX(10px) scale(1); +} + +.checkbox input:checked+.labellp .spanlp.box:after { + height: 8px; + transform: rotate(-45deg) translateY(10px) translateX(-4px) scale(1); +} + +.checkbox input:disabled:checked+.spanlp.box { + background: var(--grayColor); + border: var(--grayColor); +} + +.checkbox input:disabled:checked~.labellp:before, +.checkbox input:disabled:checked~.labellp:after { + background: black; +} + +/*buttons & links*/ +.links__sec { + margin: 10px 0 30px; +} + +.links a.link { + display: inline; + margin: 10px 30px 5px 0; + border-bottom: 2px dashed; + font-weight: 500; + line-height: 2.5; + cursor: pointer; + color: var(--neutralShade5); +} + +.links a.link:hover, +.links a.link.hover { + color: var(--neutralShade6); + border-bottom: 2px solid; +} + +.links a.link.primary { + color: var(--primaryColor); +} + +.links a.link.primary:hover, +.links a.link.primary.hover { + color: var(--primaryShade5); +} + +.links a.link.secondary { + color: var(--secondaryColor); +} + +.links a.link.secondary:hover, +.links a.link.secondary.hover { + color: var(--secondaryShade5); +} + +.buttons { + display: flex; + flex-wrap: wrap; + align-items: center; +} + +.buttons>* { + flex: 1 1 calc(50% - 20px); + margin-top: 20px; +} + +.buttons>*:nth-child(odd) { + margin-right: 20px; +} + +a.buttonlp, +input.buttonlp, +.buttonlp { + outline: none; + width: 100%; + text-align: center; + display: inline-block; + border: none; + font: 500 16px/1 "Poppins", sans-serif; + padding: 20px; + cursor: pointer; + border-radius: var(--borderRadius); + background: var(--primaryColor); + color: var(--backgroundColor); + position: relative; + top: 0; + transition: 0.2s ease; +} + +a.buttonlp:hover, +a.buttonlp.hover, +input.buttonlp:hover, +input.buttonlp.hover, +.buttonlp:hover, +.buttonlp.hover { + top: -3px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); +} + +a.buttonlp:active, +a.buttonlp.active, +input.buttonlp:active, +.input.buttonlp.active, +.buttonlp:active, +.buttonlp.active { + background: var(--primaryShade4); + outline: none; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + top: 0; +} + +a.buttonlp.disabled, +input.buttonlp.disabled, +.buttonlp.disabled { + opacity: 0.4; + user-select: none; + pointer-events: none; +} + +a.buttonlp.medium, +input.buttonlp.medium, +.buttonlp.medium { + padding: 15px 18px; + width: auto; +} + +a.buttonlp.small, +input.buttonlp.small, +.buttonlp.small { + padding: 10px 12px; + width: auto; + font-size: 14px; + font-weight: 500; +} + +a.buttonlp.secondary, +input.buttonlp.secondary, +.buttonlp.secondary { + background: var(--secondaryColor); +} + +a.buttonlp.secondary:active, +a.buttonlp.secondary:focus, +a.buttonlp.secondary.active, +input.buttonlp.secondary:active, +input.buttonlp.secondary:focus, +input.buttonlp.secondary.active, +.buttonlp.secondary:active, +.buttonlp.secondary:focus, +.buttonlp.secondary.active { + background: var(--secondaryShade4); + outline: none; +} + +a.buttonlp.accent, +input.buttonlp.accent, +.buttonlp.accent { + background: var(--accentColor); +} + +a.buttonlp.accent:active, +a.buttonlp.accent:focus, +a.buttonlp.accent.active, +input.buttonlp.accent:active, +input.buttonlp.accent:focus, +input.buttonlp.accent.active, +.buttonlp.accent:active, +.buttonlp.accent:focus, +.buttonlp.accent.active { + background: var(--accentShade4); +} + +a.buttonlp.accent2, +input.buttonlp.accent2, +.buttonlp.accent2 { + background: var(--accent2Color); +} + +a.buttonlp.accent2:active, +a.buttonlp.accent2:focus, +a.buttonlp.accent2.active, +input.buttonlp.accent2:active, +input.buttonlp.accent2:focus, +input.buttonlp.accent2.active, +.buttonlp.accent2:active, +.buttonlp.accent2:focus, +.buttonlp.accent2.active { + background: var(--accent2Shade4); +} + +a.buttonlp.accent3, +input.buttonlp.accent3, +.buttonlp.accent3 { + background: var(--accent3Color); +} + +a.buttonlp.accent3:active, +a.buttonlp.accent3:focus, +a.buttonlp.accent3.active, +input.buttonlp.accent3:active, +input.buttonlp.accent3:focus, +input.buttonlp.accent3.active, +.buttonlp.accent3:active, +.buttonlp.accent3:focus, +.buttonlp.accent3.active { + background: var(--accent3Shade4); +} + +/*inputs*/ +.input__wrapper { + margin-bottom: 10px; +} + + +.labelform { + font-weight: 500; + display: block; + margin-bottom: 5px; +} + +input.inputform, +select, +textarea { + height: 50px; + font-size: 16px; + border: 2px solid var(--neutralShade3); + width: 100%; + padding: 12px; + font-family: "Poppins"; + border-radius: var(--borderRadius); + color: var(--foregroundColor); + background: var(--backgroundColor); +} + +input.inputform:focus, +input.inputform.active, +select:focus, +select.active, +textarea:focus, +textarea.active { + outline: none; + border-color: var(--primaryColor); +} + +input.inputform:disabled, +select:disabled, +textarea:disabled { + cursor: not-allowed; + background: var(--neutralShade1); + opacity: 0.6; +} + +input.inputform.input { + height: 56px; + font-size: 18px; + padding: 15px; +} + +/*badges*/ +.badge { + display: inline-block; + padding: 6px 12px; + border-radius: 50px; + font-weight: 500; + text-transform: uppercase; + line-height: 1; +} + +.alert { + margin-bottom: 15px; + display: block; + padding: 10px 15px; + border-radius: var(--borderRadius); + font-weight: 500; + position: relative; + cursor: pointer; +} + +.alert.non-collapsible:before, +.alert.non-collapsible:after { + content: none; +} + +.alert:before, +.alert:after { + content: ""; + position: absolute; + width: 4px; + height: 16px; + border-radius: 40px; + right: 30px; + top: 8px; +} + +.alert:before { + transform: rotate(45deg) translateY(-5.5px) translateX(13.5px); +} + +.alert:after { + transform: rotate(-45deg) translateY(13.5px) translateX(5.5px); +} + +.status-primary { + background: var(--primaryShade1); + color: var(--primaryShade5); +} + +.status-primary:before, +.status-primary:after { + background: var(--primaryShade5); +} + +.status-secondary { + background: var(--secondaryShade1); + color: var(--secondaryShade5); +} + +.status-secondary:before, +.status-secondary:after { + background: var(--secondaryShade5); +} + +.status-info { + background: var(--accentShade1); + color: var(--accentShade5); +} + +.status-info:before, +.status-info:after { + background: var(--accentShade5); +} + +.status-success { + background: var(--accent2Shade1); + color: var(--accent2Shade5); +} + +.status-success:before, +.status-success:after { + background: var(--accent2Shade5); +} + +.status-error { + background: var(--accent3Shade1); + color: var(--accent3Shade5); +} + +.status-error:before, +.status-error:after { + background: var(--accent3Shade5); +} + +/*tooltips*/ +.tooltip { + cursor: pointer; + position: relative; + display: block; + width: 100%; + text-align: center; + z-index: 10; +} + +.tooltip .spanlp { + border-bottom: 1px dotted; +} + +.tooltip:after { + content: attr(data-tooltip); + background: var(--neutralShade2); + max-width: 90%; + width: auto; + position: absolute; + left: 0; + right: 0; + margin: auto; + opacity: 0; + height: auto; + font-size: 14px; + padding: 10px; + border-radius: var(--borderRadius); + color: var(--foregroundColor); + text-align: center; +} + +.tooltip.dark:after { + background: var(--neutralShade7); + color: var(--backgroundColor); +} + +.tooltip.top:after { + bottom: 80%; + transition: opacity 0.3s ease 0.3s, bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s; +} + +.tooltip.top:hover:after, +.tooltip.top.hovered:after { + bottom: 130%; + opacity: 1; +} + +.tooltip.bottom:after { + top: 80%; + transition: opacity 0.3s ease 0.3s, top 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s; +} + +.tooltip.bottom:hover:after, +.tooltip.bottom.hovered:after { + top: 130%; + opacity: 1; +} + +/*spinner*/ +.spinner+.labellp { + font-size: 14px; + font-weight: 500; + margin-top: 8px; + display: inline-block; + text-transform: uppercase; + color: var(--primaryShade4); +} + +.spinner1 .spinner { + max-width: 50px; + margin: auto; + height: 20px; + position: relative; +} + +.spinner1 .spinner:after { + content: ""; + position: absolute; + width: 20px; + height: 20px; + left: -10%; + background: var(--primaryColor); + animation: spinnerLeftRight 1s infinite; +} + +.spinner1 .spinner:before { + content: ""; + position: absolute; + width: 20px; + height: 20px; + left: -10%; + background: var(--primaryShade2); + opacity: 1; + animation: spinnerLeftRight 1s infinite 0.06s; +} + +@keyframes spinnerLeftRight { + 0% { + left: 85%; + } + + 50% { + left: -10%; + } + + 100% { + left: 85%; + } +} + + +#sunset+.labellp { + background: linear-gradient(to right, #ff9557 50%, #ffcc67 50%); +} + +.mainlp { + --canvasColor: #f9f9f9; + --backgroundColor: #fff; + --foregroundColor: #111; + --primaryColor: #ff9557; + --primaryShade1: #ffe2d1; + --primaryShade2: #ffceb2; + --primaryShade3: #ffb184; + --primaryShade4: #e88850; + --primaryShade5: #d17a48; + --secondaryColor: #ffcc67; + --secondaryShade1: #fff1d5; + --secondaryShade2: #ffde9e; + --secondaryShade3: #ffd074; + --secondaryShade4: #e8ba5e; + --secondaryShade5: #ba954b; + --accentColor: #4e5166; + --accentShade1: #cecfd5; + --accentShade2: #aeafb9; + --accentShade3: #8e909d; + --accentShade4: #6e7081; + --accentShade5: #404354; + --accent2Color: #588b8b; + --accent2Shade1: #c2d4d4; + --accent2Shade2: #a3bfbf; + --accent2Shade3: #85aaaa; + --accent2Shade4: #507f7f; + --accent2Shade5: #497272; + --accent3Color: #fe5f55; + --accent3Shade1: #fec4c1; + --accent3Shade2: #fea7a2; + --accent3Shade3: #fe7c73; + --accent3Shade4: #e7574e; + --accent3Shade5: #b9463e; +} + + + +/* PROFILE CARDS */ +.profile { + position: relative; + background: var(--backgroundColor); + color: var(--foregroundColor); + box-shadow: 0 3px 15px rgba(51, 51, 51, 0.2); + border-radius: 10px; + overflow: hidden; + transition: .2s ease; + display: grid; + grid: 200px repeat(5, auto)/100%; +} + +.profile__image img { + width: 100%; + height: 100%; + object-fit: cover; + border-bottom: 7px solid var(--secondaryColor); +} + +.profile__info { + padding: 20px 25px 0; +} + +.profile__stats { + padding: 5px 25px; +} + +.profile__stats__title { + color: var(--grayColor); + text-transform: uppercase; + font-size: 16px; +} + +.profile__cta { + padding: 0 25px 25px; +} + +.profile a:hover { + top: 0; + box-shadow: none; + background: var(--primaryShade4); +} + +.profile a:active, +.profile a:focus { + top: 0; + box-shadow: none; + background: var(--primaryShade5); +} + +@media (min-width: 500px) { + .profile-default { + min-width: 500px; + max-width: 450px; + margin: auto; + overflow: hidden; + grid: 340px auto auto/repeat(3, minmax(80px, 1fr)); + grid-gap: 10px; + } + + .profile-default .profile__image { + grid-column: span 3; + } + + .profile-default .profile__info { + grid-column: span 3; + } + + .profile-default .profile__stats { + padding: 5px 25px; + } + + .profile-default .profile__cta { + grid-column: span 3; + } +} + +@media (min-width: 768px) { + .profile-long { + grid-template-columns: 150px repeat(3, 1fr) auto; + grid-template-rows: auto auto; + width: 100%; + padding-right: 20px; + } + + .profile-long .profile__image { + grid-column: 1 / 2; + grid-row: 1 / 3; + margin-right: 20px; + } + + .profile-long .profile__image img { + border-radius: 10px 0 0 10px; + border: none; + } + + .profile-long .profile__info { + grid-column: 2 / 6; + grid-row: 1; + padding: 20px 20px 15px 0; + } + + .profile-long .profile__stats { + min-width: 100px; + padding: 15px 0; + border-top: 0.5px solid var(--grayColor); + grid-row: 2 / 3; + } + + .profile-long .profile__stats:nth-child(3) { + grid-column: 2 / 3; + } + + .profile-long .profile__stats:nth-child(4) { + grid-column: 3 / 4; + } + + .profile-long .profile__stats:nth-child(5) { + grid-column: 4 / 5; + } + + .profile-long .profile__cta { + grid-row: 2 / 3; + grid-column: 5 / 6; + border-top: 0.5px solid var(--grayColor); + padding: 15px 0 0; + } +} + +.profile-imgonly { + border-radius: 10px; + overflow: hidden; + min-width: 250px; + width: 100%; + grid: 480px 0px / 100%; +} + +.profile-imgonly:hover { + grid: 434px 56px / 100%; +} + +.profile-imgonly .profile__image, +.profile-imgonly .profile__info { + grid-row: 1 / 2; + grid-column: 1 / 2; +} + +.profile-imgonly .profile__image { + position: relative; +} + +.profile-imgonly .profile__image:after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 30%; + background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0)); +} + +.profile-imgonly .profile__image img { + border: none; +} + +.profile-imgonly .profile__stats { + display: none; +} + +.profile-imgonly .profile__info { + z-index: 5; + grid-row: 1 / 2; + align-self: end; + margin: 0 0 15px; + color: #fff; + text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); +} + +.profile-imgonly .profile__info p { + display: none; +} + +.profile-imgonly .profile__cta { + padding: 0; +} + +.profile-imgonly .profile__cta a { + border-radius: 0; +} + +#dark:checked~.mainlp a.buttonlp, +#pinkaru:checked~.mainlp a.buttonlp { + color: var(--foregroundColor); + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); +} + +#dark:checked~.mainlp .buttonlp:hover, +#pinkaru:checked~.mainlp .buttonlp:hover { + background: var(--primaryShade2); +} + +#dark:checked~.mainlp .buttonlp:active, +#pinkaru:checked~.mainlp .buttonlp:active { + background: var(--primaryShade1); +} + +#dark:checked~.mainlp .profile-default img, +#pinkaru:checked~.mainlp .profile-default img { + border-bottom: 7px solid var(--secondaryShade5); +} + +/*FILTERS*/ +.filters__title { + font-size: 18px; + color: var(--grayColor); + margin: 25px 0; +} + +.filters__item { + display: grid; + grid-template-columns: 1fr auto; + align-items: center; + margin-bottom: 10px; +} + +.filters__item .checkbox { + position: relative; + margin: 0; +} + +.filters__item .checkbox .tooltip { + display: inline-block; + margin-left: 10px; + width: auto; + vertical-align: middle; +} + +.filters__item .checkbox .tooltip .spanlp { + border: none; +} + +.filters__item .checkbox .tooltip:after { + min-width: 100px; + margin-left: -50px; +} + +.filters:not(:first-of-type) { + border-top: 0.5px solid var(--lightGrayColor); + margin-top: 25px; +} + +/* WELL CTA */ +.well-cta { + border-radius: 10px; + background: var(--secondaryColor); + color: var(--foregroundColor); + overflow: hidden; +} + +.well-cta__text { + padding: 30px; +} + +.well-cta__text p { + font-size: 18px; + line-height: 1.5; +} + +.well-cta__text a { + margin: 25px 0 0; +} + +.well-cta__image { + padding: 30px 0 0; +} + +.well-cta img { + width: 100%; + max-height: 300px; + object-fit: contain; + margin-bottom: -7px; +} + +@media (min-width: 768px) { + .well-cta { + display: grid; + grid: auto / 1fr 250px; + } + + .well-cta__image { + align-self: flex-end; + padding: 15px 0 0; + } +} + +#bluepurple:checked~.mainlp .well-cta__text { + color: var(--backgroundColor); +} + +.well-cta--form { + display: grid; + grid-gap: 10px; + padding: 30px; + background: var(--primaryShade1); + border-radius: 10px; +} + +.well-cta--form__text { + margin-bottom: 10px; +} + +.well-cta--form h3 { + color: var(--primaryShade5); +} + +@media (min-width: 768px) { + .well-cta--form { + grid-template-columns: 1fr auto; + } + + .well-cta--form__text { + grid-column: span 2; + } +} + +/*TABLE*/ +.table { + background: var(--backgroundColor); + border-radius: 10px; +} + +.table__wrapper { + width: 100%; + overflow-y: hidden; + overflow-x: auto; + border-radius: 10px; + box-shadow: 0 3px 15px rgba(51, 51, 51, 0.2); +} + +.table tr { + display: grid; + grid: auto/80px 80px repeat(2, minmax(150px, 2fr)) repeat(2, minmax(120px, 1.5fr)) 50px; + align-items: center; +} + +.table td { + padding: 15px; +} + +.table__header { + color: var(--neutralShade5); + font-weight: 500; + text-transform: uppercase; + border-bottom: 0.5px solid var(--lightGrayColor); +} + +.table__body tr:nth-child(even) { + background: var(--neutralShade0); +} + +#dark:checked~.mainlp .table__body tr:nth-child(even), +#pinkaru:checked~.mainlp .table__body tr:nth-child(even) { + background: var(--neutralShade8); +} + +/*FORMS*/ +.formlogin { + border-radius: 10px; + padding: 30px; + box-shadow: 0 3px 15px rgba(51, 51, 51, 0.2); + background: var(--backgroundColor); + margin-top: 30px; + position: relative; + overflow: hidden; +} + +.formlogin .checkbox { + margin-bottom: 30px; +} + +.formlogin .spinner__wrapper { + display: grid; + place-items: center; + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + background: rgba(255, 255, 255, 0.85); + opacity: 0; + z-index: -1; +} + +@media (min-width: 768px) { + .formlogin { + display: grid; + grid: auto / 1fr 40%; + } + + .formlogin .input__wrapper { + grid-column: span 2; + } + + .formlogin .checkbox { + align-self: center; + margin-bottom: 0; + } +} + +#dark:checked~.mainlp .spinner__wrapper, +#pinkaru:checked~.mainlp .spinner__wrapper { + background: rgba(20, 20, 20, 0.85); +} + +/*COMMENT ITEM*/ +.comment { + display: grid; + grid: auto / 60px 1fr; + grid-gap: 12px; +} + +.comment__image { + grid-row: 1 / 4; +} + +.comment__image img { + width: 60px; + height: 60px; + object-fit: cover; + border-radius: 50%; +} + +.comment__info h5 { + margin-bottom: 0; +} + +.comment__info h5 .spanlp { + vertical-align: middle; +} + +.comment__info h5 .badge { + margin-left: 8px; + font-size: 80%; +} + +.comment__info h5 .badge i { + font-size: 80%; + margin-right: 6px; +} + +.comment__info__time { + color: var(--grayColor); +} + +.comment__reaction i { + margin-right: 8px; + font-size: 85%; +} + +.comment__reaction__heart { + cursor: pointer; + transition: .3s ease; +} + +.comment__reaction__heart.toggled { + color: var(--accent3Shade5); + font-weight: 500; +} + +/*PANEL*/ +.panel { + display: grid; + grid: 200px auto min-content / 100%; + border-radius: 10px; + overflow: hidden; + background: var(--backgroundColor); + box-shadow: 0 3px 15px rgba(51, 51, 51, 0.2); + max-width: 480px; + margin: auto; +} + +.panel__image img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.panel__info { + padding: 30px 30px 20px; +} + +.panel__info h1 { + margin-bottom: 25px; +} + +.panel__info p { + font-size: 20px; + margin: 15px 0; +} + +.panel__info .alert { + font-weight: 300; + margin-top: 30px; +} + +.panel__cta { + padding: 0 30px 30px; + text-align: center; +} + +footer { + display: grid; + grid: min-content / 1fr max-content; + text-align: left; + width: 90%; + margin: 1em auto 4em; + max-width: 1050px; + align-items: center; +} + +footer a { + text-decoration: none; + color: #333; + padding: 3px 0; + border-bottom: 1px dashed; +} + +footer a:hover { + border-bottom: 1px solid; +} + +footer .social a { + text-decoration: none; + margin-left: 10px; +} + +footer .social a .icons { + display: inline-block; + font-size: 20px; +} + +footer.dark, +footer.dark a { + color: #f9f9f9; +} + + + + +/*typography 2*/ +.logoHR { + color: #000; +} + +.logoh1wp { + color: #242331; + +} + +.logoh1wp h1 { + font: 700 48px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.logoh1wp h2 { + font: 700 32px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.logoh1wp h3 { + font: 700 24px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.logoh1wp h4 { + font: 700 20px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.logoh1wp h5 { + font: 500 18px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.logoh1wp h6 { + font: 500 16px/1.2 "Poppins", sans-serif; + text-transform: uppercase; +} + + +.stonglp { + font-weight: 500; +} + +.emlp { + font-style: italic; +} + +.h1lp { + font: 700 48px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.h2lp { + font: 700 32px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.h3lp { + font: 700 24px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.h4lp { + font: 700 20px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.h5lp { + font: 500 18px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.h6lp { + font: 500 16px/1.2 "Poppins", sans-serif; + text-transform: uppercase; +} + +.apierrort { + font: 700 20px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; +} + +.apierrort::first-letter { + text-transform: uppercase; +} + + +.coverprc img { + position: absolute; + left: 0px; + top: 0px; + z-index: 1; +} + +.befcoverprc { + z-index: 2; +} + +.flex { + /*Flexbox for containers*/ + display: flex; + justify-content: center; + align-items: center; + text-align: center; +} + +.wavesNav { + + bottom: 0; + +} + +.postNavWaves { + background-color: #F0F2F5; + height: 100%; +} + +.waves { + position: relative; + z-index: 0; + width: 100%; + height: 80vh; + margin-bottom: -7px; + /*Fix for safari gap*/ + min-height: 100px; + max-height: 150px; +} + + +/* Animation */ + +.parallax>use { + animation: move-forever 25s cubic-bezier(.55, .5, .45, .5) infinite; +} + +.parallax>use:nth-child(1) { + animation-delay: -2s; + animation-duration: 7s; +} + +.parallax>use:nth-child(2) { + animation-delay: -3s; + animation-duration: 10s; +} + +.parallax>use:nth-child(3) { + animation-delay: -4s; + animation-duration: 13s; +} + +.parallax>use:nth-child(4) { + animation-delay: -5s; + animation-duration: 20s; +} + +@keyframes move-forever { + 0% { + transform: translate3d(-90px, 0, 0); + } + + 100% { + transform: translate3d(85px, 0, 0); + } +} + +/*Shrinking for mobile*/ +@media (max-width: 768px) { + .waves { + height: 40px; + min-height: 40px; + } + + .content { + height: 30vh; + } + + h1 { + font-size: 24px; + } +} + + + +.ClockDashboard { + float: right; + font: 700 26px/1.2 "Poppins", sans-serif; + margin-bottom: 10px; + margin: 12px; + z-index: 9999; +} \ No newline at end of file diff --git a/.prev/src/@ycore/libs/ycore_sync/pre.js b/.prev/src/@ycore/libs/ycore_sync/pre.js new file mode 100644 index 00000000..99b1b55d --- /dev/null +++ b/.prev/src/@ycore/libs/ycore_sync/pre.js @@ -0,0 +1,50 @@ +import * as ycore from 'ycore' +import * as antd from 'antd' +import * as Icons from '@ant-design/icons' +import io from 'socket.io-client' +import config from 'config' + +var endpoint = config.sync_server; + + +export const sync = { + listen: (callback) => { + let conn_overrun_tick = 0; + const socket = io(endpoint); + + socket.on('connect_error', (error) => { + conn_overrun_tick ++ + ycore.yconsole.log('Overrun tick => ',conn_overrun_tick) + if (conn_overrun_tick == 1) { + antd.notification.open({ + onClose: () => conn_overrun_tick = 0, + duration: 15, + message: 'Disconected from server!', + description: 'Attempting to reconnect...', + icon: , + }); + } + }); + + socket.on('connect', () => { + conn_overrun_tick = 0 + antd.message.success('Connected to the server') + }); + + socket.on('pull_event', function (data) { + console.log('SOCKET => ',data) + callback(data) + }); + + }, + FeedListen: (callback) => { + const socket = io(endpoint); + socket.on('pull_event', function (data) { + callback(data) + }); + }, + emmitPost: (last_id) => { + const socket = io(endpoint); + socket.emit('push_event', last_id); + } +} \ No newline at end of file diff --git a/.prev/src/@ycore/libs/yulio_id/ctid_gen.js b/.prev/src/@ycore/libs/yulio_id/ctid_gen.js new file mode 100644 index 00000000..6e6470d8 --- /dev/null +++ b/.prev/src/@ycore/libs/yulio_id/ctid_gen.js @@ -0,0 +1,32 @@ +import * as ycore from 'ycore' +/** + * Cookies Token ID Generator + * + * @callback {func} return with (err,res) model + * @payload {object} Payload data + */ +export function __CTID_GEN(callback, payload) { + const { token, sdcp } = payload + + const { UserID, UserToken } = token + const a = ycore.cryptSDCP.atob_parse(sdcp) + + const { avatar, admin, pro, dev, is_pro, username } = a + + const frame = { + UserID, + UserToken, + avatar, + admin, + pro, + dev, + is_pro, + username, + exp: ycore.AppSettings.SignForNotExpire + ? 0 + : Math.floor(Date.now() / 1000) + 60 * 60, + } + ycore.token_data.set(frame, done => { + done ? callback(false, true) : callback(true, false) + }) +} diff --git a/.prev/src/@ycore/libs/yulio_id/pre.js b/.prev/src/@ycore/libs/yulio_id/pre.js new file mode 100644 index 00000000..d42c9928 --- /dev/null +++ b/.prev/src/@ycore/libs/yulio_id/pre.js @@ -0,0 +1,59 @@ +import * as ycore from 'ycore' +import Cookies from 'ts-cookies' + +// EXPORT PUBLIC WORKERS +export * from './token_data.js' +export * from './ctid_gen.js' +export * from './validate.js' + +export function userData() { + return ycore.token_data.get() +} + +export const make_data = { + backup: () => { + localStorage.setItem('last_backup', Cookies.get('cid')) + }, +} + +export const IsThisUser = { + admin: () => { + return ycore.booleanFix(ycore.userData().admin) ? true : false + }, + dev: () => { + return ycore.booleanFix(ycore.userData().dev) ? true : false + }, + pro: () => { + return ycore.booleanFix(ycore.userData().is_pro) ? true : false + }, + nsfw: () => { + return ycore.booleanFix(ycore.userData().nsfw) ? true : false + }, + same: a => { + if (a == ycore.userData().UserID) { + return true + } + return false + }, +} + +export const get_early = { + user: (callback, payload)=>{ + if (!payload) { + return false + } + const { username } = payload + let formdata = new FormData() + formdata.append('username', username) + + const callOptions = { timeout: 10000 } + ycore.API_Call( + (err, res) => { + return callback(err, res) + }, + ycore.comty_rsa.endpoint('early_user', {join_token: false}), + formdata, + callOptions + ) + } +} \ No newline at end of file diff --git a/.prev/src/@ycore/libs/yulio_id/token_data.js b/.prev/src/@ycore/libs/yulio_id/token_data.js new file mode 100644 index 00000000..75b8d216 --- /dev/null +++ b/.prev/src/@ycore/libs/yulio_id/token_data.js @@ -0,0 +1,45 @@ +import * as ycore from 'ycore' + +import Cookies from 'ts-cookies' +import {server_key} from '../../../../config/keys.js' +var jwt = require('jsonwebtoken') + +export const token_data = { + set: (value, callback) => { + jwt.sign(value, server_key, (err, token) => { + err ? null : Cookies.set('cid', token) + return callback(true) + }) + }, + getRaw: () => { + return Cookies.get('cid') + }, + get: () => { + let final = + jwt.decode(Cookies.get('cid')) || + jwt.decode(localStorage.getItem('last_backup')) + const a = jwt.decode(Cookies.get('cid')) + const b = jwt.decode(localStorage.getItem('last_backup')) + if (!a && !b) { + final = false + return final + } + if (!a) { + final = b + } + if (!b) { + final = a + } + ycore.yconsole.debug(final) + return final + }, + remove: () => { + Cookies.remove('cid') + }, + __token: () => { + return ycore.token_data.get().UserToken + }, + __id: () => { + return ycore.token_data.get().UserID + }, +} diff --git a/.prev/src/@ycore/libs/yulio_id/validate.js b/.prev/src/@ycore/libs/yulio_id/validate.js new file mode 100644 index 00000000..7d42aabb --- /dev/null +++ b/.prev/src/@ycore/libs/yulio_id/validate.js @@ -0,0 +1,55 @@ +import * as ycore from 'ycore' +import Cookies from 'ts-cookies' +var jwt = require('jsonwebtoken') + +export const validate = { + session: callback => { + let validtoken = false + const a = Cookies.get('cid') + if (a) { + const modExp = ycore.AppSettings.SignForNotExpire + const ad = jwt.decode(a) + + let notexp = true // Sets if this is expired (Default is not expired) + let exists = false // Sets if this exist + + ad ? (exists = true) : null + + const tokenExp = ad.exp * 1000 + const tokenExpLocale = new Date(tokenExp).toLocaleString() + const now = new Date().getTime() + + ycore.yconsole.log( + `TOKEN EXP => ${tokenExp} ${ + modExp ? '( Infinite )' : `( ${tokenExpLocale} )` + } || NOW => ${now}` + ) + + if (modExp == false) { + if (tokenExp < now) { + ycore.yconsole.log('This token is expired !!!') + notexp = false + } + } + if (notexp && exists) { + validtoken = true + } + } + + if (callback) { + callback(validtoken) + } + return validtoken + }, + backup: () => { + let ValidBackupToken = false + let LastestToken = localStorage.getItem('last_backup') + if (LastestToken) { + let LastestTokenDC = jwt.decode(LastestToken) + if (LastestTokenDC) { + ValidBackupToken = true + } + } + return ValidBackupToken + }, +} diff --git a/.prev/src/@ycore/ycore_worker.js b/.prev/src/@ycore/ycore_worker.js new file mode 100644 index 00000000..5b8cb159 --- /dev/null +++ b/.prev/src/@ycore/ycore_worker.js @@ -0,0 +1,333 @@ +/** + * @yCore_Worker + * + * @author rStudio© 2020 + * @licensed Pending... + */ + +import * as Endpoints from 'globals/endpoints/index.js' +import io from 'socket.io-client' +import * as Icons from '@ant-design/icons' +import localforage from 'localforage' +import { format } from 'timeago.js' +import * as antd from 'antd' +import moment from 'moment' +import React from 'react' + +import config from 'config' +import './libs.js' + +export * from '../../config/app.settings.js' +export * from './libs.js' + +export var endpoints = Endpoints + +export const package_json = require('../../package.json') + +export const UUAID = `${package_json.name}==${package_json.UUID}` + +export const AppInfo = { + apid: package_json.name, + stage: package_json.stage, + name: package_json.title, + version: package_json.version, + logo: config.FullLogoPath, + logo_dark: config.DarkFullLogoPath, +} + +localforage.config({ + name: UUAID, + version: 1.0, + size: 4980736, + storeName: package_json.name, +}) + + + +/** + * Convert a base64 string in a Blob according to the data and contentType. + * + * @param b64Data {String} Pure base64 string without contentType + * @param contentType {String} the content type of the file i.e (image/jpeg - image/png - text/plain) + * @param sliceSize {Int} SliceSize to process the byteCharacters + * @return Blob + */ +export function b64toBlob(b64Data, contentType, sliceSize) { + contentType = contentType || '' + sliceSize = sliceSize || 512 + + var byteCharacters = atob(b64Data) + var byteArrays = [] + + for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) { + var slice = byteCharacters.slice(offset, offset + sliceSize) + + var byteNumbers = new Array(slice.length) + for (var i = 0; i < slice.length; i++) { + byteNumbers[i] = slice.charCodeAt(i) + } + + var byteArray = new Uint8Array(byteNumbers) + + byteArrays.push(byteArray) + } + + var blob = new Blob(byteArrays, { type: contentType }) + return blob +} + +/** + * Convert a file in a B64 string according to the file. + * + * @param file {object} Raw File object + * @return b64 {string} + */ +export function ReadFileAsB64(file, callback) { + if (file) { + var reader = new FileReader() + reader.onload = function(readerEvt) { + var binaryString = readerEvt.target.result + const a = `data:image/png;base64, ${btoa(binaryString)}` + return callback(a) + } + reader.readAsBinaryString(file) + } +} + +/** + * Handle temporal file uploads + * + * @param file {object} Raw File object + * @return boolean + */ +export function uploadFile(file) { + var formData = new FormData() + formData.append('userfile', file) + var request = new XMLHttpRequest() + request.onload = function() { + if (request.status == 200) { + return true + } else { + alert('Error! Upload failed') + } + } + request.open('POST', '/temp/file') + request.send(formData) +} + +/** + * Return the value of an object from array + * + * @param payload {object} data: (array) | key: (string for return the value) + * @return {string} Boolean value + */ +export function ReturnValueFromMap(payload) { + if (!payload) return false + const { data, key } = payload + try { + const a = data.map(item => { + return item.key === key ? item.value : null + }) + const b = a.filter(Boolean) + return b.toString() + } catch (error) { + return false + } +} + +/** + * (HELPER) Convert the localStorage values (AppSettings) parsed + * + * @param e {String} String of SettingID for search + * @return {string} Boolean value + */ +export function SettingStoragedValue(e) { + try { + const fromStorage = JSON.parse(localStorage.getItem('app_settings')) + const Ite = fromStorage.map(item => { + return item.SettingID === e ? item.value : null + }) + const fr = Ite.filter(Boolean) + return fr.toString() + } catch (error) { + return null + } +} + +/** + * Return the last object from array + * + * @param array {array} + * @return object + */ +export function objectLast(array, n) { + if (array == null) return void 0 + if (n == null) return array[array.length - 1] + return array.slice(Math.max(array.length - n, 0)) +} + +/** + * Remove an element by id from an array + * + * @param array {array} + * @param value {string} + * @return object + */ +export function arrayRemoveByID(arr, value) { + return arr.filter(function(ele) { + return ele.id != value + }) +} + +/** + * Global fix for convert '1, 0' to string boolean 'true, false' + * + * @param e {int} Numeric boolean reference + * @return {bool} Boolean value + */ +export function booleanFix(e) { + if (e == 1) return true + return false +} + + +/** + * Handle time basic functions + * + */ +export const time = { + ago: a => { + const format = moment(a).format('DDMMYYYY') + const b = new Date(format).toLocaleString() + return time.relativeToNow(b) + }, + stmToAgo: a => { + const b = a * 1000 + return format(b) + }, + relativeToNow: (a, b) => { + return moment(a, b || 'DDMMYYYY').fromNow() + }, +} + + +/** + * Framework functionality for show with interface an notification + * + */ +const {FieldTimeOutlined} = require('@ant-design/icons') +export const notify = { + expire: (...res) => { + antd.notification.error({ + message: 'Hey ', + icon: , + description: res, + placement: 'bottomLeft', + }) + }, + info: (...res) => { + antd.notification.info({ + message: 'Well', + description: res.toString(), + placement: 'bottomLeft', + }) + }, + exception: (...res) => { + antd.notification.error({ + message: 'WoW!', + description: res.toString(), + placement: 'bottomLeft', + }) + }, + warn: (...res) => { + antd.notification.warn({ + message: 'Hey!', + description: res.toString(), + placement: 'bottomLeft', + }) + }, + success: (...res) => { + antd.notification.success({ + message: 'Well', + description: res.toString(), + placement: 'bottomLeft', + }) + }, + error: (...res) => { + antd.notification.error({ + message: 'Wopss', + description: ( +
+ An wild error appear! : +
+
+
+ {res.toString()} +
+
+ ), + placement: 'bottomLeft', + }) + }, + proccess: (...res) => { + antd.notification.open({ + icon: , + message: 'Please wait', + description:
{res}
, + placement: 'bottomLeft', + }) + }, +} + +/** + * User console with setting user permissions + * + * @param ... {any} Use for type of console + */ +export const yconsole = { + log: (...cont) => { + SettingStoragedValue('force_showDevLogs') ? console.log(...cont) : null + return + }, + debug: (...cont) => { + SettingStoragedValue('force_showDevLogs') ? console.debug(...cont) : null + return + }, + error: (...cont) => { + SettingStoragedValue('force_showDevLogs') ? console.error(...cont) : null + return + }, + warn: (...cont) => { + SettingStoragedValue('force_showDevLogs') ? console.warn(...cont) : null + return + }, +} + +/** + * Request FullScreen mode + * + */ +export function requestFullscreen() { + var elem = document.documentElement + if (elem.requestFullscreen) { + elem.requestFullscreen() + } else if (elem.mozRequestFullScreen) { + /* Firefox */ + elem.mozRequestFullScreen() + } else if (elem.webkitRequestFullscreen) { + /* Chrome, Safari and Opera */ + elem.webkitRequestFullscreen() + } else if (elem.msRequestFullscreen) { + /* IE/Edge */ + elem.msRequestFullscreen() + } +} diff --git a/.prev/src/components/App_about/index.js b/.prev/src/components/App_about/index.js new file mode 100644 index 00000000..e6c4f280 --- /dev/null +++ b/.prev/src/components/App_about/index.js @@ -0,0 +1,29 @@ +import React from 'react' +import styles from './index.less' +import * as ycore from 'ycore' +import * as antd from 'antd' + +export default class App_About extends React.Component { + DetectNoNStableBuild() { + if (ycore.package_json.DevBuild == false) { + return Stable + } else { + return No Stable + } + } + render() { + return ( +
+ + +

{ycore.AppInfo.name}

+ {ycore.UUAID} +
+ v{ycore.AppInfo.version} + {ycore.AppInfo.stage} + {this.DetectNoNStableBuild()} +
+
+ ) + } +} diff --git a/.prev/src/components/App_about/index.less b/.prev/src/components/App_about/index.less new file mode 100644 index 00000000..5dd1b8b1 --- /dev/null +++ b/.prev/src/components/App_about/index.less @@ -0,0 +1,18 @@ +.aboutWrapper { + margin: auto; + max-width: 70vw; + width: 500px; + vertical-align: middle; + position: relative; + background-color: rgba(73, 72, 72, 0.349); + + img { + width: 100%; + padding: 15px; + } +} + +.appName { + font-family: "Poppins", sans-serif; + font-size: 27px; +} \ No newline at end of file diff --git a/.prev/src/components/CustomIcons/index.js b/.prev/src/components/CustomIcons/index.js new file mode 100644 index 00000000..368614d2 --- /dev/null +++ b/.prev/src/components/CustomIcons/index.js @@ -0,0 +1,11 @@ +const VerifiedBadge = () => ( ) +const CommonThings = () => () +const SunSVG = () => () +const MoonSVG = () => () +const RobotOutlined = () => () +const SavedPost = () => () +const SavedPostColor = () => () +const SavedPostGrey = () => () +const TrendBlue = () => () +const CustomIcons = {SavedPostGrey, SavedPostColor, VerifiedBadge, CommonThings, SunSVG, MoonSVG, RobotOutlined, SavedPost} +export default CustomIcons diff --git a/.prev/src/components/HeaderSearch/index.js b/.prev/src/components/HeaderSearch/index.js new file mode 100644 index 00000000..d3aa7ccb --- /dev/null +++ b/.prev/src/components/HeaderSearch/index.js @@ -0,0 +1,83 @@ +import React, { Component } from 'react' +import * as antd from 'antd' +import * as ycore from 'ycore' +import styles from './index.less' +import classnames from 'classnames' +import * as Icons from '@ant-design/icons' + +export const SetHeaderSearchType = { + disable: () => { + window.HeaderSearchComponent.setState({ searchidden: true }) + }, + enable: () => { + window.HeaderSearchComponent.setState({ searchidden: false }) + }, + toPrimary: () => { + window.HeaderSearchComponent.setState({ framelocation: 'primary' }) + }, + toSecondary: () => { + window.HeaderSearchComponent.setState({ framelocation: 'secondary' }) + }, +} +export default class HeaderSearch extends Component { + constructor(props) { + super(props) + window.HeaderSearchComponent = this + this.state = { + value: '', + searchidden: false, + framelocation: 'primary', + } + } + + openSearcher = () => { + const { value } = this.state + ycore.SecondarySwap.openSearch(value); + } + + sendToSearch = () => { + const { value } = this.state + ycore.router.go(`s/${value}`) + } + + onChange = e => { + const { value } = e.target + this.setState({ value: value }) + if (ycore.AppSettings.auto_search_ontype == 'true') { + this.autosend() + } + } + + autosend = () => { + let timeout = null + let input = document.getElementById('search_input') + input.addEventListener('keyup', e => { + clearTimeout(timeout) + timeout = setTimeout(() => { + const { value } = this.state + ycore.router.go(`s/${value}`) + }, 500) + }) + } + + render() { + const { searchidden } = this.state + return ( +
+ + } + placeholder=" Search on Comty..." + onChange={this.onChange} + onPressEnter={this.openSearcher} + /> + +
+ ) + } +} diff --git a/.prev/src/components/HeaderSearch/index.less b/.prev/src/components/HeaderSearch/index.less new file mode 100644 index 00000000..90ab4950 --- /dev/null +++ b/.prev/src/components/HeaderSearch/index.less @@ -0,0 +1,78 @@ +@import '~themes/index.less'; + +.HeaderSearchWrapper { + z-index: 20; + top: 0; + display: flex; + margin: auto; + max-width: 510px; + min-width: 265px; + width: auto; + height: 50px; + + &.hidden { + display: none; + } +} + +.headerSearch { + width: 100%; + height: 100%; + + :global { + .ant-input-affix-wrapper { + height: 100%; + width: 100%; + display: flex; + + + margin: 0; + padding: 0; + + } + + .ant-input-affix-wrapper .ant-input-prefix { + left: 12px; + } + + .ant-input-affix-wrapper { + background-color: transparent !important; + border-color: transparent; + border-radius: 12px; + } + + .ant-input-affix-wrapper>input.ant-input { + padding: 0 0 0 30px; + border: inherit; + outline: inherit; + } + + .ant-input-affix-wrapper .ant-input-prefix, + .ant-input-affix-wrapper .ant-input-suffix { + background-color: transparent !important; + border-color: transparent; + border-radius: 12px; + position: absolute; + top: 50%; + z-index: 2; + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + color: rgba(0, 0, 0, .65); + line-height: 0; + -ms-transform: translateY(-50%); + transform: translateY(-50%); + color: #9d9da7 !important; + } + + .ant-input { + border-radius: 12px; + color: #9D9DA7; + background-color: #FFFFFF; + border-color: transparent; + height: 50px; + width: 510px; + } + } +} diff --git a/.prev/src/components/Layout/Control.js b/.prev/src/components/Layout/Control.js new file mode 100644 index 00000000..f32b462a --- /dev/null +++ b/.prev/src/components/Layout/Control.js @@ -0,0 +1,67 @@ +import React from 'react' +import * as antd from 'antd' +import * as ycore from 'ycore' +import styles from './Control.less' + +import Radium, { StyleRoot } from 'radium' +import { fadeInUp, bounceOutDown } from 'react-animations' +const animationStyles = { + fadeInUp: { + animation: 'x 0.5s', + animationName: Radium.keyframes(fadeInUp, 'fadeInUp'), + }, + bounceOutDown: { + animation: 'x 1s', + animationName: Radium.keyframes(bounceOutDown, 'bounceOutDown'), + }, +} + +export function SetControls(e) { + window.ControlComponent.DummySetControls(e) + return +} +export function CloseControls() { + window.ControlComponent.DummyCloseControls() + return +} + +class Control extends React.Component { + constructor(props) { + super(props) + window.ControlComponent = this + this.state = { + Show: false, + FadeIN: true, + } + } + DummySetControls = e => { + ycore.yconsole.log('Controls recived => ', e) + if (this.state.Show == false) { + this.setState({ FadeIN: true }) + } + this.setState({ Show: true, RenderFragment: e }) + } + DummyCloseControls() { + ycore.yconsole.log('Closing Control Bar...') + this.setState({ FadeIN: false }) + setTimeout(() => this.setState({ Show: false, RenderFragment: null }), 1000) + } + + render() { + const { RenderFragment, Show, FadeIN } = this.state + return Show ? ( + +
+ + {RenderFragment} + +
+
+ ) : null + } +} +export default Control diff --git a/.prev/src/components/Layout/Control.less b/.prev/src/components/Layout/Control.less new file mode 100644 index 00000000..c5594496 --- /dev/null +++ b/.prev/src/components/Layout/Control.less @@ -0,0 +1,26 @@ +@import '~themes/index.less'; + +.ControlCard { + overflow: hidden; + background-color: rgba(0, 0, 0, 0.1); + width: auto; + max-width: 60%; + padding: 0 5px 0 5px; + margin: 0 0 0 50%; + height: auto; + position: absolute; + z-index: 10000; + bottom: 0; + text-align: center; + + :global { + .ant-card-body { + padding: 5px; + } + + .ant-btn { + background-color: rgba(0, 0, 0, 0.1); + margin: 3px; + } + } +} \ No newline at end of file diff --git a/.prev/src/components/Layout/Secondary/index.js b/.prev/src/components/Layout/Secondary/index.js new file mode 100644 index 00000000..c618bd17 --- /dev/null +++ b/.prev/src/components/Layout/Secondary/index.js @@ -0,0 +1,254 @@ +import React from 'react' +import * as ycore from 'ycore' +import * as antd from 'antd' +import * as Icons from '@ant-design/icons' +import styles from './index.less' +import classnames from 'classnames' + +import { __priPost, __secComments, __priSearch, __trendings, __pro } from './renders.js' + +export const SwapMode = { + close: () => { + SecondaryLayoutComponent.Swapper.close() + }, + openPost: (a, b) => { + SecondaryLayoutComponent.setState({ + mode: 'post', + global_raw: a, + }) + SecondaryLayoutComponent.Swapper.open() + }, + openSearch: a => { + SecondaryLayoutComponent.setState({ + mode: 'search', + pri_raw: a, + }) + SecondaryLayoutComponent.Swapper.half() + }, + openFragment: fragment => { + SecondaryLayoutComponent.setState({ + mode: 'fragment', + global_raw: fragment, + }) + SecondaryLayoutComponent.Swapper.unique() + } +} + +export default class Secondary extends React.PureComponent { + constructor(props) { + super(props), + window.SecondaryLayoutComponent = this, + this.state = { + loading: true, + half: false, + swap: false, + mode: '', + gen_data: '', + global_raw: '', + pri_raw: '', + sec_raw: '', + } + } + + Swapper = { + close: () => { + this.setState({ + swap: false, + half: false, + unique: false, + pri_raw: null, + sec_raw: null, + global_raw: null, + mode: null, + }) + }, + open: () => { + this.setState({ + swap: true, + half: false, + unique: false, + }) + }, + half : () => { + this.setState({ + swap: false, + half: true, + unique: false, + }) + }, + unique: ()=>{ + this.setState({ + swap: false, + half: false, + unique: true, + }) + } + } + + SwapBalanceContent(container) { + switch (container) { + case '__pri': { + return this.__pri() + } + case '__sec': { + return this.__sec() + } + default: + return null + } + } + + __pri() { + const dtraw = this.state.pri_raw + switch (this.state.mode) { + case 'post': { + return this.renderPost(this.state.global_raw) + } + case 'search': { + return this.renderSearch(dtraw) + } + case 'fragment': { + return this.renderFragment() + } + default: + return this.renderMain() + } + } + __sec() { + const dtraw = this.state.sec_raw + switch (this.state.mode) { + case 'post': { + return this.renderComments(this.state.global_raw) + } + default: + return null + } + } + + renderSearch = key => { + const payload = { key: key } + ycore.comty_search.keywords((err, res) => { + if (err) { + ycore.notify.error(err) + } + ycore.yconsole.log('Founded entries => ', JSON.parse(res)) + this.setState({ global_raw: res, loading: false }) + }, payload) + return ( +
+

Results of {key || '... nothing ?'}

+ <__priSearch payload={this.state.global_raw} /> +
+ ) + } + + renderPost = payload => { + const post_data = JSON.parse(payload)['post_data'] + return <__priPost isMobile={this.props.isMobile} payload={post_data} /> + } + + renderComments = payload => { + try { + const post_comments = JSON.parse(payload)['post_comments'] + const post_data = JSON.parse(payload)['post_data'] + return ( + <__secComments post_id={post_data.post_id} payload={post_comments} /> + ) + } catch (error) { + return null + } + } + renderMain = payload => { + try { + const trending_data = JSON.parse(this.state.gen_data)['trending_hashtag'] + return( +
+ + {ycore.IsThisUser.pro()? <__pro /> : <__pro /> } + <__trendings data={trending_data} /> + + +
+ ) + } catch (error) { + return null + } + + } + renderFragment = () => { + try { + const fragment = this.state.global_raw + return {fragment} + } catch (error) { + return null + } + } + componentDidMount(){ + ycore.comty_get.general_data((err,res)=> { + if (err) return false + const notification_data = JSON.parse(res)['notifications'] + this.setState({ loading: false, gen_data: res, notification_data: notification_data }) + + }) + } + + render() { + const { userData, isMobile } = this.props + if (!this.state.loading) return ( + <> + {isMobile? null :
} +
+ {isMobile? null : +
+
+

{this.state.notification_data.length}

+
+ ycore.router.go(`@${userData.username}`)} + src={userData.avatar} + /> +
} + +
+ +
+ {this.state.swap || this.state.half || this.state.unique ? ( + } + onClick={() => this.Swapper.close()} + > + Back + + ) : null} + {this.SwapBalanceContent('__pri')} +
+ + +
+ {this.SwapBalanceContent('__sec')} +
+ +
+
+ + ) + return null + + } +} diff --git a/.prev/src/components/Layout/Secondary/index.less b/.prev/src/components/Layout/Secondary/index.less new file mode 100644 index 00000000..1c1eab8f --- /dev/null +++ b/.prev/src/components/Layout/Secondary/index.less @@ -0,0 +1,230 @@ +@import '~themes/index.less'; + +.__secondary_colider{ + position: relative; + float: right; + width: @__secondary_colider_width; + height: 100vh; + background-color: @__Global_layout_backgroud; +} + +.secondary_wrapper { + width: @secondary_wrapper_hidden_width; + height: 100vh; + + z-index: 50; + position: absolute; + right: 0; + top: 0; + overflow-x: hidden; + + display: flex; + + + + &.active { + width: @secondary_wrapper_showFull_width; + >.secondary_container_1 { + padding: @secondary_container_1_padding; + } + //@media (min-width: 1000px) { + // width: 95.4% + //} + } + + &.mobile { + width: 100%; + height: 0; + bottom: 0; + opacity: 0; + + top: unset; + overflow: hidden; + >.secondary_layout_bg{ + border-radius: 12px 12px 0 0; + flex-direction: column; + overflow-y: scroll; + overflow-x: hidden; + width: 100%; + } + .secondary_container_1{ + height: 85vh; + width: 100%; + } + .secondary_container_2{ + width: 100%; + padding: 10px 10px 60px 10px; + border-radius: 12px 12px 0 0; + } + :global{ + .comments_body { + padding: 30px 10px 10px 10px; + } + } + + &.active { + opacity: 1; + bottom: 0; + height: 100%; + width: 100%; + } + &.half{ + opacity: 1; + bottom: 0; + height: 60%; + width: 100%; + } + &.unique { + opacity: 1; + bottom: 0; + height: 100%; + width: 100%; + >.secondary_layout_bg { + background-color: #ffffff; + padding: 0; + border-radius: 12px 12px 0 0; + flex-direction: column; + overflow-y: scroll; + overflow-x: hidden; + width: 100%; + } + } + } + + &.half { + width: @secondary_wrapper_showHalf_width; + } + &.unique { + width: @secondary_wrapper_showFull_width; + >.secondary_layout_bg { + background-color: #ffffff; + padding-right: 90px; + } + } + transition: all @__Global_SwapAnimDuration ease-in-out; + +} + +.secondary_userholder { + right: 20px; + top: 25px; + display: flex; + position: absolute; + z-index: 51; + + img { + border-radius: 15px; + width: 40px; + transition: all 150ms linear; + box-shadow: 0px 0px 0 0px rgba(255, 255, 255, 0); + } + + img:hover { + box-shadow: 0px 0px 10px 0px rgba(255, 255, 255, 0.205); + transition: all 150ms linear; + } + + transition: all 150ms linear; + + .notif_box { + margin: 0 15px 0 5px; + width: 40px; + height: 40px; + border-radius: 15px; + background-color: #78CFED; + h1{ + line-height: 40px; + font-size: 16px; + color: #ffffff; + text-align: center; + margin: 0; + } + } +} + +.secondary_layout_bg { + width: 100%; + height: 100%; + + right: 0; + z-index: 50; + position: absolute; + display: flex; + overflow: hidden; + + transition: all @__Global_SwapAnimDuration ease-in-out; + background-color: @secondary_container_bg_background; + + border-radius: @__Global_layout_border-rd; +} + +.secondary_container_1 { + width: 100%; + height: 100%; + + position: relative; + padding: 30px 30px 30px 35px; + + color: @secondary_container_1_color; + + :global { + .ant-btn { + color: @secondary_container_1_btn_color; + background-color: @secondary_container_1_btn_backgroud; + border-color: transparent; + border-radius: 12px; + } + + .ant-btn:hover { + box-shadow: @secondary_container_1_btn_shadow; + transition: all @__Global_Components_transitions_dur linear; + } + } +} + +.secondary_container_2 { + position: relative; + height: 100vh; + width: 0; + right: -500px; + padding: @secondaty_container_2_padding; + + opacity: 0; + color: @secondary_container_2_color!important; + background-color: @secondary_container_2_backgroud; + + border-radius: 32px 0 0 32px; + + &.active { + width: 400px; + opacity: 1; + right: 0; + @media (min-width: 1000px) { + width: 600px + } + } + + transition: all @__Global_SwapAnimDuration ease-in-out; + +} + +.renderSearch_wrapper { + height: 87vh; + overflow: hidden; + margin: 20px 0 0 0; + font-family: @__Global_general_font_family; + h2 { + color: #ffffff; + } +} + + +.secondary_main{ + margin-top: 45px; + width: 100%; +} + + + + + diff --git a/.prev/src/components/Layout/Secondary/renders.js b/.prev/src/components/Layout/Secondary/renders.js new file mode 100644 index 00000000..790355b2 --- /dev/null +++ b/.prev/src/components/Layout/Secondary/renders.js @@ -0,0 +1,336 @@ +import React from 'react' +import styles from './renders.less' +import { SearchCard } from 'components' + +import * as antd from 'antd' +import * as ycore from 'ycore' +import * as Icons from '@ant-design/icons' +import Icon from '@ant-design/icons' + +import { MediaPlayer, PostCard } from 'components' + +const VerifiedBadge = () => ( + + + +) + +export class __priPost extends React.Component { + renderContent(payload) { + const { id, postText, postFile_full, post_time, publisher } = payload + const {isMobile}= this.props + if (!postFile_full) { + return ( +
+ {postText ? ( +
+

{' '} +

+ ) : null} +
+ ) + } + return ( +
+ {postFile_full ? : null} + {postText ? ( +
+

{' '} +

+ ) : null} +
+ ) + } + + render() { + const {payload} = this.props + if (!payload) { + return

This post not exists!!!

+ } + const { id, postText, postFile_full, post_time, publisher } = payload + return ( +
+
+
+

+ {publisher.username}{' '} + {ycore.booleanFix(publisher.verified) ? ( + + ) : null} +

+

+ {' '} + {post_time} {ycore.IsThisUser.dev() ? `| #${id}` : null}{' '} +

+
+ +
+ {this.renderContent(payload)} +
+ ) + } +} + +export class __secComments extends React.Component { + state = { + comment_data: this.props.payload, + raw_comment: '', + loading: false, + } + handleDeleteComment(id) { + ycore.yconsole.log(`Removing Comment with id => ${id}`) + ycore.comty_post_comment.delete( + (err, res) => { + if (err) { + return false + } + return this.reloadComments() + }, + { comment_id: id } + ) + } + handleNewComment() { + const { raw_comment } = this.state + const { post_id } = this.props + if (raw_comment) { + const payload = { post_id: post_id, raw_text: raw_comment } + ycore.comty_post_comment.new((err, res) => { + if (err) { + ycore.notify.error('This action could not be performed.', err) + } + this.setState({ raw_comment: '' }) + return this.reloadComments() + }, payload) + } + return false + } + + renderComment = a => { + const { id, time, Orginaltext, publisher } = a + const CommentMenu = ( + + this.handleDeleteComment(id)} + > + Delete + + + ) + return ( +
+
+ +

+ @{publisher.username}{' '} + {ycore.booleanFix(publisher.verified) ? ( + + ) : null} +

+ +

e.preventDefault()} + className={styles.comment_user_ago} + > + {ycore.time.stmToAgo(time)} +

+
+
+
+

{Orginaltext}

+
+
+ ) + } + HandleCommentInput = e => { + const { value } = e.target + this.setState({ raw_comment: value }) + } + reloadComments() { + try { + this.setState({ loading: true }) + const payload = { post_id: this.props.post_id } + ycore.comty_post.get((err, res) => { + const post_comments = JSON.parse(res)['post_comments'] + this.setState({ comment_data: post_comments, loading: false }) + }, payload) + } catch (error) { + return false + } + } + + render() { + const { comment_data, loading } = this.state + + return ( +
+
+

Comments ({comment_data.length})

+
+
+ {loading ? ( + + ) : ( + this.renderComment(item)} + /> + )} +
+
+
+ this.handleNewComment()} + placeholder="Write a comment..." + allowClear + onChange={this.HandleCommentInput} + /> +
+
+
+ ) + } +} + +export class __priSearch extends React.Component { + renderResult = source => { + try { + const Empty = ( +
+ +
+ ) + + // TO DO: Settings serach & Post Search + const usersParsed = JSON.parse(source)['users'] + const groupsParsed = JSON.parse(source)['groups'] + const pagesParsed = JSON.parse(source)['pages'] + + const users = () => { + if (usersParsed.length >= 1) { + ycore.yconsole.log('Users => ', usersParsed) + return this.EntryComponent('Users', usersParsed) + } + } + const groups = () => { + if (groupsParsed.length >= 1) { + ycore.yconsole.log('Groups => ', groupsParsed) + return this.EntryComponent('Groups', groupsParsed) + } + } + const pages = () => { + if (pagesParsed.length >= 1) { + ycore.yconsole.log('Pages => ', pagesParsed) + return this.EntryComponent('Pages', pagesParsed) + } + } + + if ( + !usersParsed.length >= 1 && + !groupsParsed.length >= 1 && + !pagesParsed.length >= 1 + ) { + return Empty + } + + return [users(), groups(), pages()] + } catch (error) { + return ( +
+

Render Error

+
+ ) + } + } + EntryComponent = (t, source) => { + try { + return ( + +
{ycore.router.go(`@${item.username}`)}}> +
+ +

+ @{item.username} + {ycore.booleanFix(item.verified) ? ( + + ) : null} +

+ +
+
+

{item.about}

+
+
+ } + /> + + ) + } catch (error) { + return ( +
+

Render Error

+
+ ) + } + } + render(){ + return( +
+ {this.renderResult(this.props.payload)} +
+ ) + } +} + +export class __trendings extends React.PureComponent { + render(){ + if (!this.props.data) return false + return( +
+

Trending now

+
+ ( +
+

#{item.tag}

+

{item.trend_use_num} Posts

+
)} + /> +
+
+ ) + } +} + +export class __pro extends React.PureComponent { + render(){ + return( +
+

+ Go Pro! +

+

Sabias que la frase de kintxi, se hace la que no me conoze se hizo mientras estaba borracho

+ Start now +
+ ) + } +} \ No newline at end of file diff --git a/.prev/src/components/Layout/Secondary/renders.less b/.prev/src/components/Layout/Secondary/renders.less new file mode 100644 index 00000000..0018d0c5 --- /dev/null +++ b/.prev/src/components/Layout/Secondary/renders.less @@ -0,0 +1,356 @@ +@import '~themes/index.less'; + +.SecondaryBody { + width: 100%; + height: 100%; +} + +.UserContainer { + display: flex; + position: relative; + float: right; + z-index: 150; + transform: translate(0, -40px); + + .UserContainer_text { + margin: 0 8px; + + h4 { + text-align: right; + } + + p { + word-break: break-all; + text-align: right; + font-size: 11px; + color: #eeeeee !important; + } + } + + +} + +.postAvatar { + position: absolute; + left: -8px; + top: -8px; + display: flex; +} + +.titleUser { + display: flex; + font-family: 'Poppins', sans-serif; + margin: 0 0 0 50px; + color: #ffffff !important; +} + +.textAgo { + display: flex; + font-size: 10px; + margin: 0 0 0 53px; +} + +.PostTags { + float: right; + width: 100%; + z-index: 10; + + :global { + .anticon { + color: rgb(249, 179, 64); + float: right; + margin: -0 6px 0 0; + ; + font-size: 17px; + } + + .MoreMenu { + color: #2d2d2d !important; + } + } +} + +.titleWrapper { + display: flex; + + h4 { + cursor: pointer; + } + + color: #ffffff !important; + +} + +.contentWrapper { + margin: auto; + width: 100%; + padding: 20px; +} + + +.postContent { + word-break: break-all; + position: absolute; + vertical-align: bottom; + border-radius: 7px; + bottom: 0; + max-width: 50vw; + + background-color: #2d2d2d4b; + padding: 10px; + + h3 { + font-family: "Poppins", sans-serif; + color: #ffffff; + font-weight: 400; + font-size: 15px; + letter-spacing: -0.3px; + } +} + +.postContent_OnlyText { + padding: 25% 0 0 0; + position: relative; + vertical-align: middle; + +} + + +.likebtn { + :global { + svg { + color: rgba(0, 0, 0, 0.45); + } + + svg:hover { + color: rgb(233, 35, 68); + transition: all 0.2s linear; + } + } +} + +.comments_body { + height: 100%; + font-family: "Poppins", sans-serif; + padding: 75px 10px 10px 20px; + + .comments_body_title { + font-size: 12px; + + h1 { + font-weight: 550; + letter-spacing: 0.01px; + } + } + + .comments_cards_wrapper { + z-index: 50; + overflow: scroll; + height: 84%; + :global { + overflow: scroll; + } + + .comment_card { + position: relative; + width: 100%; + background-color: #ffffff; + word-break: break-all; + + .comment_title { + display: flex; + + img { + float: left; + width: 30px; + height: 30px; + border-radius: 12px; + } + + .comment_user_username { + margin: 0 5px 0 8px; + vertical-align: middle; + height: 100%; + color: #2d2d2d; + line-height: 25px; + } + + .comment_user_ago { + cursor: pointer; + position: absolute; + right: 0; + text-align: right; + font-size: 9px; + } + } + + .comment_text { + margin: 10px 0 0 0; + } + + } + } + + .comment_box { + width: 100%; + bottom: 0; + right: 0; + position: absolute; + z-index: 100; + background-color: #ffffffd7; + padding-top: 20px; + padding-bottom: 60px; + border-radius: 0 0 0 32px; + + .comment_box_body { + border-radius: 5px; + width: 85%; + height: 40px; + margin: auto; + background-color: #f8f6f8; + + :global { + + .ant-input-affix-wrapper, + .ant-input { + padding: 4px 5px; + background-color: transparent; + border: 0; + } + } + } + } + +} + +.search_wrapper{ + color: #ffffff; + height: 100%; + width: 82%; + margin: auto; + :global{ + .ant-result-title{ + color: @secondary_container_1_color!important; + } + .ant-result-subtitle{ + color: @secondary_container_1_color!important; + + } + .ant-list-items{ + height: 82vh; + overflow: scroll; + } + } +} + +.search_card { + position: relative; + background-color: rgba(255, 255, 255, 0.034); + margin: 10px 0 10px 0; + border-radius: 8px; + padding: 10px; + word-break: break-all; + color: #ffffff; + cursor: pointer; + + .search_title { + display: flex; + + img { + float: left; + width: 30px; + height: 30px; + border-radius: 12px; + } + + .search_user_username { + margin: 0 5px 0 8px; + vertical-align: middle; + height: 100%; + color: #ffffff; + line-height: 25px; + } + } + + .search_text { + margin: 10px 0 0 0; + } + +} + +.secondary_hastags { + font-family: @__Global_general_font_family; + color: #ffffff; + font-size: 12px; + + + .secondary_hastags_title{ + h2{color: #ffffff;} + } + + .secondary_hastags_body{ + margin: 20px 0 0 0; + background-color: hsl(0, 0%, 21%); + border-radius: 12px; + word-break: break-all; + padding: 5px 5px 5px 10px; + height: auto; + + .hash{ + margin: 5px 0 3px 0; + cursor: pointer; + } + + p{ + margin: 0; + color: #2196F3; + font-size: 12px; + max-height: 35px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + } + + } + +} + + + + +.secondary_adv_pro{ + border-radius: 12px; + // background-color: #ff4d4e; + background: rgb(255,77,78); + background: linear-gradient(49deg, rgba(255,77,78,1) 15%, rgba(255,87,56,1) 55%, rgba(255,97,36,1) 73%, rgba(255,105,19,1) 82%, rgba(255,114,0,1) 94%); + + margin: 70px 0 30px 0; + padding: 14px; + + width: 100%; + height: 140px; + + h1{ + color: #ffffff; + font-family: "Poppins", sans-serif; + font-size: 18px; + margin-bottom: 0; + } + p{ + font-size: 9px; + + } + + :global{ + .ant-btn{ + vertical-align: bottom; + border: 0; + background-color: #d24345a2; + border-radius: 7px; + height: 27px; + padding: 2px 7px; + font-size: 12px; + font-weight: 600; + } + } +} \ No newline at end of file diff --git a/.prev/src/components/Layout/Sider/default.js b/.prev/src/components/Layout/Sider/default.js new file mode 100644 index 00000000..e3f6de52 --- /dev/null +++ b/.prev/src/components/Layout/Sider/default.js @@ -0,0 +1,107 @@ +import React from 'react' +import * as antd from 'antd' +import * as Icons from '@ant-design/icons' +import Icon from '@ant-design/icons' + +import { withI18n, Trans } from '@lingui/react' +import styles from './default.less' +import * as ycore from 'ycore' +import CustomIcons from '../../CustomIcons' + +@withI18n() +export default class Sider_Default extends React.PureComponent { + render() { + const { handleClickMenu, logo } = this.props + return ( +
+ +
+ ycore.router.go('main')} + src={logo} + /> +
+ +
+ + + + + + Explore + + + + + + + Saves + + + + + + + + Marketplace + + + + + + + + Events + + + + + +
+ + + + + Settings + + + {ycore.IsThisUser.dev() ? ( + + + Debug + + ) : ( + undefined + )} + + + + + Logout + + + + +
+ +
+
+
+ ) + } +} diff --git a/.prev/src/components/Layout/Sider/default.less b/.prev/src/components/Layout/Sider/default.less new file mode 100644 index 00000000..35b6478c --- /dev/null +++ b/.prev/src/components/Layout/Sider/default.less @@ -0,0 +1,137 @@ +@import '~themes/index.less'; + + +.left_sider_wrapper { + border-color: transparent; + font-size: 13px; + font-family: @__Global_general_font_family; + height: 100vh; + z-index: 40; + float: left; + position: relative; + + :global { + .ant-layout-sider { + background-color: @left_sider_backgroud; + + .ant-menu { + vertical-align: middle; + margin: 0 0 0 5px; + } + + .ant-menu-item { + color: @left_sider_color; + } + + .anticon { + font-size: @left_sider_sizeIcons; + } + + .ant-menu-inline-collapsed, + .antd-menu-vertical-left, + .ant-menu-vertical { + :hover { + background-color: @left_sider_menu__onhover_backgroud; + color: @left_sider_menu__onhover_color; + } + + border-right: 0 solid transparent; + } + } + } +} + + +.left_sider_brandholder { + cursor: pointer; + + img { + display: flex; + vertical-align: middle; + padding: 5px; + margin: 7px auto 15px auto; + width: 100%; + max-height: 58px; + transform: translate(2px, 0); + } +} + +.something_thats_pulling_me_down { + margin: 0 0 12px 0; + :global { + text-align: center; + bottom: 0; + position: absolute; + width: 100%; + .anticon{ + font-size: 15px!important; + } + .ant-menu-item{ + height: 35px!important; + line-height: 0px!important; + padding: 0!important; + margin: 0!important; + } + } +} + +.left_sider_container { + border-right: transparent; + height: 100%; + z-index: 50; +} + +.left_sider_menuContainer { + height: 100%; + margin: 18px 0 8px 0; + + overflow-x: hidden; + flex: 1; + + :global { + .ant-layout-sider-children { + display: flex; + flex-direction: column; + justify-content: space-between; + } + + .ant-layout-sider-collapsed { + .ant-menu-item { + left: 0; + margin: 0; + padding: 0; + } + + .ant-menu-inline-collapsed>.ant-menu-item { + padding: 0; + left: 0; + } + } + + .ant-menu-inline .ant-menu-item { + font-family: @__Global_general_font_family; + } + + .ant-menu-dark .ant-menu-item a { + color: rgb(197, 197, 197); + } + } +} + +.left_sider_menuItems { + background-color: transparent; + margin-bottom: 8px; + width: 100%; + font-weight: 500; + + animation: fadein 0.5s; + + :global { + .ant-menu-item { + padding: 0 !important; + margin: 2px auto 2px auto; + width: 100%; + text-align: center; + } + } +} \ No newline at end of file diff --git a/.prev/src/components/Layout/Sider/index.js b/.prev/src/components/Layout/Sider/index.js new file mode 100644 index 00000000..bd8b1202 --- /dev/null +++ b/.prev/src/components/Layout/Sider/index.js @@ -0,0 +1,51 @@ +import React from 'react' +import { config } from 'utils' +import * as ycore from 'ycore' + +import Sider_Mobile from './mobile.js' +import Sider_Default from './default.js' + +class Sider extends React.PureComponent { + + onClickFunctions = { + saves: (e) => { + this.setState({selectedKey: e}) + ycore.router.go('saves') + }, + events: (e) => { + this.setState({selectedKey: e}) + ycore.router.go('events') + }, + marketplace: (e) => { + this.setState({selectedKey: e}) + ycore.router.go('marketplace') + }, + explore: (e) => { + this.setState({selectedKey: e}) + ycore.router.go('main') + }, + } + + handleClickMenu = e => { + e.key === 'SignOut' && ycore.app_session.logout() + e.key === 'general_settings' && ycore.router.go('settings') + e.key === 'profile' && ycore.router.goprofile() + e.key === 'saves' && this.onClickFunctions.saves(e.key) + e.key === 'events' && this.onClickFunctions.events(e.key) + e.key === 'marketplace' && this.onClickFunctions.marketplace(e.key) + e.key === 'explore' && this.onClickFunctions.explore(e.key) + e.key === 'debug_area' && ycore.router.go('__m') + } + + render() { + const { isMobile } = this.props + const sider_props = {handleClickMenu: this.handleClickMenu ,logo: config.LogoPath, menulist: null, userData: this.props.userData} + + if (isMobile) { + return + } + return + } +} + +export default Sider diff --git a/.prev/src/components/Layout/Sider/mobile.js b/.prev/src/components/Layout/Sider/mobile.js new file mode 100644 index 00000000..cf482c2b --- /dev/null +++ b/.prev/src/components/Layout/Sider/mobile.js @@ -0,0 +1,51 @@ +import React from 'react' +import * as antd from 'antd' +import * as Icons from '@ant-design/icons' +import Icon from '@ant-design/icons' + +import { withI18n, Trans } from '@lingui/react' +import styles from './mobile.less' +import * as ycore from 'ycore' +import CustomIcons from '../../CustomIcons' + +@withI18n() +export default class Sider_Mobile extends React.PureComponent { + render() { + const { handleClickMenu, userData } = this.props + return ( +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ ) + } +} diff --git a/.prev/src/components/Layout/Sider/mobile.less b/.prev/src/components/Layout/Sider/mobile.less new file mode 100644 index 00000000..fcc8eb2a --- /dev/null +++ b/.prev/src/components/Layout/Sider/mobile.less @@ -0,0 +1,50 @@ +@import '~themes/index.less'; + + +.left_sider_wrapper { + overflow: hidden!important; + position: absolute; + z-index: 500; + bottom: 0; + right: 0; + left: 0; + + height: 50px; + width: 100%; + + border-color: transparent; + font-size: 13px; + font-family: @__Global_general_font_family; + padding: 0 27px; + + :global { + .ant-layout-sider { + background-color: transparent; + height: 100%; + + .ant-menu-item {color: @left_sider_color;} + .anticon {font-size: @left_sider_sizeIcons;} + .ant-menu-item{margin: auto; padding: 0;} + + .ant-menu { + background-color: #2d2d2d; + height: 100%; + border-radius: 27px 27px 0 0; + padding: 0 27px; + display: flex; + } + + .ant-menu-horizontal { + line-height: 46px; + white-space: nowrap; + border: 0; + border-bottom: 0; + box-shadow: none; + } + } + } + + + +} + diff --git a/.prev/src/components/Layout/index.js b/.prev/src/components/Layout/index.js new file mode 100644 index 00000000..7ad2e67a --- /dev/null +++ b/.prev/src/components/Layout/index.js @@ -0,0 +1,5 @@ +import Sider from './Sider/index.js' +import Control from './Control' +import Secondary from './Secondary/index.js' + +export { Sider, Control, Secondary } diff --git a/.prev/src/components/Like_button/index.js b/.prev/src/components/Like_button/index.js new file mode 100644 index 00000000..018b53c8 --- /dev/null +++ b/.prev/src/components/Like_button/index.js @@ -0,0 +1,106 @@ +import React from 'react' +import styles from './index.scss' +import * as ycore from 'ycore' +import classnames from 'classnames' + +class Like_button extends React.PureComponent { + constructor(props) { + super(props), + this.state = { + liked: this.props.liked, + likes: this.props.count, + type: this.props.liked ? 'dislike' : 'like', + clicked: false, + } + } + + SumLike() { + this.setState({ + likes: parseInt(this.state.likes) + 1, + type: 'dislike', + }) + setTimeout(() => { + this.setState({ liked: true }) + }, 500) + } + RestLike() { + this.setState({ + likes: parseInt(this.state.likes) - 1, + type: 'like', + }) + setTimeout(() => { + this.setState({ liked: false }) + }, 500) + } + + dispatchLike(e) { + const { type } = this.state + ycore.yconsole.log(`Dispatch ${type} to post id => ${e}`) + this.setState({ clicked: true }) + setTimeout(() => { + this.setState({ clicked: false }) + }, 500) + const payload = { post_id: e } + ycore.comty_post.like((err, res) => { + if (err) { + ycore.notify.error(res) + return + } + if (type == 'like') { + this.SumLike() + } + if (type == 'dislike') { + this.RestLike() + } + }, payload) + } + render() { + const { id } = this.props + const { likes, liked, clicked } = this.state + if (!id) { + ycore.yconsole.error('[LikeBTN] No post id provided!') + return null + } + return ( +
+ +

+ {likes} +

+
+ ) + } +} + +export default Like_button diff --git a/.prev/src/components/Like_button/index.scss b/.prev/src/components/Like_button/index.scss new file mode 100644 index 00000000..2f10bdf9 --- /dev/null +++ b/.prev/src/components/Like_button/index.scss @@ -0,0 +1,205 @@ + .like_button, + .like_button:before, + .like_button:after { + position: relative; + box-sizing: border-box; + } + + .ripple, + .ripple:before, + .ripple:after { + position: relative; + box-sizing: border-box; + } + + .btnWrapper { + display: flex; + } + + .likeCounter { + font-family: "Poppins", sans-serif; + line-height: 70px; + margin: 0 0 0 10px; + + opacity: 0; + transform: perspective(100px) translateZ(10px); + filter: blur(10px); + letter-spacing: 0.1em; + + &.active { + opacity: 1; + transform: perspective(100px) translateZ(0px); + filter: blur(0px); + letter-spacing: 0.15em; + transition: opacity 1000ms linear, transform 1000ms linear, filter 400ms linear, letter-spacing 1000ms linear; + } + + &.past { + opacity: 0; + transform: perspective(100px) translateZ(-10px); + filter: blur(10px); + letter-spacing: 0.2em; + transition: opacity 1000ms linear, transform 1000ms linear, filter 400ms linear, letter-spacing 1000ms linear; + } + + } + + .like_button { + --color-heart: #EA442B; + --easing: cubic-bezier(.7, 0, .3, 1); + --duration: .5s; + + font-size: 40px; + border: none; + border-radius: 50%; + background: white; + width: 1em; + height: 1em; + padding: 0; + margin: 0; + outline: none; + z-index: 2; + transition: transform var(--duration) var(--easing); + cursor: pointer; + + &:before { + z-index: -1; + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: inherit; + transition: inherit; + } + + &:after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: #fff; + border-radius: inherit; + z-index: -1; + } + + + + + @keyframes depress { + + from, + to { + transform: none; + } + + 50% { + transform: translateY(5%) scale(0.9); + } + } + + @keyframes depress-shadow { + + from, + to { + transform: none; + } + + 50% { + transform: scale(0.5); + } + } + } + + .like_wrapper { + display: grid; + align-items: center; + justify-content: center; + z-index: 1; + + >* { + margin: auto; + grid-area: 1 / 1; + } + } + + .heart { + width: .5em; + height: .5em; + display: block; + transform-origin: center 80%; + + >path { + stroke: var(--color-heart); + stroke-width: 2; + transition: fill var(--duration) var(--easing); + fill: var(--color-heart); + } + + &.empty { + >path { + stroke: var(--color-heart); + stroke-width: 2; + transition: fill var(--duration) var(--easing); + fill: transparent; + } + } + + &.clickanim { + animation: heart-bounce var(--duration) var(--easing); + + @keyframes heart-bounce { + 40% { + transform: scale(0.7); + } + + 0%, + 80%, + 100% { + transform: scale(1); + } + } + } + + animation: none; + } + + .ripple { + height: 1em; + width: 1em; + border-radius: 50%; + overflow: hidden; + z-index: 1; + + &:before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: .4em solid var(--color-heart); + border-radius: inherit; + transform: scale(0); + } + + &.clickanim { + &:before { + animation: ripple-out var(--duration) var(--easing); + + @keyframes ripple-out { + from { + transform: scale(0); + } + + to { + transform: scale(5); + } + } + } + } + + } diff --git a/.prev/src/components/Loader/Loader.js b/.prev/src/components/Loader/Loader.js new file mode 100644 index 00000000..78f4b8da --- /dev/null +++ b/.prev/src/components/Loader/Loader.js @@ -0,0 +1,28 @@ +import React from 'react' +import classNames from 'classnames' +import styles from './Loader.less' + +const Loader = (loading) => { + return ( +
+ Loading... +
+
+
+
+
+
+
+
+
+
+ +
+ + ) +} + + +export default Loader diff --git a/.prev/src/components/Loader/Loader.less b/.prev/src/components/Loader/Loader.less new file mode 100644 index 00000000..87342ddf --- /dev/null +++ b/.prev/src/components/Loader/Loader.less @@ -0,0 +1,118 @@ +@import '~themes/index.less'; + +.wrapper { + font-family: @__Global_general_font_family; + color: white; + line-height: 55px; + span{ + margin: 0 10px 0 auto; + } + + position: absolute; + z-index: 1000; + right: 0; + bottom: 0; + width: 140px; + height: 55px; + display: flex; + flex-direction: row; + justify-content: space-around; + background-color: #2d2d2dc2; + border-radius: 28px; + margin: 10px; + + + &.end { + animation: unshow 0.8s linear; + .newloader>div { + animation: loader 0.8s linear; + } + opacity: 0; + display: none; + } + + .newloader { + transform: translate(21px,27px) scale(0.3); + width: 0px; + height: 0px; + margin: 0 45px 0 0; + position: relative; + } + + .newloader>div { + width: 6px; + height: 20px; + position: absolute; + left: -10px; + bottom: 15px; + border-radius: 5px; + transform-origin: 10px 35px; + transform: rotate(0deg); + animation: loader 0.8s infinite; + } + + .newloader>div:nth-child(2) { + transform: rotate(45deg); + animation-delay: 0.1s; + } + + .newloader>div:nth-child(3) { + transform: rotate(90deg); + animation-delay: 0.2s; + } + + .newloader>div:nth-child(4) { + transform: rotate(135deg); + animation-delay: 0.3s; + } + + .newloader>div:nth-child(5) { + transform: rotate(180deg); + animation-delay: 0.4s; + } + + .newloader>div:nth-child(6) { + transform: rotate(225deg); + animation-delay: 0.5s; + } + + .newloader>div:nth-child(7) { + transform: rotate(270deg); + animation-delay: 0.6s; + } + + .newloader>div:nth-child(8) { + transform: rotate(315deg); + animation-delay: 0.7s; + } +} + +@keyframes loader { + 0% { + background: transparent; + left: -10px; + transform-origin: 10px 35px; + } + + 30% { + background: #fff; + } + + 100% { + background: transparent; + left: 10px; + transform-origin: -10px 35px; + } +} + +@keyframes unshow { + 0% { + opacity: 1; + display: block; + } + + 100% { + opacity: 0; + display: none; + } +} \ No newline at end of file diff --git a/.prev/src/components/MainFeed/components/index.js b/.prev/src/components/MainFeed/components/index.js new file mode 100644 index 00000000..2042fda5 --- /dev/null +++ b/.prev/src/components/MainFeed/components/index.js @@ -0,0 +1,5 @@ +import ComponentNewAV from './newav' +import ComponentInvalid from './invalid' +import renderFeedPosts from './renderFeedPosts' + +export { ComponentNewAV, ComponentInvalid, renderFeedPosts } \ No newline at end of file diff --git a/.prev/src/components/MainFeed/components/invalid/index.js b/.prev/src/components/MainFeed/components/invalid/index.js new file mode 100644 index 00000000..80f65615 --- /dev/null +++ b/.prev/src/components/MainFeed/components/invalid/index.js @@ -0,0 +1,24 @@ +import { Card } from 'antd' +import { ExclamationCircleOutlined } from '@ant-design/icons' + +const ComponentInvalid = fn => { + return ( + +

+ Invalid Data +

+ + If this error has occurred several times, try restarting the app + +
+ ) +} + +export default ComponentInvalid diff --git a/.prev/src/components/MainFeed/components/invalid/invalid.less b/.prev/src/components/MainFeed/components/invalid/invalid.less new file mode 100644 index 00000000..e69de29b diff --git a/.prev/src/components/MainFeed/components/newav/index.js b/.prev/src/components/MainFeed/components/newav/index.js new file mode 100644 index 00000000..214c327c --- /dev/null +++ b/.prev/src/components/MainFeed/components/newav/index.js @@ -0,0 +1,11 @@ +import { Button } from 'antd' +import styles from './newav.less' +const ComponentNewAV = fn => { + return ( +
+ +
+ ) +} + +export default ComponentNewAV \ No newline at end of file diff --git a/.prev/src/components/MainFeed/components/newav/newav.less b/.prev/src/components/MainFeed/components/newav/newav.less new file mode 100644 index 00000000..9e5529d8 --- /dev/null +++ b/.prev/src/components/MainFeed/components/newav/newav.less @@ -0,0 +1,3 @@ +.main_feed_newav{ + +} \ No newline at end of file diff --git a/.prev/src/components/MainFeed/components/renderFeedPosts/index.js b/.prev/src/components/MainFeed/components/renderFeedPosts/index.js new file mode 100644 index 00000000..9f24b228 --- /dev/null +++ b/.prev/src/components/MainFeed/components/renderFeedPosts/index.js @@ -0,0 +1,43 @@ +import React from 'react' +import { PostCard } from 'components' +import { yconsole } from 'ycore' +import { Button, List } from 'antd' +import { DownSquareOutlined } from '@ant-design/icons' +const renderFeedPosts = payload => { + const { data, loading, isEnd, feedGet } = payload + const loadMore = + !isEnd && !loading ? ( +
+
+ ) : null + try { + yconsole.log(data) + return ( + ( +
+ +
+ )} + /> + ) + } catch (err) { + return false + } +} + +export default renderFeedPosts diff --git a/.prev/src/components/MainFeed/index.js b/.prev/src/components/MainFeed/index.js new file mode 100644 index 00000000..e48e13e0 --- /dev/null +++ b/.prev/src/components/MainFeed/index.js @@ -0,0 +1,186 @@ +import React from 'react' +import * as antd from 'antd' +import * as ycore from 'ycore' +import styles from './index.less' + +import { ComponentNewAV, ComponentInvalid, renderFeedPosts } from './components/index.js' + +export const RenderFeed = { + RefreshFeed: () => { + window.MainFeedComponent.feedGet.first() + return + }, + killByID: post_id => { + window.MainFeedComponent.killByID(post_id) + return + }, + addToRend: payload => { + window.MainFeedComponent.addToRend(payload) + return + }, + goToElement: post_id => { + ycore.goTo.element(post_id) + }, + disableMenu: () => { + window.MainFeedComponent.setState({ + disableMenu: true, + }) + }, + sync: (c) => { + window.MainFeedComponent.syncService(c) + return + } +} +class MainFeed extends React.PureComponent { + constructor(props) { + super(props) + window.MainFeedComponent = this + this.state = { + NewAV: false, + invalid: false, + loading: false, + disableMenu: false, + data: [], + fkey: 0, + } + } + + componentDidMount() { + this.feedGet.first() + ycore.sync.FeedListen((data) => { + this.syncService(data) + }) + } + + toogleLoader() { + this.setState({ loading: !this.state.loading }) + } + + syncService(data){ + if (!data) return false + const { last_post_id, now } = data + const first = this.state.data[0] + if (first){ + const a = first.id + console.log(` SYNC => ${last_post_id} | LAST => ${a}`) + if(last_post_id>a){ + this.setState({ NewAV: true }) + } + } + } + + killByID(post_id) { + const a = this.state.data + const b = ycore.arrayRemoveByID(a, post_id) + this.setState({ data: b }) + } + + addToRend(payload) { + let a = this.state.data + a.unshift(payload) + this.setState({ data: a }) + } + + feedGet = { + first: ()=>{ + try { + const { get, uid, filters } = this.props + if (this.props.custompayload) { + this.setState({ + isEnd: true, + NewAV: false, + data: this.props.custompayload, + loading: false, + }) + return + } + if (!get) { + ycore.yconsole.error('Please, fill params with an catch type...') + return + } + this.toogleLoader() + const payload = { fkey: 0, type: get, id: uid } + ycore.comty_post.getFeed((err, res) => { + if (err) { + ycore.notify.error('Error when get data from this input') + return + } + if (JSON.parse(res).api_status == '400') { + this.setState({ invalid: true }) + return + } + try { + const parsed = JSON.parse(res)['data'] + const isEnd =parsed.length < ycore.AppSettings.limit_post_catch ? true : false + this.setState({ NewAV: false, isEnd: isEnd, data: parsed, loading: false }) + } catch (error) { + ycore.yconsole.log(error) + } + }, payload) + } catch (err) { + ycore.notify.error('err') + } + }, + more(fkey){ + try { + const { get, uid, filters } = this.props + if (!get) { + ycore.yconsole.error('Please, fill params with an catch type...') + return + } + if (!fkey) { + ycore.yconsole.warn( + 'Please, provide a fkey for offset the feed, default using => 0' + ) + } + this.toogleLoader() + const getLastPost = ycore.objectLast(this.state.data) + ycore.yconsole.log('LAST POST ID =>', getLastPost.id) + + const payload = { fkey: getLastPost.id, type: get, id: uid } + ycore.comty_post.getFeed((err, res) => { + if (err) { + return false + } + const oldData = this.state.data + const parsed = JSON.parse(res)['data'] + const mix = oldData.concat(parsed) + const isEnd = + parsed.length < ycore.AppSettings.limit_post_catch ? true : false + this.setState({ isEnd: isEnd, data: mix, loading: false }, () => + ycore.goTo.element(getLastPost.id) + ) + return true + }, payload) + } catch (err) { + ycore.notify.error(err) + } + } + } + + + render() { + const { data, loading, isEnd, invalid, NewAV } = this.state + const renderFeedPosts_payload = {data: data, loading: loading, isEnd: isEnd, feedGet: this.feedGet} + + if (invalid){ + return ComponentInvalid() + } + if (loading) { + return ( + + + + ) + } + if (!loading) { + return ( +
+ {NewAV? ComponentNewAV(() => this.feedGet.first()) : null} + {renderFeedPosts(renderFeedPosts_payload)} +
+ ) + } + } +} +export default MainFeed diff --git a/.prev/src/components/MainFeed/index.less b/.prev/src/components/MainFeed/index.less new file mode 100644 index 00000000..599b9120 --- /dev/null +++ b/.prev/src/components/MainFeed/index.less @@ -0,0 +1,4 @@ +.main_feed_wrapper{ + scroll-behavior: smooth; + +} diff --git a/.prev/src/components/MediaPlayer/index.js b/.prev/src/components/MediaPlayer/index.js new file mode 100644 index 00000000..3854396b --- /dev/null +++ b/.prev/src/components/MediaPlayer/index.js @@ -0,0 +1,65 @@ +import React from 'react' +import classnames from 'classnames' +import styles from './index.less' + +export default class MediaPlayer extends React.PureComponent { + player() { + const { file } = this.props + let type + + const ImageExtensions = ['.png', '.jpg', '.jpeg', '.gif'] + const VideoExtensions = ['.mp4', '.mov', '.avi'] + const AudioExtensions = ['.mp3', '.ogg', '.wav'] + + const FilesAllowed = ImageExtensions.concat( + VideoExtensions, + AudioExtensions + ) + + for (const prop in FilesAllowed) { + if (file.includes(`${ImageExtensions[prop]}`)) { + type = 'image' + } + if (file.includes(`${VideoExtensions[prop]}`)) { + type = 'video' + } + if (file.includes(`${AudioExtensions[prop]}`)) { + type = 'audio' + } + } + + if (type == 'video') { + // const payload = {type: 'video', sources: [{src: file,}]} + // return ( + // + // ) + return ( + + ) + } + if (type == 'audio') { + return ( + + ) + } + if (type == 'image') { + return + } + } + render() { + return ( +
+ {this.player()} +
+ ) + } +} diff --git a/.prev/src/components/MediaPlayer/index.less b/.prev/src/components/MediaPlayer/index.less new file mode 100644 index 00000000..6478f35f --- /dev/null +++ b/.prev/src/components/MediaPlayer/index.less @@ -0,0 +1,80 @@ +.PlayerContainer { + width: 100%; + + img { + width: 100%; + overflow: hidden; + margin: auto; + } + + video { + max-height: 600px; + width: 100%; + overflow: hidden; + } + + audio { + width: 100%; + } + + + &.entire { + max-width: 52vw; + max-height: 80vh; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-70%, -50%); + + img { + object-fit: contain; + height: 100%; + width: 100%; + max-width: 52vw; + max-height: 80vh; + } + + audio { + height: 100%; + width: 100%; + } + + video { + object-fit: contain; + height: 100%; + width: 100%; + max-width: 52vw; + max-height: 80vh; + } + } + + &.mobile { + max-width: 52vw; + max-height: 80vh; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + + img { + object-fit: contain; + height: 100%; + width: 100%; + max-width: 52vw; + max-height: 80vh; + } + + audio { + height: 100%; + width: 100%; + } + + video { + object-fit: contain; + height: 100%; + width: 100%; + max-width: 52vw; + max-height: 80vh; + } + } +} diff --git a/.prev/src/components/MediaPlayer/plyr.js b/.prev/src/components/MediaPlayer/plyr.js new file mode 100644 index 00000000..6a65adfa --- /dev/null +++ b/.prev/src/components/MediaPlayer/plyr.js @@ -0,0 +1,134 @@ +"use strict"; + +function e(e) { + return e && "object" == typeof e && "default" in e ? e.default : e +} +Object.defineProperty(exports, "__esModule", { + value: !0 +}); +var t = e(require("react")), + n = e(require("plyr")); + +function o(e, t) { + if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") +} + +function i(e, t) { + for (var n = 0; n < t.length; n++) { + var o = t[n]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o) + } +} + +function r(e) { + return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { + return typeof e + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e + })(e) +} + +function c(e) { + return (c = "function" == typeof Symbol && "symbol" === r(Symbol.iterator) ? function (e) { + return r(e) + } : function (e) { + return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : r(e) + })(e) +} + +function s(e, t) { + return !t || "object" !== c(t) && "function" != typeof t ? function (e) { + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e + }(e) : t +} + +function a(e) { + return (a = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) { + return e.__proto__ || Object.getPrototypeOf(e) + })(e) +} + +function l(e, t) { + return (l = Object.setPrototypeOf || function (e, t) { + return e.__proto__ = t, e + })(e, t) +} +require("plyr/dist/plyr.css"); +! function (e, t) { + void 0 === t && (t = {}); + var n = t.insertAt; + if (e && "undefined" != typeof document) { + var o = document.head || document.getElementsByTagName("head")[0], + i = document.createElement("style"); + i.type = "text/css", "top" === n && o.firstChild ? o.insertBefore(i, o.firstChild) : o.appendChild(i), i.styleSheet ? i.styleSheet.cssText = e : i.appendChild(document.createTextNode(e)) + } +}('.yjs-plyr{width: 100%!important;position:relative;background-color:#4caf50;border:none;font-size:28px;color:#fff;padding:20px;width:200px;text-align:center;-webkit-transition-duration:.4s;transition-duration:.4s;text-decoration:none;overflow:hidden;cursor:pointer;box-shadow:0 8px 16px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19)}.PlyrComponent:after{content:"";background:#f1f1f1;display:block;position:absolute;padding-top:300%;padding-left:350%;margin-left:-20px!important;margin-top:-120%;opacity:0;transition:all .8s}.PlyrComponent:active:after{padding:0;margin:0;opacity:1;transition:0s}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFDRSxpQkFBa0IsQ0FDbEIsd0JBQXlCLENBQ3pCLFdBQVksQ0FDWixjQUFlLENBQ2YsVUFBYyxDQUNkLFlBQWEsQ0FDYixXQUFZLENBQ1osaUJBQWtCLENBQ2xCLCtCQUFpQyxDQUNqQyx1QkFBeUIsQ0FDekIsb0JBQXFCLENBQ3JCLGVBQWdCLENBQ2hCLGNBQWUsQ0FDZixtRUFDRixDQUVBLHFCQUNFLFVBQVcsQ0FDWCxrQkFBbUIsQ0FDbkIsYUFBYyxDQUNkLGlCQUFrQixDQUNsQixnQkFBaUIsQ0FDakIsaUJBQWtCLENBQ2xCLDJCQUE2QixDQUM3QixnQkFBaUIsQ0FDakIsU0FBVSxDQUNWLGtCQUNGLENBRUEsNEJBQ0UsU0FBVSxDQUNWLFFBQVMsQ0FDVCxTQUFVLENBQ1YsYUFDRiIsImZpbGUiOiJzdHlsZXMuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLlBseXJDb21wb25lbnQge1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIGJhY2tncm91bmQtY29sb3I6ICM0Q0FGNTA7XG4gIGJvcmRlcjogbm9uZTtcbiAgZm9udC1zaXplOiAyOHB4O1xuICBjb2xvcjogI0ZGRkZGRjtcbiAgcGFkZGluZzogMjBweDtcbiAgd2lkdGg6IDIwMHB4O1xuICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gIC13ZWJraXQtdHJhbnNpdGlvbi1kdXJhdGlvbjogMC40czsgLyogU2FmYXJpICovXG4gIHRyYW5zaXRpb24tZHVyYXRpb246IDAuNHM7XG4gIHRleHQtZGVjb3JhdGlvbjogbm9uZTtcbiAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgY3Vyc29yOiBwb2ludGVyO1xuICBib3gtc2hhZG93OiAwIDhweCAxNnB4IDAgcmdiYSgwLDAsMCwwLjIpLCAwIDZweCAyMHB4IDAgcmdiYSgwLDAsMCwwLjE5KTtcbn1cblxuLlBseXJDb21wb25lbnQ6YWZ0ZXIge1xuICBjb250ZW50OiBcIlwiO1xuICBiYWNrZ3JvdW5kOiAjZjFmMWYxO1xuICBkaXNwbGF5OiBibG9jaztcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICBwYWRkaW5nLXRvcDogMzAwJTtcbiAgcGFkZGluZy1sZWZ0OiAzNTAlO1xuICBtYXJnaW4tbGVmdDogLTIwcHggIWltcG9ydGFudDtcbiAgbWFyZ2luLXRvcDogLTEyMCU7XG4gIG9wYWNpdHk6IDA7XG4gIHRyYW5zaXRpb246IGFsbCAwLjhzXG59XG5cbi5QbHlyQ29tcG9uZW50OmFjdGl2ZTphZnRlciB7XG4gIHBhZGRpbmc6IDA7XG4gIG1hcmdpbjogMDtcbiAgb3BhY2l0eTogMTtcbiAgdHJhbnNpdGlvbjogMHNcbn1cbiJdfQ== */'); +var u = function (e) { + function r() { + return o(this, r), s(this, a(r).apply(this, arguments)) + } + var c, u, p; + return function (e, t) { + if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function"); + e.prototype = Object.create(t && t.prototype, { + constructor: { + value: e, + writable: !0, + configurable: !0 + } + }), t && l(e, t) + }(r, t.Component), c = r, (u = [{ + key: "componentDidMount", + value: function () { + this.player = new n(".yjs-plyr", this.props.options), this.player.source = this.props.sources + } + }, { + key: "componentWillUnmount", + value: function () { + this.player.destroy() + } + }, { + key: "render", + value: function () { + return t.createElement("video", { + className: "yjs-plyr plyr" + }) + } + }]) && i(c.prototype, u), p && i(c, p), r +}(); +u.defaultProps = { + options: { + controls: ["rewind", "play", "fast-forward", "progress", "current-time", "duration", "mute", "volume", "settings", "fullscreen"], + i18n: { + restart: "Restart", + rewind: "Rewind {seektime}s", + play: "Play", + pause: "Pause", + fastForward: "Forward {seektime}s", + seek: "Seek", + seekLabel: "{currentTime} of {duration}", + played: "Played", + buffered: "Buffered", + currentTime: "Current time", + duration: "Duration", + volume: "Volume", + mute: "Mute", + unmute: "Unmute", + enableCaptions: "Enable captions", + disableCaptions: "Disable captions", + download: "Download", + enterFullscreen: "Enter fullscreen", + exitFullscreen: "Exit fullscreen", + frameTitle: "Player for {title}", + captions: "Captions", + settings: "Settings", + menuBack: "Go back to previous menu", + speed: "Speed", + normal: "Normal", + quality: "Quality", + loop: "Loop" + } + }, + +}, exports.PlyrComponent = u; \ No newline at end of file diff --git a/.prev/src/components/MobileWarning/index.js b/.prev/src/components/MobileWarning/index.js new file mode 100644 index 00000000..880bd85a --- /dev/null +++ b/.prev/src/components/MobileWarning/index.js @@ -0,0 +1,48 @@ +import React from 'react' +import styles from './index.less' +import store from 'store' +import * as antd from 'antd' + +export default class MobileWarning extends React.PureComponent { + state = { + resbypass: store.get('resbypass') || false, + } + + ResByPassHandler = () => { + this.setState({ resbypass: true }) + } + + render() { + const { resbypass } = this.state + + if (resbypass == false) { + return ( +
+ +

+ This version of the application is not fully compatible with + the resolution of this screen, a higher resolution is + recommended for an optimal experience +

+ Please choose an option to continue +
+
+ this.ResByPassHandler()} + > + Continue + +
+ } + /> + + ) + } + return null + } +} diff --git a/.prev/src/components/MobileWarning/index.less b/.prev/src/components/MobileWarning/index.less new file mode 100644 index 00000000..62ea91e1 --- /dev/null +++ b/.prev/src/components/MobileWarning/index.less @@ -0,0 +1,18 @@ +.mobilewarning { + background-color: rgba(0, 0, 0, 0.975); + color: white; + width: 100%; + position: absolute; + top: 0; + bottom: 0; + z-index: 100000; + display: flex; + justify-content: center; + text-align: center; + + :global { + .ant-result-title { + color: white; + } + } +} \ No newline at end of file diff --git a/.prev/src/components/PageTransition/animations.js b/.prev/src/components/PageTransition/animations.js new file mode 100644 index 00000000..236f577c --- /dev/null +++ b/.prev/src/components/PageTransition/animations.js @@ -0,0 +1,780 @@ +import { keyframes } from 'styled-components' + +export default { + moveToLeft: { + keyframes: keyframes` + from { } + to { transform: translateX(-100%); } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveFromLeft: { + keyframes: keyframes` + from { transform: translateX(-100%) }; + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveToRight: { + keyframes: keyframes` + from { } + to { transform: translateX(100%); } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveFromRight: { + keyframes: keyframes` + from { transform: translateX(100%); } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveToTop: { + keyframes: keyframes` + from { } + to { transform: translateY(-100%); } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveFromTop: { + keyframes: keyframes` + from { transform: translateY(-100%); } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveToBottom: { + keyframes: keyframes` + from { } + to { transform: translateY(100%); } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveFromBottom: { + keyframes: keyframes` + from { transform: translateY(100%); } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + fade: { + keyframes: keyframes` + from { } + to { opacity: 0.3; } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveToLeftFade: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateX(-100%); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + moveFromLeftFade: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateX(-100%); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + moveToRightFade: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateX(100%); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + moveFromRightFade: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateX(100%); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + moveToTopFade: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateY(-100%); } + `, + duration: 600, + timing: 'ease', + fill: 'both', + }, + moveFromTopFade: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateY(-100%); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + moveToBottomFade: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateY(100%); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + moveFromBottomFade: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateY(100%); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + scaleDown: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: scale(0.8); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + scaleUp: { + keyframes: keyframes` + from { opacity: 0; transform: scale(0.8); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + }, + scaleUpDown: { + keyframes: keyframes` + from { opacity: 0; transform: scale(1.2); } + `, + duration: 500, + timing: 'ease', + fill: 'both', + }, + scaleDownUp: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: scale(1.2); } + `, + duration: 500, + timing: 'ease', + fill: 'both', + }, + scaleDownCenter: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: scale(0.7); } + `, + duration: 400, + timing: 'ease', + fill: 'both', + }, + scaleUpCenter: { + keyframes: keyframes` + from { opacity: 0; transform: scale(0.7); } + `, + duration: 400, + timing: 'ease', + fill: 'both', + }, + rotateRightSideFirst: { + keyframes: keyframes` + 0% { } + 40% { transform: rotateY(15deg); opacity: 0.8; animation-timing-function: ease-out; } + 100% { transform: scale(0.8) translateZ(-200px); opacity:0; } + `, + duration: 800, + timing: 'ease-in', + fill: 'both', + origin: '0% 50%', + }, + rotateLeftSideFirst: { + keyframes: keyframes` + 0% { } + 40% { transform: rotateY(-15deg); opacity: 0.8; animation-timing-function: ease-out; } + 100% { transform: scale(0.8) translateZ(-200px); opacity:0; } + `, + duration: 800, + timing: 'ease-in', + fill: 'both', + origin: '0% 50%', + }, + rotateTopSideFirst: { + keyframes: keyframes` + 0% { } + 40% { transform: rotateX(15deg); opacity: 0.8; animation-timing-function: ease-out; } + 100% { transform: scale(0.8) translateZ(-200px); opacity:0; } + `, + duration: 800, + timing: 'ease-in', + fill: 'both', + origin: '0% 50%', + }, + rotateBottomSideFirst: { + keyframes: keyframes` + 0% { } + 40% { transform: rotateX(-15deg); opacity: 0.8; animation-timing-function: ease-out; } + 100% {transform: scale(0.8) translateZ(-200px); opacity:0; } + `, + duration: 800, + timing: 'ease-in', + fill: 'both', + origin: '0% 50%', + }, + flipOutRight: { + keyframes: keyframes` + from { } + to { transform: translateZ(-1000px) rotateY(90deg); opacity: 0.2; } + `, + duration: 500, + timing: 'ease-in', + fill: 'both', + origin: '50% 50%', + }, + flipInLeft: { + keyframes: keyframes` + from { transform: translateZ(-1000px) rotateY(-90deg); opacity: 0.2; } + `, + duration: 500, + timing: 'ease-out', + fill: 'both', + origin: '50% 50%', + }, + flipOutLeft: { + keyframes: keyframes` + from { } + to { transform: translateZ(-1000px) rotateY(-90deg); opacity: 0.2; } + `, + duration: 500, + timing: 'ease-in', + fill: 'both', + origin: '50% 50%', + }, + flipInRight: { + keyframes: keyframes` + from { transform: translateZ(-1000px) rotateY(90deg); opacity: 0.2; } + `, + duration: 500, + timing: 'ease-out', + fill: 'both', + origin: '50% 50%', + }, + flipOutTop: { + keyframes: keyframes` + from { } + to { transform: translateZ(-1000px) rotateX(90deg); opacity: 0.2; } + `, + duration: 500, + timing: 'ease-in', + fill: 'both', + origin: '50% 50%', + }, + flipInBottom: { + keyframes: keyframes` + from { transform: translateZ(-1000px) rotateX(-90deg); opacity: 0.2; } + `, + duration: 500, + timing: 'ease-out', + fill: 'both', + origin: '50% 50%', + }, + flipOutBottom: { + keyframes: keyframes` + from { } + to { transform: translateZ(-1000px) rotateX(-90deg); opacity: 0.2; } + `, + duration: 500, + timing: 'ease-in', + fill: 'both', + origin: '50% 50%', + }, + flipInTop: { + keyframes: keyframes` + from { transform: translateZ(-1000px) rotateX(90deg); opacity: 0.2; } + `, + duration: 500, + timing: 'ease-out', + fill: 'both', + origin: '50% 50%', + }, + rotateFall: { + keyframes: keyframes` + 0% { transform: rotateZ(0deg); } + 20% { transform: rotateZ(10deg); animation-timing-function: ease-out; } + 40% { transform: rotateZ(17deg); } + 60% { transform: rotateZ(16deg); } + 100% { transform: translateY(100%) rotateZ(17deg); } + `, + duration: 1000, + timing: 'ease-in', + fill: 'both', + origin: '0% 0%', + }, + rotateOutNewspaper: { + keyframes: keyframes` + from { } + to { transform: translateZ(-3000px) rotateZ(360deg); opacity: 0; } + `, + duration: 500, + timing: 'ease-in', + fill: 'both', + origin: '50% 50%', + }, + rotateInNewspaper: { + keyframes: keyframes` + from { transform: translateZ(-3000px) rotateZ(-360deg); opacity: 0; } + `, + duration: 500, + timing: 'ease-out', + fill: 'both', + origin: '50% 50%', + }, + rotatePushLeft: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: rotateY(90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '0% 50%', + }, + rotatePushRight: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: rotateY(-90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '100% 50%', + }, + rotatePushTop: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: rotateX(-90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 0%', + }, + rotatePushBottom: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: rotateX(90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 100%', + }, + rotatePullRight: { + keyframes: keyframes` + from { opacity: 0; transform: rotateY(-90deg); } + `, + duration: 500, + timing: 'ease', + fill: 'both', + origin: '100% 50%', + }, + rotatePullLeft: { + keyframes: keyframes` + from { opacity: 0; transform: rotateY(90deg); } + `, + duration: 500, + timing: 'ease', + fill: 'both', + origin: '0% 50%', + }, + rotatePullTop: { + keyframes: keyframes` + from { opacity: 0; transform: rotateX(-90deg); } + `, + duration: 500, + timing: 'ease', + fill: 'both', + origin: '50% 0%', + }, + rotatePullBottom: { + keyframes: keyframes` + from { opacity: 0; transform: rotateX(90deg); } + `, + duration: 500, + timing: 'ease', + fill: 'both', + origin: '50% 100%', + }, + rotateFoldRight: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: translateX(100%) rotateY(90deg); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + origin: '0% 50%', + }, + rotateFoldLeft: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: translateX(-100%) rotateY(-90deg); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + origin: '100% 50%', + }, + rotateFoldTop: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: translateY(-100%) rotateX(90deg); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + origin: '50% 100%', + }, + rotateFoldBottom: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: translateY(100%) rotateX(-90deg); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + origin: '50% 0%', + }, + rotateUnfoldLeft: { + keyframes: keyframes` + from { opacity: 0; transform: translateX(-100%) rotateY(-90deg); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + origin: '100% 50%', + }, + rotateUnfoldRight: { + keyframes: keyframes` + from { opacity: 0; transform: translateX(100%) rotateY(90deg); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + origin: '0% 50%', + }, + rotateUnfoldTop: { + keyframes: keyframes` + from { opacity: 0; transform: translateY(-100%) rotateX(90deg); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + origin: '50% 100%', + }, + rotateUnfoldBottom: { + keyframes: keyframes` + from { opacity: 0; transform: translateY(100%) rotateX(-90deg); } + `, + duration: 700, + timing: 'ease', + fill: 'both', + origin: '50% 0%', + }, + rotateRoomLeftOut: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateX(-100%) rotateY(90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '100% 50%', + }, + rotateRoomLeftIn: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateX(100%) rotateY(-90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '0% 50%', + }, + rotateRoomRightOut: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateX(100%) rotateY(-90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '0% 50%', + }, + rotateRoomRightIn: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateX(-100%) rotateY(90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '100% 50%', + }, + rotateRoomTopOut: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateY(-100%) rotateX(-90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 100%', + }, + rotateRoomTopIn: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateY(100%) rotateX(90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 0%', + }, + rotateRoomBottomOut: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateY(100%) rotateX(90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 0%', + }, + rotateRoomBottomIn: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateY(-100%) rotateX(-90deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 100%', + }, + rotateCubeLeftOut: { + keyframes: keyframes` + 0% { } + 50% { animation-timing-function: ease-out; transform: translateX(-50%) translateZ(-200px) rotateY(-45deg); } + 100% { opacity: 0.3; transform: translateX(-100%) rotateY(-90deg); } + `, + duration: 600, + timing: 'ease-in', + fill: 'both', + origin: '100% 50%', + }, + rotateCubeLeftIn: { + keyframes: keyframes` + 0% { opacity: 0.3; transform: translateX(100%) rotateY(90deg); } + 50% { animation-timing-function: ease-out; transform: translateX(50%) translateZ(-200px) rotateY(45deg); } + `, + duration: 600, + timing: 'ease-in', + fill: 'both', + origin: '0% 50%', + }, + rotateCubeRightOut: { + keyframes: keyframes` + 0% { } + 50% { animation-timing-function: ease-out; transform: translateX(50%) translateZ(-200px) rotateY(45deg); } + 100% { opacity: 0.3; transform: translateX(100%) rotateY(90deg); } + `, + duration: 600, + timing: 'ease-in', + fill: 'both', + origin: '0% 50%', + }, + rotateCubeRightIn: { + keyframes: keyframes` + 0% { opacity: 0.3; transform: translateX(-100%) rotateY(-90deg); } + 50% { animation-timing-function: ease-out; transform: translateX(-50%) translateZ(-200px) rotateY(-45deg); } + `, + duration: 600, + timing: 'ease-in', + fill: 'both', + origin: '100% 50%', + }, + rotateCubeTopOut: { + keyframes: keyframes` + 0% {} + 50% { animation-timing-function: ease-out; transform: translateY(-50%) translateZ(-200px) rotateX(45deg); } + 100% { opacity: 0.3; transform: translateY(-100%) rotateX(90deg); } + `, + duration: 600, + timing: 'ease-in', + fill: 'both', + origin: '50% 100%', + }, + rotateCubeTopIn: { + keyframes: keyframes` + 0% { opacity: 0.3; transform: translateY(100%) rotateX(-90deg); } + 50% { animation-timing-function: ease-out; transform: translateY(50%) translateZ(-200px) rotateX(-45deg); } + `, + duration: 600, + timing: 'ease-in', + fill: 'both', + origin: '50% 0%', + }, + rotateCubeBottomOut: { + keyframes: keyframes` + 0% { } + 50% { animation-timing-function: ease-out; transform: translateY(50%) translateZ(-200px) rotateX(-45deg); } + 100% { opacity: 0.3; -webkit-transform: translateY(100%) rotateX(-90deg); transform: translateY(100%) rotateX(-90deg); } + `, + duration: 600, + timing: 'ease-in', + fill: 'both', + origin: '50% 0%', + }, + rotateCubeBottomIn: { + keyframes: keyframes` + 0% { opacity: 0.3; -webkit-transform: translateY(-100%) rotateX(90deg); transform: translateY(-100%) rotateX(90deg); } + 50% { animation-timing-function: ease-out; transform: translateY(-50%) translateZ(-200px) rotateX(45deg); } + `, + duration: 600, + timing: 'ease-in', + fill: 'both', + origin: '50% 100%', + }, + rotateCarouselLeftOut: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateX(-150%) scale(0.4) rotateY(-65deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '100% 50%', + }, + rotateCarouselLeftIn: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateX(200%) scale(0.4) rotateY(65deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '0% 50%', + }, + rotateCarouselRightOut: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateX(200%) scale(0.4) rotateY(65deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '0% 50%', + }, + rotateCarouselRightIn: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateX(-200%) scale(0.4) rotateY(-65deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '100% 50%', + }, + rotateCarouselTopOut: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateY(-200%) scale(0.4) rotateX(65deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 100%', + }, + rotateCarouselTopIn: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateY(200%) scale(0.4) rotateX(-65deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 0%', + }, + rotateCarouselBottomOut: { + keyframes: keyframes` + from { } + to { opacity: 0.3; transform: translateY(200%) scale(0.4) rotateX(-65deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 0%', + }, + rotateCarouselBottomIn: { + keyframes: keyframes` + from { opacity: 0.3; transform: translateY(-200%) scale(0.4) rotateX(65deg); } + `, + duration: 800, + timing: 'ease', + fill: 'both', + origin: '50% 100%', + }, + rotateSidesOut: { + keyframes: keyframes` + from { } + to { opacity: 0; transform: translateZ(-500px) rotateY(90deg); } + `, + duration: 500, + timing: 'ease-in', + fill: 'both', + origin: '-50% 50%', + }, + rotateSidesIn: { + keyframes: keyframes` + from { opacity: 0; transform: translateZ(-500px) rotateY(-90deg); } + `, + duration: 500, + timing: 'ease-in', + fill: 'both', + origin: '150% 50%', + }, + rotateSlideOut: { + keyframes: keyframes` + 0% { } + 25% { opacity: 0.5; transform: translateZ(-500px); } + 75% { opacity: 0.5; transform: translateZ(-500px) translateX(-200%); } + 100% { opacity: 0.5; transform: translateZ(-500px) translateX(-200%); } + `, + duration: 1000, + timing: 'ease', + fill: 'both', + }, + rotateSlideIn: { + keyframes: keyframes` + 0%, 25% { opacity: 0.5; transform: translateZ(-500px) translateX(200%); } + 75% { opacity: 0.5; transform: translateZ(-500px); } + 100% { opacity: 1; transform: translateZ(0) translateX(0); } + `, + duration: 1000, + timing: 'ease', + fill: 'both', + }, +} diff --git a/.prev/src/components/PageTransition/index.js b/.prev/src/components/PageTransition/index.js new file mode 100644 index 00000000..31743946 --- /dev/null +++ b/.prev/src/components/PageTransition/index.js @@ -0,0 +1,80 @@ +import React, { memo } from 'react' +import { Transition, TransitionGroup } from 'react-transition-group' +import animations from './animations' +import presets from './presets' +import * as Styles from './styles' + +function PageTransition({ + children, + enterAnimation: enterAnimationOverride, + exitAnimation: exitAnimationOverride, + preset, + transitionKey, + ...rest +}) { + const selectEnterAnimation = () => { + if (enterAnimationOverride) { + if (typeof enterAnimationOverride === 'string') { + return animations[enterAnimationOverride] + } + return { + ...animations[enterAnimationOverride.name], + delay: enterAnimationOverride.delay, + onTop: enterAnimationOverride.onTop, + } + } + if (preset) { + return { + ...animations[presets[preset].enter.name], + delay: presets[preset].enter.delay, + onTop: presets[preset].enter.onTop, + } + } + return 'rotateSlideIn' + } + + const selectExitAnimation = () => { + if (exitAnimationOverride) { + if (typeof exitAnimationOverride === 'string') { + return animations[exitAnimationOverride] + } + return { + ...animations[exitAnimationOverride.name], + delay: exitAnimationOverride.delay, + onTop: exitAnimationOverride.onTop, + } + } + if (preset) { + return { + ...animations[presets[preset].exit.name], + delay: presets[preset].exit.delay, + onTop: presets[preset].exit.onTop, + } + } + return 'rotateSlideIn' + } + + const enterAnimation = selectEnterAnimation() + const exitAnimation = selectExitAnimation() + const timeout = Math.max(enterAnimation.duration, exitAnimation.duration) + + return ( + + + + {state => ( + + {children} + + )} + + + + ) +} + +export default memo(PageTransition) diff --git a/.prev/src/components/PageTransition/presets.js b/.prev/src/components/PageTransition/presets.js new file mode 100644 index 00000000..31711350 --- /dev/null +++ b/.prev/src/components/PageTransition/presets.js @@ -0,0 +1,552 @@ +export default { + moveToLeftFromRight: { + exit: { + name: 'moveToLeft', + }, + enter: { + name: 'moveFromRight', + }, + }, + moveToRightFromLeft: { + exit: { + name: 'moveToRight', + }, + enter: { + name: 'moveFromLeft', + }, + }, + moveToTopFromBottom: { + exit: { + name: 'moveToTop', + }, + enter: { + name: 'moveFromBottom', + }, + }, + moveToBottomFromTop: { + exit: { + name: 'moveToBottom', + }, + enter: { + name: 'moveFromTop', + }, + }, + fadeFromRight: { + exit: { + name: 'fade', + }, + enter: { + name: 'moveFromRight', + onTop: true, + }, + }, + fadeFromLeft: { + exit: { + name: 'fade', + }, + enter: { + name: 'moveFromLeft', + onTop: true, + }, + }, + fadeFromBottom: { + exit: { + name: 'fade', + }, + enter: { + name: 'moveFromBottom', + onTop: true, + }, + }, + fadeFromTop: { + exit: { + name: 'fade', + }, + enter: { + name: 'moveFromTop', + onTop: true, + }, + }, + fadeLeftFadeRight: { + exit: { + name: 'moveToLeftFade', + }, + enter: { + name: 'moveFromRightFade', + }, + }, + fadeRightFadeLeft: { + exit: { + name: 'moveToRightFade', + }, + enter: { + name: 'moveFromLeftFade', + }, + }, + fadeTopFadeBottom: { + exit: { + name: 'moveToTopFade', + }, + enter: { + name: 'moveFromBottomFade', + }, + }, + fadeBottomFadeTop: { + exit: { + name: 'moveToBottomFade', + }, + enter: { + name: 'moveFromTopFade', + }, + }, + scaleDownFromRight: { + exit: { + name: 'scaleDown', + }, + enter: { + name: 'moveFromRight', + onTop: true, + }, + }, + scaleDownFromLeft: { + exit: { + name: 'scaleDown', + }, + enter: { + name: 'moveFromLeft', + onTop: true, + }, + }, + scaleDownFromBottom: { + exit: { + name: 'scaleDown', + }, + enter: { + name: 'moveFromBottom', + onTop: true, + }, + }, + scaleDownFromTop: { + exit: { + name: 'scaleDown', + }, + enter: { + name: 'moveFromTop', + onTop: true, + }, + }, + scaleDownScaleDown: { + exit: { + name: 'scaleDown', + }, + enter: { + name: 'scaleUpDown', + delay: 300, + }, + }, + scaleUpScaleUp: { + exit: { + name: 'scaleDownUp', + }, + enter: { + name: 'scaleUp', + delay: 300, + }, + }, + moveToLeftScaleUp: { + exit: { + name: 'moveToLeft', + onTop: true, + }, + enter: { + name: 'scaleUp', + }, + }, + moveToRightScaleUp: { + exit: { + name: 'moveToRight', + onTop: true, + }, + enter: { + name: 'scaleUp', + }, + }, + moveToTopScaleUp: { + exit: { + name: 'moveToTop', + onTop: true, + }, + enter: { + name: 'scaleUp', + }, + }, + moveToBottomScaleUp: { + exit: { + name: 'moveToBottom', + onTop: true, + }, + enter: { + name: 'scaleUp', + }, + }, + scaleDownScaleUp: { + exit: { + name: 'scaleDownCenter', + }, + enter: { + name: 'scaleUpCenter', + delay: 400, + }, + }, + glueLeftFromRight: { + exit: { + name: 'rotateRightSideFirst', + }, + enter: { + name: 'moveFromRight', + delay: 200, + onTop: true, + }, + }, + glueRightFromLeft: { + exit: { + name: 'rotateLeftSideFirst', + }, + enter: { + name: 'moveFromLeft', + delay: 200, + onTop: true, + }, + }, + glueBottomFromTop: { + exit: { + name: 'rotateTopSideFirst', + }, + enter: { + name: 'moveFromTop', + delay: 200, + onTop: true, + }, + }, + glueTopFromBottom: { + exit: { + name: 'rotateBottomSideFirst', + }, + enter: { + name: 'moveFromBottom', + delay: 200, + onTop: true, + }, + }, + flipRight: { + exit: { + name: 'flipOutRight', + }, + enter: { + name: 'flipInLeft', + delay: 500, + }, + }, + flipLeft: { + exit: { + name: 'flipOutLeft', + }, + enter: { + name: 'flipInRight', + delay: 500, + }, + }, + flipTop: { + exit: { + name: 'flipOutTop', + }, + enter: { + name: 'flipInBottom', + delay: 500, + }, + }, + flipBottom: { + exit: { + name: 'flipOutBottom', + }, + enter: { + name: 'flipInTop', + delay: 500, + }, + }, + fall: { + exit: { + name: 'rotateFall', + onTop: true, + }, + enter: { + name: 'scaleUp', + }, + }, + newspaper: { + exit: { + name: 'rotateOutNewspaper', + }, + enter: { + name: 'rotateInNewspaper', + delay: 500, + }, + }, + pushLeftFromRight: { + exit: { + name: 'rotatePushLeft', + }, + enter: { + name: 'moveFromRight', + }, + }, + pushRightFromLeft: { + exit: { + name: 'rotatePushRight', + }, + enter: { + name: 'moveFromLeft', + }, + }, + pushTopFromBottom: { + exit: { + name: 'rotatePushTop', + }, + enter: { + name: 'moveFromBottom', + }, + }, + pushBottomFromTop: { + exit: { + name: 'rotatePushBottom', + }, + enter: { + name: 'moveFromTop', + }, + }, + pushLeftPullRight: { + exit: { + name: 'rotatePushLeft', + }, + enter: { + name: 'rotatePullRight', + delay: 180, + }, + }, + pushRightPullLeft: { + exit: { + name: 'rotatePushRight', + }, + enter: { + name: 'rotatePullLeft', + delay: 180, + }, + }, + pushTopPullBottom: { + exit: { + name: 'rotatePushTop', + }, + enter: { + name: 'rotatePullBottom', + delay: 180, + }, + }, + pushBottomPullTop: { + exit: { + name: 'rotatePushBottom', + }, + enter: { + name: 'rotatePullTop', + delay: 180, + }, + }, + foldLeftFromRight: { + exit: { + name: 'rotateFoldLeft', + }, + enter: { + name: 'moveFromRightFade', + }, + }, + foldRightFromLeft: { + exit: { + name: 'rotateFoldRight', + }, + enter: { + name: 'moveFromLeftFade', + }, + }, + foldTopFromBottom: { + exit: { + name: 'rotateFoldTop', + }, + enter: { + name: 'moveFromBottomFade', + }, + }, + foldBottomFromTop: { + exit: { + name: 'rotateFoldBottom', + }, + enter: { + name: 'moveFromTopFade', + }, + }, + moveToRightUnfoldLeft: { + exit: { + name: 'moveToRightFade', + }, + enter: { + name: 'rotateUnfoldLeft', + }, + }, + moveToLeftUnfoldRight: { + exit: { + name: 'moveToLeftFade', + }, + enter: { + name: 'rotateUnfoldRight', + }, + }, + moveToBottomUnfoldTop: { + exit: { + name: 'moveToBottomFade', + }, + enter: { + name: 'rotateUnfoldTop', + }, + }, + moveToTopUnfoldBottom: { + exit: { + name: 'moveToTopFade', + }, + enter: { + name: 'rotateUnfoldBottom', + }, + }, + roomToLeft: { + exit: { + name: 'rotateRoomLeftOut', + onTop: true, + }, + enter: { + name: 'rotateRoomLeftIn', + }, + }, + roomToRight: { + exit: { + name: 'rotateRoomRightOut', + onTop: true, + }, + enter: { + name: 'rotateRoomRightIn', + }, + }, + roomToTop: { + exit: { + name: 'rotateRoomTopOut', + onTop: true, + }, + enter: { + name: 'rotateRoomTopIn', + }, + }, + roomToBottom: { + exit: { + name: 'rotateRoomBottomOut', + onTop: true, + }, + enter: { + name: 'rotateRoomBottomIn', + }, + }, + cubeToLeft: { + exit: { + name: 'rotateCubeLeftOut', + onTop: true, + }, + enter: { + name: 'rotateCubeLeftIn', + }, + }, + cubeToRight: { + exit: { + name: 'rotateCubeRightOut', + onTop: true, + }, + enter: { + name: 'rotateCubeRightIn', + }, + }, + cubeToTop: { + exit: { + name: 'rotateCubeTopOut', + onTop: true, + }, + enter: { + name: 'rotateCubeTopIn', + }, + }, + cubeToBottom: { + exit: { + name: 'rotateCubeBottomOut', + onTop: true, + }, + enter: { + name: 'rotateCubeBottomIn', + }, + }, + carouselToLeft: { + exit: { + name: 'rotateCarouselLeftOut', + onTop: true, + }, + enter: { + name: 'rotateCarouselLeftIn', + }, + }, + carouselToRight: { + exit: { + name: 'rotateCarouselRightOut', + onTop: true, + }, + enter: { + name: 'rotateCarouselRightIn', + }, + }, + carouselToTop: { + exit: { + name: 'rotateCarouselTopOut', + onTop: true, + }, + enter: { + name: 'rotateCarouselTopIn', + }, + }, + carouselToBottom: { + exit: { + name: 'rotateCarouselBottomOut', + onTop: true, + }, + enter: { + name: 'rotateCarouselBottomIn', + }, + }, + slides: { + exit: { + name: 'rotateSidesOut', + }, + enter: { + name: 'rotateSidesIn', + delay: 200, + }, + }, + slide: { + exit: { + name: 'rotateSlideOut', + }, + enter: { + name: 'rotateSlideIn', + }, + }, +} diff --git a/.prev/src/components/PageTransition/styles.js b/.prev/src/components/PageTransition/styles.js new file mode 100644 index 00000000..bb6e4380 --- /dev/null +++ b/.prev/src/components/PageTransition/styles.js @@ -0,0 +1,54 @@ +import styled, { css } from 'styled-components' + +const createAnimationStyles = ({ + keyframes, + delay, + duration, + timing, + fill, + origin, + onTop, +}) => css` + animation-name: ${keyframes}; + animation-delay: ${delay}; + animation-duration: ${duration}ms; + animation-timing-function: ${timing}; + animation-fill-mode: ${fill}; + transform-origin: ${origin || '50% 50%'}; + ${onTop && + css` + z-index: 1; + `} +` + +const stateMap = { + entering: ({ enterAnimation }) => { + return css` + ${createAnimationStyles(enterAnimation)}; + ` + }, + exiting: ({ exitAnimation }) => { + return css` + ${createAnimationStyles(exitAnimation)}; + ` + }, +} + +export const PageTransitionGroup = styled.div` + position: relative; + width: 100%; + height: 100%; + perspective: 1200px; +` + +export const PageTransition = styled.div` + backface-visibility: hidden; + height: 100%; + left: 0; + position: absolute; + top: 0; + transform-style: preserve-3d; + transform: translate3d(0, 0, 0); + width: 100%; + ${({ state }) => stateMap[state]}; +` diff --git a/.prev/src/components/PostCard/index.js b/.prev/src/components/PostCard/index.js new file mode 100644 index 00000000..ce1428a4 --- /dev/null +++ b/.prev/src/components/PostCard/index.js @@ -0,0 +1,272 @@ +import React from 'react' +import * as antd from 'antd' +import styles from './index.less' +import { CustomIcons, Like_button, MediaPlayer } from 'components' +import * as ycore from 'ycore' +import * as Icons from '@ant-design/icons' +import Icon from '@ant-design/icons' +import classnames from 'classnames' +import * as MICON from '@material-ui/icons' + +const { Meta } = antd.Card + +// Set default by configuration +const emptyPayload = { + user: 'Post Empty', + ago: 'This Post is empty', + avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', + content: 'Empty', +} + +class PostCard extends React.PureComponent { + constructor(props) { + super(props), + this.state = { + visibleMoreMenu: false, + postPinned: this.props.payload.is_post_pinned, + postSaved: this.props.payload.is_post_saved, + postReported: this.props.payload.is_post_reported, + postBoosted: this.props.payload.is_post_boosted, + ReportIgnore: false, + } + } + handleVisibleChange = flag => { + this.setState({ visibleMoreMenu: flag }); + }; + + toogleMoreMenu(){ + this.setState({visibleMoreMenu: !this.state.visibleMoreMenu}) + } + + goToPost(postID) { + localStorage.setItem('p_back_uid', postID) + const payload = { post_id: postID } + ycore.comty_post.get((err, res) => { + if (err) { + return false + } + ycore.SecondarySwap.openPost(res) + }, payload) + } + + render() { + const { payload, customActions } = this.props + const ActShowMode = ycore.AppSettings.auto_hide_postbar + const { + id, + post_time, + postText, + postFile, + publisher, + post_likes, + is_post_pinned, + is_liked, + post_comments, + } = payload || emptyPayload + const handlePostActions = { + delete: post_id => { + const payload = { post_id: post_id } + ycore.comty_post.delete((err, res) => { + if (err) { + return false + } + ycore.FeedHandler.killByID(post_id) + }, payload) + }, + save: post_id => { + const payload = { post_id: post_id } + ycore.comty_post.save((err, res) => { + if (err) { + return false + } + if (this.state.postSaved == false) { + ycore.notify.success('Post Saved') + this.setState({ postSaved: true }) + return + } else { + ycore.notify.info('Removed from Saved') + this.setState({ postSaved: false }) + } + }, payload) + }, + report: post_id => { + ycore.app_modals.report_post(post_id) + }, + boost: post_id => { + const payload = { post_id: post_id } + ycore.comty_post.__boost((err, res) => { + if (err) { + return false + } + if (this.state.postBoosted == false) { + ycore.notify.success('Post Boosted') + this.setState({ postBoosted: true }) + return + } else { + ycore.notify.info('Post Unboosted') + this.setState({ postBoosted: false }) + } + }, payload) + }, + } + const defaultActions = [ +
+ +
, + 0 ? true : false}> + this.goToPost(id)} /> + , + ] + const actions = customActions || defaultActions + + const MoreMenu = ( + + {ycore.IsThisPost.owner(publisher.id) ? ( + + handlePostActions.delete(id) & this.toogleMoreMenu()} + okText="Yes" + cancelText="No" + > + Remove post + + + + ) : null} + {ycore.IsThisPost.owner(publisher.id) ? ( + ycore.IsThisUser.pro(publisher.id) ? ( + handlePostActions.boost(id) & this.toogleMoreMenu()} + key="boost_post" + > + {' '} + {this.state.postBoosted ? 'Unboost' : 'Boost'} + + ) : null + ) : null} + {ycore.IsThisPost.owner(publisher.id) ?
: null} + handlePostActions.save(id) & this.toogleMoreMenu()} + key="save_post" + > + {' '} + {this.state.postSaved ? 'Unsave post' : 'Save Post'} + + {this.state.postReported? null: + handlePostActions.report(id) & this.toogleMoreMenu() } + key="report_post" + > + Report post + + } +
+ ) + + return ( +
+ this.goToPost(id)} + hoverable + className={ActShowMode ? null : styles.showMode} + actions={actions} + > + {this.state.ReportIgnore ? null : this.state.postReported ? ( +
+ +

It seems that this post has been reported

+

The content may be inappropriate or compromising

+ { + this.setState({ ReportIgnore: true }) + }} + > + Ignore + +
+ ) : null} +
+ + +
+ } + title={ +
+

+ ycore.router.go(`@${publisher.username}`) + } + className={styles.titleUser} + > + @{publisher.username} + {ycore.booleanFix(publisher.verified) ? ( + + ) : null} + {ycore.booleanFix(publisher.nsfw_flag) ? ( + + NSFW + + ) : null}{' '} +

+
+
+ + + +
+ {ycore.booleanFix(is_post_pinned) ? ( + + ) : null} +
+
+ } + description={{post_time}} + bordered="false" + /> + {postText ? ( +
+ {' '} +

{' '} +

+ ) : null} + {postFile ? ( +
+ +
+ ) : null} +
+ +
+
+ + + ) + } +} +export default PostCard diff --git a/.prev/src/components/PostCard/index.less b/.prev/src/components/PostCard/index.less new file mode 100644 index 00000000..11ae7bb5 --- /dev/null +++ b/.prev/src/components/PostCard/index.less @@ -0,0 +1,230 @@ +@import '~themes/index.less'; + +.post_card_flaggedWarning { + border-radius: @post_card_general_border-rd; + width: 100%; + text-align: center; + position: absolute; + z-index: 20; + background: @post_card_flaggedWarning_backgroud; + font-family: @__Global_general_font_family; + padding: @post_card_flaggedWarning_padding; + + :global { + .anticon { + font-size: @post_card_flaggedWarning_iconSize; + } + } +} + +.post_card_wrapper { + box-shadow: @post_card_wrapper_shadow; + border-radius: @post_card_general_border-rd; + max-width: 510px; + min-width: 265px; + width: auto; + margin: 23px auto 50px auto; + + :global { + .ant-card-meta-detail>div:not(:last-child) { + margin: 0 + } + + .ant-card { + border-radius: @post_card_general_border-rd; + border: 0; + border-top: 1px solid #4646460c; + } + + .ant-card-body { + padding: 0; + } + + .ant-card-actions { + border-top: 0; + background: @post_card_wrapper_actions_backgroud; + height: 30px; + position: relative; + transition: opacity @__Global_Components_transitions_dur linear, position @__Global_Components_transitions_dur linear, transform @__Global_Components_transitions_dur linear; + border-radius: 0 0 10px 10px; + opacity: 0; + + &.showMode { + opacity: 1; + transform: translate(0, 15px); + } + } + + .ant-card-actions:hover { + opacity: 1; + transform: translate(0, 15px); + transition: opacity @__Global_Components_transitions_dur linear, position @__Global_Components_transitions_dur linear, transform @__Global_Components_transitions_dur linear; + } + + .ant-card-actions>li>.anticon { + font-size: 16px; + line-height: 22px; + width: 40px; + height: 40px; + background: @post_card_wrapper_actions_icon_backgroud; + border-radius: 23px; + } + + .ant-card-actions>li { + margin: -20px 0 0 0; + border-right: 0; + + .ant-badge-count { + width: 20px; + text-align: left; + + span { + font-size: 12px; + } + + .ant-scroll-number-only>p.ant-scroll-number-only-unit { + height: 20px; + width: 20px; + margin: 0; + line-height: 20px; + padding: 0 0 0 1px; + } + } + + span { + font-size: 16px; + line-height: 22px; + width: 40px; + height: 40px; + background: @post_card_wrapper_actions_icon_backgroud; + border-radius: 23px; + margin: auto; + } + + svg { + height: 20px; + width: 20px; + height: 100%; + vertical-align: middle; + } + } + } +} + +.post_include { + padding: 13px 0 5px 0; + transition: all 150ms linear; + + &.blur { + filter: blur(10px); + } +} + +.showMode { + :global { + ul { + opacity: 1 !important; + transform: translate(0, 15px); + } + } +} + + +.post_card_title { + display: flex; + + h4 { + cursor: pointer; + } + +} + +.postAvatar { + position: absolute; + left: -8px; + top: -8px; + display: flex; +} + +.titleUser { + display: flex; + font-family: @__Global_general_font_family; + margin: 0 0 0 50px; +} + +.textAgo { + display: flex; + font-size: 10px; + margin: 0 0 0 53px; +} + +.PostTags { + float: right; + width: 100%; + z-index: 10; + + :global { + .anticon { + color: @post_card_wrapper_tags_color_default; + float: right; + margin: -0 6px 0 0; + font-size: 17px; + } + + } +} + +.post_card_content { + word-break: break-all; + display: flex; + border-radius: 3px; + margin: 23px 24px 23px 24px; + + h3 { + font-family: @__Global_general_font_family; + color: @post_card_wrapper_post_content_color; + font-weight: @post_card_wrapper_post_content_weight; + font-size: @post_card_wrapper_post_content_fontSize; + letter-spacing: @post_card_wrapper_post_content_letterSpacing; + } +} + +.post_card_file { + display: flex; + margin: 23px 0 5px 0; + max-height: 600px; + overflow: hidden; + + h3 { + color: rgb(85, 85, 85); + font-weight: 470; + } +} + +.likebtn { + :global { + svg { + color: rgba(0, 0, 0, 0.45); + } + + svg:hover { + color: rgb(233, 35, 68); + transition: all 0.2s linear; + } + } +} + +.ellipsisIcon { + color: rgba(0, 0, 0, 0.45); + width: 100%; + position: absolute; + text-align: center; + margin: auto; + font-size: 30px; + transition: opacity 150ms linear; +} + +.ellipsisIcon:hover { + opacity: 0; + transition: opacity 150ms linear; +} \ No newline at end of file diff --git a/.prev/src/components/PostCreator/index.js b/.prev/src/components/PostCreator/index.js new file mode 100644 index 00000000..adbbc68f --- /dev/null +++ b/.prev/src/components/PostCreator/index.js @@ -0,0 +1,407 @@ +import React from 'react' +import * as antd from 'antd' +import * as ycore from 'ycore' +import styles from './index.less' +import * as Icons from '@ant-design/icons' +import Icon from '@ant-design/icons' +import $ from 'jquery' +import * as MICONS from '@material-ui/icons' + +import Post_options from './local_components/post_options' +import { optionBox } from './local_components/post_options' + +function getBase64(img, callback) { + const reader = new FileReader() + reader.addEventListener('load', () => callback(reader.result)) + reader.readAsDataURL(img) +} + +export function HandleVisibility() { + window.PostCreatorComponent.ToogleVisibility() +} + +class PostCreator extends React.PureComponent { + constructor(props) { + super(props), + window.PostCreatorComponent = this, + this.state = { + visible: true, + FadeIN: true, + keys_remaining: ycore.AppSettings.MaxLengthPosts, + rawtext: '', + posting: false, + posting_ok: false, + shareWith: 'any', + uploader: false, + Schedule: false, + } + } + + renderPostPlayer(payload) { + const { file, fileURL } = this.state + const videofilter = file.type.includes('video') + const imagefilter = file.type.includes('image') + const audiofilter = file.type.includes('audio') + if (imagefilter) { + return ( +
+
+ this.handleDeleteFile()} + icon={} + /> +
+
+ +
+
+ ) + } + if (videofilter) { + return ( +
+
+ this.handleDeleteFile()} + icon={} + /> +
+
+ +
+
+ ) + } + if (audiofilter) { + return ( +