Skip to content

Commit

Permalink
feat: cleanup css
Browse files Browse the repository at this point in the history
  • Loading branch information
mbret committed Sep 8, 2024
1 parent 16aa4c5 commit f83d9a7
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 129 deletions.
3 changes: 1 addition & 2 deletions packages/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ManageBookCollectionsDialog } from "./books/ManageBookCollectionsDialog
import { plugins } from "./plugins/configure"
import { UpdateAvailableDialog } from "./workers/UpdateAvailableDialog"
import { PreloadQueries } from "./PreloadQueries"
import { SplashScreen } from "./SplashScreen"
import { SplashScreen } from "./common/SplashScreen"
import { BlurFilterReference } from "./books/BlurFilterReference"
import "./i18n"
import { ErrorBoundary } from "@sentry/react"
Expand Down Expand Up @@ -72,7 +72,6 @@ export function App() {
<ThemeProvider>
<QueryClientProvider client={queryClient}>
<Suspense fallback={<SplashScreen show />}>
{/* <SplashScreen show={!isAppReady} /> */}
{!isHydratingProfile && isAuthHydrated && (
<>
{plugins.reduce(
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/books/bookList/BookListCoverContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const BookListCoverContainer: FC<
<Chip
color="primary"
size="small"
icon={<LoopRounded color="primary" className="icon-spin" />}
icon={<LoopRounded color="primary" className="oboku-infinite-spin" />}
label="metadata..."
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/books/bookList/BookListListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const BookListListItem: FC<
>
<Chip
size="small"
avatar={<LoopRounded className="icon-spin" />}
avatar={<LoopRounded className="oboku-infinite-spin" />}
label="metadata..."
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Fade } from "@mui/material"
import { memo, useState } from "react"
import { Logo } from "./common/Logo"
import { Logo } from "./Logo"

export const SplashScreen = memo(({ show }: { show: boolean }) => {
const [hidden, setHidden] = useState(false)
Expand Down
15 changes: 15 additions & 0 deletions packages/web/src/common/animations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@keyframes obokuSpin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

.oboku-infinite-spin {
animation-name: obokuSpin;
animation-duration: 1500ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
122 changes: 0 additions & 122 deletions packages/web/src/index.css

This file was deleted.

14 changes: 14 additions & 0 deletions packages/web/src/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
html,
body,
#root {
height: 100%;
/* height: 100%; */
/* Disables pull-to-refresh but allows overscroll glow effects. */
overscroll-behavior-y: contain;
}

*,
*::before,
*::after {
box-sizing: border-box;
}
3 changes: 2 additions & 1 deletion packages/web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import "@fontsource/roboto/400.css"
import "@fontsource/roboto/500.css"
import "@fontsource/roboto/700.css"
import "react-responsive-carousel/lib/styles/carousel.min.css"
import "./index.css"
import "./main.css"
import "./common/animations.css"
import { App } from "./App"
import * as Sentry from "@sentry/react"

Expand Down
1 change: 1 addition & 0 deletions packages/web/src/plugins/google/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useLoadGapi } from "./lib/gapi"
import { useLoadGsi } from "./lib/gsi"
import { useSignalValue } from "reactjrx"
import { consentShownSignal } from "./lib/auth"
import "./lib/picker.css"

export const Provider: ObokuPlugin["Provider"] = memo(({ children }) => {
const consentPopupShown = useSignalValue(consentShownSignal)
Expand Down
16 changes: 16 additions & 0 deletions packages/web/src/plugins/google/lib/picker.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* google Picker overwrite to have it fullscreen and mobile friendly */
.picker-dialog {
z-index: 3000 !important;
height: 100%;
width: 100%;
}
.picker-dialog {
height: 100% !important;
width: 100% !important;
left: 0 !important;
}
.picker-dialog-content {
height: 100% !important;
width: 100% !important;
left: 0 !important;
}
2 changes: 1 addition & 1 deletion packages/web/src/reader/navigation/Scrubber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useTotalPages } from "../pagination/useTotalPages"
import { useCurrentPages } from "../pagination/useCurrentPages"
import { useIsUsingReverseNavigation } from "./useIsUsingReverseNavigation"
import { useIsUsingPagesPerChapter } from "../pagination/useIsUsingPagesPerChapter"
import { ObokuRcSlider } from "./ObokuRcSlider"
import { ObokuRcSlider } from "./slider/ObokuRcSlider"

export const Scrubber = memo(({ bookId }: { bookId: string }) => {
const reader = useSignalValue(readerSignal)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ComponentProps, forwardRef } from "react"
import RcSlider from "rc-slider"
import "rc-slider/assets/index.css"
import "./index.css"
import { ComponentsVariants, useTheme, useThemeProps } from "@mui/material"

interface ScrubberProps extends ComponentProps<typeof RcSlider> {
Expand Down
3 changes: 3 additions & 0 deletions packages/web/src/reader/navigation/slider/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.rc-slider-disabled {
background-color: inherit !important;
}

0 comments on commit f83d9a7

Please sign in to comment.