diff --git a/web/package.json b/web/package.json index 1dbb14a..d166c66 100644 --- a/web/package.json +++ b/web/package.json @@ -7,7 +7,6 @@ "@material-ui/icons": "^4.11.2", "axios": "^0.21.1", "clsx": "^1.1.1", - "fontsource-roboto": "^4.0.0", "i18next": "^20.3.1", "i18next-browser-languagedetector": "^6.1.1", "lodash": "^4.17.21", diff --git a/web/public/android-chrome-192x192.png b/web/public/android-chrome-192x192.png new file mode 100644 index 0000000..d34d722 Binary files /dev/null and b/web/public/android-chrome-192x192.png differ diff --git a/web/public/android-chrome-512x512.png b/web/public/android-chrome-512x512.png new file mode 100644 index 0000000..18151cd Binary files /dev/null and b/web/public/android-chrome-512x512.png differ diff --git a/web/public/apple-touch-icon.png b/web/public/apple-touch-icon.png new file mode 100644 index 0000000..e36ede4 Binary files /dev/null and b/web/public/apple-touch-icon.png differ diff --git a/web/public/browserconfig.xml b/web/public/browserconfig.xml new file mode 100644 index 0000000..b3930d0 --- /dev/null +++ b/web/public/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #da532c + + + diff --git a/web/public/favicon-16x16.png b/web/public/favicon-16x16.png new file mode 100644 index 0000000..3e592b8 Binary files /dev/null and b/web/public/favicon-16x16.png differ diff --git a/web/public/favicon-32x32.png b/web/public/favicon-32x32.png new file mode 100644 index 0000000..4153179 Binary files /dev/null and b/web/public/favicon-32x32.png differ diff --git a/web/public/favicon.ico b/web/public/favicon.ico new file mode 100644 index 0000000..b234d84 Binary files /dev/null and b/web/public/favicon.ico differ diff --git a/web/public/index.html b/web/public/index.html index 41b4208..fd25f39 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -1,33 +1,42 @@ - - - - - - - TorrServer - - - -
+ + + + + + + + + + + + - - - - - + TorrServer + + + + +
+ + + + + + + \ No newline at end of file diff --git a/web/public/mstile-150x150.png b/web/public/mstile-150x150.png new file mode 100644 index 0000000..ac32aeb Binary files /dev/null and b/web/public/mstile-150x150.png differ diff --git a/web/public/safari-pinned-tab.svg b/web/public/safari-pinned-tab.svg new file mode 100644 index 0000000..2ad030d --- /dev/null +++ b/web/public/safari-pinned-tab.svg @@ -0,0 +1,265 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + diff --git a/web/public/site.webmanifest b/web/public/site.webmanifest new file mode 100644 index 0000000..52b6bb1 --- /dev/null +++ b/web/public/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/web/src/components/App/Sidebar.jsx b/web/src/components/App/Sidebar.jsx index 3aaa887..e25b5ea 100644 --- a/web/src/components/App/Sidebar.jsx +++ b/web/src/components/App/Sidebar.jsx @@ -2,10 +2,9 @@ import Divider from '@material-ui/core/Divider' import ListItem from '@material-ui/core/ListItem' import ListItemIcon from '@material-ui/core/ListItemIcon' import ListItemText from '@material-ui/core/ListItemText' -import { CreditCard as CreditCardIcon, Language as LanguageIcon } from '@material-ui/icons' +import { CreditCard as CreditCardIcon } from '@material-ui/icons' import List from '@material-ui/core/List' import { useTranslation } from 'react-i18next' -import useChangeLanguage from 'utils/useChangeLanguage' import AddDialogButton from 'components/Add' import SettingsDialog from 'components/Settings' import RemoveAll from 'components/RemoveAll' @@ -15,7 +14,6 @@ import CloseServer from 'components/CloseServer' import { AppSidebarStyle } from './style' export default function Sidebar({ isDrawerOpen, setIsDonationDialogOpen }) { - const [currentLang, changeLang] = useChangeLanguage() const { t } = useTranslation() return ( @@ -35,17 +33,6 @@ export default function Sidebar({ isDrawerOpen, setIsDonationDialogOpen }) { - - (currentLang === 'en' ? changeLang('ru') : changeLang('en'))}> - - - - - - - - - diff --git a/web/src/components/App/index.jsx b/web/src/components/App/index.jsx index e212c60..cbe6636 100644 --- a/web/src/components/App/index.jsx +++ b/web/src/components/App/index.jsx @@ -10,8 +10,9 @@ import axios from 'axios' import TorrentList from 'components/TorrentList' import DonateSnackbar from 'components/Donate' import DonateDialog from 'components/Donate/DonateDialog' +import useChangeLanguage from 'utils/useChangeLanguage' -import { AppWrapper, AppHeader } from './style' +import { AppWrapper, AppHeader, LanguageSwitch } from './style' import Sidebar from './Sidebar' const baseTheme = createMuiTheme({ @@ -23,6 +24,7 @@ export default function App() { const [isDrawerOpen, setIsDrawerOpen] = useState(false) const [isDonationDialogOpen, setIsDonationDialogOpen] = useState(false) const [torrServerVersion, setTorrServerVersion] = useState('') + const [currentLang, changeLang] = useChangeLanguage() useEffect(() => { axios.get(echoHost()).then(({ data }) => setTorrServerVersion(data)) @@ -48,6 +50,12 @@ export default function App() { TorrServer {torrServerVersion} + +
+ (currentLang === 'en' ? changeLang('ru') : changeLang('en'))}> + {currentLang === 'en' ? 'RU' : 'EN'} + +
diff --git a/web/src/components/App/style.js b/web/src/components/App/style.js index 436b758..b940905 100644 --- a/web/src/components/App/style.js +++ b/web/src/components/App/style.js @@ -21,8 +21,10 @@ export const AppHeader = styled.div` background: #00a572; color: rgba(0, 0, 0, 0.87); grid-area: head; - display: flex; + display: grid; + grid-auto-flow: column; align-items: center; + grid-template-columns: repeat(2, max-content) 1fr; box-shadow: 0px 2px 4px -1px rgb(0 0 0 / 20%), 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%); padding: 0 24px; z-index: 3; @@ -63,3 +65,26 @@ export const TorrentListWrapper = styled.div` grid-template-columns: 1fr; } ` + +export const LanguageSwitch = styled.div` + cursor: pointer; + border-radius: 50%; + background: #56b887; + height: 35px; + width: 35px; + transition: all 0.2s; + font-weight: 500; + display: grid; + place-items: center; + color: #44795e; + + :hover { + background: #7ec9a3; + } + + @media (max-width: 700px) { + height: 28px; + width: 28px; + font-size: 12px; + } +` diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index 1f24d73..bab6525 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -1,4 +1,3 @@ -import 'fontsource-roboto' import { forwardRef, memo, useState } from 'react' import { UnfoldMore as UnfoldMoreIcon, diff --git a/web/src/components/TorrentCard/style.js b/web/src/components/TorrentCard/style.js index 31ca13f..54e131e 100644 --- a/web/src/components/TorrentCard/style.js +++ b/web/src/components/TorrentCard/style.js @@ -166,7 +166,6 @@ export const StyledButton = styled.button` background: #268757; color: #fff; font-size: 0.9rem; - font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif; letter-spacing: 0.009em; padding: 0 12px; svg { diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json index 76c6817..7db9381 100644 --- a/web/src/locales/en/translation.json +++ b/web/src/locales/en/translation.json @@ -25,7 +25,6 @@ "Cache": "Cache", "CacheSize": "Cache Size (Megabytes)", "Cancel": "Cancel", - "ChooseLanguage": "По-русски", "Clear": "Clear", "Close": "Close", "CloseServer?": "Do you want to turn off server?", diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json index 9dab3ea..dff1009 100644 --- a/web/src/locales/ru/translation.json +++ b/web/src/locales/ru/translation.json @@ -25,7 +25,6 @@ "Cache": "Кеш", "CacheSize": "Размер кеша (Мегабайты)", "Cancel": "Отмена", - "ChooseLanguage": "In English", "Clear": "Очистить", "Close": "Закрыть", "CloseServer?": "Хотите выключить сервер?", diff --git a/web/yarn.lock b/web/yarn.lock index 34ff6b6..3d65690 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -5808,11 +5808,6 @@ follow-redirects@^1.0.0, follow-redirects@^1.10.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== -fontsource-roboto@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fontsource-roboto/-/fontsource-roboto-4.0.0.tgz#35eacd4fb8d90199053c0eec9b34a57fb79cd820" - integrity sha512-zD6L8nvdWRcwSgp4ojxFchG+MPj8kXXQKDEAH9bfhbxy+lkpvpC1WgAK0lCa4dwobv+hvAe0uyHaawcgH7WH/g== - for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"