-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
524 additions
and
825 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,8 +65,6 @@ | |
"@ionic/core": "npm:[email protected]", | ||
"@ionic/react": "8.4.0", | ||
"@ionic/react-router": "8.4.0", | ||
"@linaria/core": "^6.2.0", | ||
"@linaria/react": "^6.2.1", | ||
"@mantine/hooks": "^7.14.0", | ||
"@reduxjs/toolkit": "^2.3.0", | ||
"capacitor-android-nav-mode": "^1.0.0", | ||
|
@@ -122,8 +120,6 @@ | |
"virtua": "^0.37.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-react": "^7.25.9", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@capacitor/cli": "^6.1.2", | ||
"@eslint/js": "^9.14.0", | ||
"@ionic/cli": "^7.2.0", | ||
|
@@ -139,7 +135,6 @@ | |
"@types/ua-parser-js": "^0.7.39", | ||
"@vitejs/plugin-legacy": "^5.4.3", | ||
"@vitejs/plugin-react": "^4.3.3", | ||
"@wyw-in-js/vite": "^0.5.5", | ||
"babel-plugin-react-compiler": "0.0.0-experimental-19c7e06-20241113", | ||
"eslint": "^9.14.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { ButtonHTMLAttributes } from "react"; | ||
|
||
import { cx } from "#/helpers/css"; | ||
|
||
import styles from "./ActionButton.module.css"; | ||
|
||
export function ActionButton( | ||
props: Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className">, | ||
) { | ||
return <button {...props} className={styles.button} />; | ||
export function ActionButton(props: ButtonHTMLAttributes<HTMLButtonElement>) { | ||
return <button {...props} className={cx(styles.button, props.className)} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
.active { | ||
color: var(--ion-color-primary-contrast); | ||
background: var(--sv-background); | ||
} | ||
|
||
&.entering { | ||
animation: var(--bounce-animation); | ||
} | ||
.entering { | ||
composes: bounce from "#/features/shared/bounce.module.css"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/features/shared/bounce.css → src/features/shared/bounce.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
body { | ||
--bounce-animation: bounce 175ms linear; | ||
.bounce { | ||
animation: bounce 175ms linear; | ||
} | ||
|
||
@keyframes bounce { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.icon { | ||
margin-block: 24px; | ||
|
||
color: white; | ||
|
||
&::after { | ||
content: var(--sv-slash); | ||
position: absolute; | ||
height: var(--sv-slashHeight); | ||
width: 3px; | ||
background: white; | ||
font-size: 1.7em; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%) rotate(-45deg); | ||
transform-origin: center; | ||
box-shadow: 0 0 0 2px var(--sv-bgColorVar); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,32 @@ | ||
import { IonIcon } from "@ionic/react"; | ||
import { styled } from "@linaria/react"; | ||
import { bookmark, mailUnread } from "ionicons/icons"; | ||
import { memo } from "react"; | ||
|
||
import { sv } from "#/helpers/css"; | ||
|
||
import styles from "./ActionContents.module.css"; | ||
import { SlidingItemAction } from "./SlidingItem"; | ||
|
||
const custom_slash_lengths: Record<string, number> = { | ||
[bookmark]: 35, | ||
[mailUnread]: 40, | ||
}; | ||
|
||
const Icon = styled(IonIcon)<{ | ||
icon: string; | ||
slash: boolean; | ||
bgColorVar: string; | ||
}>` | ||
margin-block: 24px; | ||
color: white; | ||
&::after { | ||
content: ${({ slash }) => (slash ? '""' : "none")}; | ||
position: absolute; | ||
height: ${({ icon }) => custom_slash_lengths[icon] ?? 30}px; | ||
width: 3px; | ||
background: white; | ||
font-size: 1.7em; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%) rotate(-45deg); | ||
transform-origin: center; | ||
box-shadow: 0 0 0 2px ${({ bgColorVar }) => bgColorVar}; | ||
} | ||
`; | ||
|
||
interface ActionContentsProps { | ||
action: SlidingItemAction | undefined; | ||
} | ||
|
||
function ActionContents({ action }: ActionContentsProps) { | ||
export default function ActionContents({ action }: ActionContentsProps) { | ||
if (!action) return; | ||
|
||
return ( | ||
<Icon | ||
<IonIcon | ||
className={styles.icon} | ||
icon={action.icon} | ||
slash={action.slash ?? false} | ||
bgColorVar={`var(--ion-color-${action.bgColor}`} | ||
style={sv({ | ||
bgColorVar: `var(--ion-color-${action.bgColor}`, | ||
slash: action.slash ? '""' : "none", | ||
slashHeight: `${custom_slash_lengths[action.icon] ?? 30}px`, | ||
})} | ||
/> | ||
); | ||
} | ||
|
||
export default memo(ActionContents); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.slidingItem { | ||
overflow: initial; /* sticky */ | ||
|
||
--ion-item-border-color: transparent; | ||
} | ||
|
||
.itemOption { | ||
width: 100%; | ||
align-items: flex-end; | ||
|
||
/* ensure subpixel rounding never causes background color to show through */ | ||
margin-bottom: 0.5px; | ||
margin-top: 0.5px; | ||
} | ||
|
||
.optionContainer { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: 2rem; | ||
width: min(60px, 11vw); | ||
|
||
opacity: 0.5; | ||
|
||
position: sticky; | ||
top: 0; | ||
bottom: 0; | ||
|
||
:global(.item-options-start) & { | ||
margin-right: auto; | ||
} | ||
|
||
:global(.item-options-end) & { | ||
margin-left: auto; | ||
} | ||
} | ||
|
||
.optionContainerActive { | ||
composes: bounce from "#/features/shared/bounce.module.css"; | ||
|
||
opacity: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.