diff --git a/.env b/.env old mode 100755 new mode 100644 diff --git a/.env.local b/.env.local old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/package-lock.json b/package-lock.json old mode 100755 new mode 100644 diff --git a/package.json b/package.json old mode 100755 new mode 100644 diff --git a/public/favicon.png b/public/favicon.png old mode 100755 new mode 100644 diff --git a/public/index.html b/public/index.html old mode 100755 new mode 100644 diff --git a/public/manifest.json b/public/manifest.json old mode 100755 new mode 100644 diff --git a/public/robots.txt b/public/robots.txt old mode 100755 new mode 100644 diff --git a/public/static/icons/android-chrome-192x192.png b/public/static/icons/android-chrome-192x192.png old mode 100755 new mode 100644 diff --git a/public/static/icons/android-chrome-512x512.png b/public/static/icons/android-chrome-512x512.png old mode 100755 new mode 100644 diff --git a/public/static/icons/apple-touch-icon.png b/public/static/icons/apple-touch-icon.png old mode 100755 new mode 100644 diff --git a/public/static/icons/favicon-16x16.png b/public/static/icons/favicon-16x16.png old mode 100755 new mode 100644 diff --git a/public/static/icons/favicon-32x32.png b/public/static/icons/favicon-32x32.png old mode 100755 new mode 100644 diff --git a/public/static/icons/favicon.ico b/public/static/icons/favicon.ico old mode 100755 new mode 100644 diff --git a/public/static/icons/mstile-150x150.png b/public/static/icons/mstile-150x150.png old mode 100755 new mode 100644 diff --git a/public/static/img/no-image.png b/public/static/img/no-image.png old mode 100755 new mode 100644 diff --git a/src/Constants.sass b/src/Constants.sass old mode 100755 new mode 100644 diff --git a/src/api/api.ts b/src/api/api.ts old mode 100755 new mode 100644 index c94b5f8..93cd193 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -1,4 +1,4 @@ -const baseUrl = process.env.NODE_ENV === "development" ? 'http://localhost:8080/v1' : 'https://api.unmei.nix13.pw/v1'; +const baseUrl = process.env.NODE_ENV === "development" ? 'http://localhost:8080/v1' : 'https://api.unmei.space/v1'; const response = async (url: string, method: string, body?: string | FormData) => { let bUrl = baseUrl; @@ -41,4 +41,4 @@ const TranslateStatus: { [id: string]: string } = { export const getVersion = () => get('version'); export const version = '0.10'; -export { get, post, put, del, TranslateStatus }; \ No newline at end of file +export { get, post, put, del, TranslateStatus }; diff --git a/src/api/auth.ts b/src/api/auth.ts old mode 100755 new mode 100644 index bbe38ba..2d92a8c --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -1,3 +1,6 @@ import {post} from "./api"; -export const restore = (token: string, new_password: string) => post('auth/restore', { token, new_password }); \ No newline at end of file +export const restore = (token: string, new_password: string) => post('auth/restore', { token, new_password }); +export const registerUser = (login: string, password: string, email: string, recaptcha: string) => post('auth/register', { login, password, email, recaptcha }); +export const login = (login: string, password: string, recaptcha: string) => post('auth/login', { login, password, recaptcha }); +export const userLogout = () => post('auth/logout'); diff --git a/src/api/characters.ts b/src/api/characters.ts old mode 100755 new mode 100644 diff --git a/src/api/errors.ts b/src/api/errors.ts old mode 100755 new mode 100644 diff --git a/src/api/news.ts b/src/api/news.ts old mode 100755 new mode 100644 diff --git a/src/api/novels.ts b/src/api/novels.ts old mode 100755 new mode 100644 diff --git a/src/api/users.ts b/src/api/users.ts old mode 100755 new mode 100644 index 062f44f..1e5f14a --- a/src/api/users.ts +++ b/src/api/users.ts @@ -8,10 +8,6 @@ export const updateUser = (user: UserType) => put(`users/${user.id}`, { user }) export const fetchCurrentUser = () => get('users/me'); export const fetchUserNovels = (id: number) => get(`users/${id}/novels`); -export const registerUser = (login: string, password: string, email: string, recaptcha: string) => post('auth/register', { login, password, email, recaptcha }); -export const login = (login: string, password: string, recaptcha: string) => post('auth/login', { login, password, recaptcha }); -export const userLogout = () => post('auth/logout'); - export const activateAccount = (token: string) => post('auth/activate', { token }); export const generateActivateLink = () => post('auth/activateToken'); @@ -19,4 +15,4 @@ export const fetchUserSettings = () => get('users/me/settings'); export const updateUserSettings = (use_gravatar: boolean, avatar: string) => post('users/me/settings', { use_gravatar, avatar }); export const uploadAvatar = (avatar: FormData) => post('users/me/avatar', avatar); -export const generateRestoreLink = (email: string, recaptcha: string) => post('auth/restoreToken', { email, recaptcha }); \ No newline at end of file +export const generateRestoreLink = (email: string, recaptcha: string) => post('auth/restoreToken', { email, recaptcha }); diff --git a/src/classNames.ts b/src/classNames.ts old mode 100755 new mode 100644 diff --git a/src/index.tsx b/src/index.tsx old mode 100755 new mode 100644 diff --git a/src/pages/ActivateAccount.tsx b/src/pages/ActivateAccount.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/AdminPanel.sass b/src/pages/AdminPanel/AdminPanel.sass old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/AdminPanel.tsx b/src/pages/AdminPanel/AdminPanel.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/News/APModifyPost.tsx b/src/pages/AdminPanel/News/APModifyPost.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/News/APNews.sass b/src/pages/AdminPanel/News/APNews.sass old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/News/APNews.tsx b/src/pages/AdminPanel/News/APNews.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/Novels/AdminPanelNovels.tsx b/src/pages/AdminPanel/Novels/AdminPanelNovels.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/Users/APUser.sass b/src/pages/AdminPanel/Users/APUser.sass old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/Users/AdminPanelUsers.tsx b/src/pages/AdminPanel/Users/AdminPanelUsers.tsx old mode 100755 new mode 100644 diff --git a/src/pages/AdminPanel/Users/ModifyUser.tsx b/src/pages/AdminPanel/Users/ModifyUser.tsx old mode 100755 new mode 100644 diff --git a/src/pages/App/App.sass b/src/pages/App/App.sass old mode 100755 new mode 100644 diff --git a/src/pages/App/App.tsx b/src/pages/App/App.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Character/Character.sass b/src/pages/Character/Character.sass old mode 100755 new mode 100644 diff --git a/src/pages/Character/Character.tsx b/src/pages/Character/Character.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Comments/Comments.sass b/src/pages/Comments/Comments.sass old mode 100755 new mode 100644 diff --git a/src/pages/Comments/Comments.tsx b/src/pages/Comments/Comments.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Footer/Footer.sass b/src/pages/Footer/Footer.sass old mode 100755 new mode 100644 diff --git a/src/pages/Footer/Footer.tsx b/src/pages/Footer/Footer.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Main/Main.sass b/src/pages/Main/Main.sass old mode 100755 new mode 100644 diff --git a/src/pages/Main/Main.tsx b/src/pages/Main/Main.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Main/News.tsx b/src/pages/Main/News.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Modals/LoginModal.sass b/src/pages/Modals/LoginModal.sass old mode 100755 new mode 100644 diff --git a/src/pages/Modals/LoginModal.tsx b/src/pages/Modals/LoginModal.tsx old mode 100755 new mode 100644 index 5a29c53..dd91a6d --- a/src/pages/Modals/LoginModal.tsx +++ b/src/pages/Modals/LoginModal.tsx @@ -1,6 +1,6 @@ import React, {FormEvent, ChangeEvent} from "react"; import Modal from "../../ui/Modal/Modal"; -import {login} from "../../api/users"; +import {login} from "../../api/auth"; import {connect} from "react-redux"; import {addNotification, hideModal, setModal, setUser} from "../../store/actions"; import './LoginModal.sass' @@ -107,4 +107,4 @@ export default connect(null, setModal: (modal: React.ReactNode | null) => dispatch(setModal(modal)), hideModal: () => dispatch(hideModal()) }) -)(LoginModal); \ No newline at end of file +)(LoginModal); diff --git a/src/pages/Modals/RegisterModal.sass b/src/pages/Modals/RegisterModal.sass old mode 100755 new mode 100644 diff --git a/src/pages/Modals/RegisterModal.tsx b/src/pages/Modals/RegisterModal.tsx old mode 100755 new mode 100644 index ca5bd50..8fefa30 --- a/src/pages/Modals/RegisterModal.tsx +++ b/src/pages/Modals/RegisterModal.tsx @@ -2,7 +2,7 @@ import React from "react"; import Modal from "../../ui/Modal/Modal"; import Recaptcha from '../../ui/Recaptcha/Recaptcha' import './RegisterModal.sass' -import {registerUser} from "../../api/users"; +import {registerUser} from "../../api/auth"; import {connect} from "react-redux"; import {addNotification, setModal} from "../../store/actions"; import NotificationMessage from "../../ui/Notifications/NotificationMessage"; @@ -122,4 +122,4 @@ export default connect(null, addNotification: (notification: React.ReactNode) => dispatch(addNotification(notification)), setModal: (modal: React.ReactNode | null) => dispatch(setModal(modal)) }) -)(RegisterModal); \ No newline at end of file +)(RegisterModal); diff --git a/src/pages/Navbar/Navbar.sass b/src/pages/Navbar/Navbar.sass old mode 100755 new mode 100644 diff --git a/src/pages/Navbar/Navbar.tsx b/src/pages/Navbar/Navbar.tsx old mode 100755 new mode 100644 index 996cfcc..cd8fd04 --- a/src/pages/Navbar/Navbar.tsx +++ b/src/pages/Navbar/Navbar.tsx @@ -1,7 +1,7 @@ import React from "react"; import './Navbar.sass' import {connect} from "react-redux"; -import {userLogout} from "../../api/users"; +import {userLogout} from "../../api/auth"; import {Link} from "react-router-dom"; import {logout, setModal} from "../../store/actions"; import {hasAccessToAdminPanel} from "../../utils"; @@ -108,4 +108,4 @@ export default connect( logout: () => dispatch(logout()), setModal: (modal: React.ReactNode | null) => dispatch(setModal(modal)) }) -)(Navbar); \ No newline at end of file +)(Navbar); diff --git a/src/pages/News/AllNews.tsx b/src/pages/News/AllNews.tsx old mode 100755 new mode 100644 index e1c5396..78822e4 --- a/src/pages/News/AllNews.tsx +++ b/src/pages/News/AllNews.tsx @@ -30,6 +30,7 @@ class AllNews extends React.Component<{}, State> {
Новости
+ {/*{}*/} {news.map(post => ( @@ -40,4 +41,4 @@ class AllNews extends React.Component<{}, State> { } } -export default AllNews; \ No newline at end of file +export default AllNews; diff --git a/src/pages/News/Post.sass b/src/pages/News/Post.sass old mode 100755 new mode 100644 diff --git a/src/pages/News/Post.tsx b/src/pages/News/Post.tsx old mode 100755 new mode 100644 diff --git a/src/pages/NotFoundError.tsx b/src/pages/NotFoundError.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Novel/Novel.sass b/src/pages/Novel/Novel.sass old mode 100755 new mode 100644 diff --git a/src/pages/Novel/Novel.tsx b/src/pages/Novel/Novel.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Novels/Novels.sass b/src/pages/Novels/Novels.sass old mode 100755 new mode 100644 diff --git a/src/pages/Novels/Novels.tsx b/src/pages/Novels/Novels.tsx old mode 100755 new mode 100644 diff --git a/src/pages/PasswordRestore/PasswordRestore.sass b/src/pages/PasswordRestore/PasswordRestore.sass old mode 100755 new mode 100644 diff --git a/src/pages/PasswordRestore/PasswordRestore.tsx b/src/pages/PasswordRestore/PasswordRestore.tsx old mode 100755 new mode 100644 diff --git a/src/pages/PasswordRestore/PasswordRestoreGenerate.tsx b/src/pages/PasswordRestore/PasswordRestoreGenerate.tsx old mode 100755 new mode 100644 diff --git a/src/pages/User/Novels/UserNovels.sass b/src/pages/User/Novels/UserNovels.sass old mode 100755 new mode 100644 diff --git a/src/pages/User/Novels/UserNovels.tsx b/src/pages/User/Novels/UserNovels.tsx old mode 100755 new mode 100644 diff --git a/src/pages/User/Settings/Settings.sass b/src/pages/User/Settings/Settings.sass old mode 100755 new mode 100644 diff --git a/src/pages/User/Settings/Settings.tsx b/src/pages/User/Settings/Settings.tsx old mode 100755 new mode 100644 diff --git a/src/pages/User/User.sass b/src/pages/User/User.sass old mode 100755 new mode 100644 diff --git a/src/pages/User/User.tsx b/src/pages/User/User.tsx old mode 100755 new mode 100644 diff --git a/src/pages/Users/Users.sass b/src/pages/Users/Users.sass old mode 100755 new mode 100644 diff --git a/src/pages/Users/Users.tsx b/src/pages/Users/Users.tsx old mode 100755 new mode 100644 diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts old mode 100755 new mode 100644 diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts old mode 100755 new mode 100644 diff --git a/src/store/actionTypes.ts b/src/store/actionTypes.ts old mode 100755 new mode 100644 diff --git a/src/store/actions.ts b/src/store/actions.ts old mode 100755 new mode 100644 diff --git a/src/store/reducers/currentUser.ts b/src/store/reducers/currentUser.ts old mode 100755 new mode 100644 diff --git a/src/store/reducers/index.ts b/src/store/reducers/index.ts old mode 100755 new mode 100644 diff --git a/src/store/reducers/modal.ts b/src/store/reducers/modal.ts old mode 100755 new mode 100644 diff --git a/src/store/reducers/notifications.ts b/src/store/reducers/notifications.ts old mode 100755 new mode 100644 diff --git a/src/store/store.ts b/src/store/store.ts old mode 100755 new mode 100644 diff --git a/src/types.d.ts b/src/types.d.ts old mode 100755 new mode 100644 diff --git a/src/ui/BBEditor/BBEditor.sass b/src/ui/BBEditor/BBEditor.sass old mode 100755 new mode 100644 diff --git a/src/ui/BBEditor/BBEditor.tsx b/src/ui/BBEditor/BBEditor.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Button/Button.sass b/src/ui/Button/Button.sass old mode 100755 new mode 100644 diff --git a/src/ui/Button/Button.tsx b/src/ui/Button/Button.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Comment/Comment.sass b/src/ui/Comment/Comment.sass old mode 100755 new mode 100644 diff --git a/src/ui/Comment/Comment.tsx b/src/ui/Comment/Comment.tsx old mode 100755 new mode 100644 diff --git a/src/ui/ConfirmPopout/ConfirmPopout.sass b/src/ui/ConfirmPopout/ConfirmPopout.sass old mode 100755 new mode 100644 diff --git a/src/ui/ConfirmPopout/ConfirmPopout.tsx b/src/ui/ConfirmPopout/ConfirmPopout.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Group/Group.sass b/src/ui/Group/Group.sass old mode 100755 new mode 100644 diff --git a/src/ui/Group/Group.tsx b/src/ui/Group/Group.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Input/Input.sass b/src/ui/Input/Input.sass old mode 100755 new mode 100644 diff --git a/src/ui/Input/Input.tsx b/src/ui/Input/Input.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Loading.tsx b/src/ui/Loading.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Modal/Modal.sass b/src/ui/Modal/Modal.sass old mode 100755 new mode 100644 diff --git a/src/ui/Modal/Modal.tsx b/src/ui/Modal/Modal.tsx old mode 100755 new mode 100644 diff --git a/src/ui/NewsPost/NewsPost.sass b/src/ui/NewsPost/NewsPost.sass old mode 100755 new mode 100644 diff --git a/src/ui/NewsPost/NewsPost.tsx b/src/ui/NewsPost/NewsPost.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Notifications/NotificationMessage.sass b/src/ui/Notifications/NotificationMessage.sass old mode 100755 new mode 100644 diff --git a/src/ui/Notifications/NotificationMessage.tsx b/src/ui/Notifications/NotificationMessage.tsx old mode 100755 new mode 100644 diff --git a/src/ui/NovelItem/NovelItem.sass b/src/ui/NovelItem/NovelItem.sass old mode 100755 new mode 100644 diff --git a/src/ui/NovelItem/NovelItem.tsx b/src/ui/NovelItem/NovelItem.tsx old mode 100755 new mode 100644 diff --git a/src/ui/ProgressBar/ProgressBar.sass b/src/ui/ProgressBar/ProgressBar.sass new file mode 100644 index 0000000..02a2037 --- /dev/null +++ b/src/ui/ProgressBar/ProgressBar.sass @@ -0,0 +1,119 @@ +@import url(https://fonts.googleapis.com/css?family=Lato:700) + +// -- vars +$bg-color: #34495e +$default-size: 1em +$label-font-size: $default-size / 4 +$label-font-size-redo: $default-size * 4 + +// -- mixins +@mixin size($width, $height) + height: $height + width: $width + +@mixin draw-progress--solid($progress, $color, $bg-color) + background: linear-gradient(to right, $color 50%, $bg-color 50%) + + &:before + @if $progress <= 50 + background: $bg-color + transform: rotate((100 - (50 - $progress)) / 100 * 360deg * -1) + @else + background: $color + transform: rotate((100 - $progress) / 100 * 360deg) + +.charts-container + &:after + clear: both + content: '' + display: table + +.pie-wrapper + @include size($default-size, $default-size) + + font-size: 10em + box-sizing: border-box + margin: 15px + position: relative + + *, *:before, *:after + box-sizing: border-box + + &:nth-child(3n + 1) + clear: both + + .pie + @include size(100%, 100%) + clip: rect(0, $default-size, $default-size, $default-size / 2) + left: 0 + position: absolute + top: 0 + + .half-circle + @include size(100%, 100%) + border: ($default-size / 10) solid #3498db + border-radius: 50% + clip: rect(0, $default-size / 2, $default-size, 0) + left: 0 + position: absolute + top: 0 + + .label + display: block + position: absolute + color: #ecf0f1 + background: $bg-color + border-radius: 50% + cursor: default + font-size: $label-font-size + text-align: center + + line-height: $label-font-size-redo * .70 + top: $label-font-size-redo / 10 + right: $label-font-size-redo / 10 + bottom: $label-font-size-redo / 10 + left: $label-font-size-redo / 10 + + .smaller + font-size: .5em + + .percent + color: #bdc3c7 + font-size: .45em + padding-bottom: 20px + vertical-align: super + + .shadow + @include size(100%, 100%) + border: $default-size / 10 solid #bdc3c7 + border-radius: 50% + + &.style-2 + .label + background: none + color: #7f8c8d + + .smaller + color: #bdc3c7 + +.pie-wrapper--solid + border-radius: 50% + overflow: hidden + + &:before + border-radius: 0 100% 100% 0 / 50% + content: '' + display: block + height: 100% + margin-left: 50% + transform-origin: left + + .label + background: transparent + + &.progress-65 + @include draw-progress--solid(65, #e67e22, $bg-color) + &.progress-25 + @include draw-progress--solid(25, #9b59b6, $bg-color) + &.progress-88 + @include draw-progress--solid(88, #3498db, $bg-color) diff --git a/src/ui/ProgressBar/ProgressBar.tsx b/src/ui/ProgressBar/ProgressBar.tsx new file mode 100644 index 0000000..9d7cbd5 --- /dev/null +++ b/src/ui/ProgressBar/ProgressBar.tsx @@ -0,0 +1,20 @@ +import React, {CSSProperties} from "react"; +import './ProgressBar.sass'; + +const ProgressBar = ({ progress, color, alternative }: { progress: number, color: string, alternative?: boolean }) => { + const rightSide: CSSProperties = progress <= 50 ? { display: "none" } : { transform: 'rotate(180deg)' }; + const borderColor: CSSProperties = { borderColor: color }; + + return ( +
+ {progress}% +
+
+
+
+ {alternative &&
} +
+ ) +} + +export default ProgressBar; diff --git a/src/ui/Recaptcha/Recaptcha.tsx b/src/ui/Recaptcha/Recaptcha.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Spoiler/Spoiler.sass b/src/ui/Spoiler/Spoiler.sass old mode 100755 new mode 100644 diff --git a/src/ui/Spoiler/Spoiler.tsx b/src/ui/Spoiler/Spoiler.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Spoiler/SpoilerTag.tsx b/src/ui/Spoiler/SpoilerTag.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Tags/ColorTag.tsx b/src/ui/Tags/ColorTag.tsx old mode 100755 new mode 100644 diff --git a/src/ui/TextField/TextField.sass b/src/ui/TextField/TextField.sass old mode 100755 new mode 100644 diff --git a/src/ui/TextField/TextField.tsx b/src/ui/TextField/TextField.tsx old mode 100755 new mode 100644 diff --git a/src/ui/Title/Title.sass b/src/ui/Title/Title.sass old mode 100755 new mode 100644 diff --git a/src/ui/Title/Title.tsx b/src/ui/Title/Title.tsx old mode 100755 new mode 100644 diff --git a/src/utils.ts b/src/utils.ts old mode 100755 new mode 100644 diff --git a/tsconfig.json b/tsconfig.json old mode 100755 new mode 100644