Compare commits
No commits in common. "4d3f5c911b36acdbe10d9d85cd3116896628c9f1" and "9b446aa8461ccd927df36d78286de2ae18036fa2" have entirely different histories.
4d3f5c911b
...
9b446aa846
4 changed files with 9 additions and 20 deletions
|
@ -306,7 +306,10 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
|
||||||
}
|
}
|
||||||
const [fig0] = event.touches;
|
const [fig0] = event.touches;
|
||||||
const { x, width } = event.currentTarget.getBoundingClientRect();
|
const { x, width } = event.currentTarget.getBoundingClientRect();
|
||||||
if (fig0.clientX < x - 22 || fig0.clientX > x + 22) {
|
if (
|
||||||
|
fig0.clientX - fig0.radiusX < x - 22 ||
|
||||||
|
fig0.clientX + fig0.radiusX > x + 22
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
origX = x;
|
origX = x;
|
||||||
|
@ -413,10 +416,10 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
|
||||||
class="StackedPage"
|
class="StackedPage"
|
||||||
onCancel={[popFrame, 1]}
|
onCancel={[popFrame, 1]}
|
||||||
onClick={[onDialogClick, popFrame]}
|
onClick={[onDialogClick, popFrame]}
|
||||||
on:touchstart={onDialogTouchStart}
|
onTouchStart={onDialogTouchStart}
|
||||||
on:touchmove={onDialogTouchMove}
|
onTouchMove={onDialogTouchMove}
|
||||||
on:touchend={onDialogTouchEnd}
|
onTouchEnd={onDialogTouchEnd}
|
||||||
on:touchcancel={onDialogTouchCancel}
|
onTouchCancel={onDialogTouchCancel}
|
||||||
id={frame().rootId}
|
id={frame().rootId}
|
||||||
>
|
>
|
||||||
<StaticRouter url={frame().path} {...oprops} />
|
<StaticRouter url={frame().path} {...oprops} />
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
min-width: 40px;
|
min-width: 40px;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
background-color: var(--media-color-accent, var(--tutu-color-surface-d));
|
background-color: var(--tutu-color-surface-d);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
border: 1px solid var(--tutu-color-surface-d);
|
border: 1px solid var(--tutu-color-surface-d);
|
||||||
transition: outline-width 60ms var(--tutu-anim-curve-std), border-color 60ms var(--tutu-anim-curve-std);
|
transition: outline-width 60ms var(--tutu-anim-curve-std), border-color 60ms var(--tutu-anim-curve-std);
|
||||||
|
|
|
@ -19,10 +19,6 @@
|
||||||
background-color: var(--tutu-color-surface);
|
background-color: var(--tutu-color-surface);
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
&.loaded {
|
|
||||||
background-color: #eeeeee;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
|
|
|
@ -5,14 +5,6 @@ import { Title, Body1 } from "../../material/typography";
|
||||||
import { averageColorHex } from "../../platform/blurhash";
|
import { averageColorHex } from "../../platform/blurhash";
|
||||||
import "./PreviewCard.css";
|
import "./PreviewCard.css";
|
||||||
|
|
||||||
function onResetImg(event: Event & { currentTarget: HTMLImageElement }) {
|
|
||||||
event.currentTarget.classList.remove("loaded");
|
|
||||||
}
|
|
||||||
|
|
||||||
function onImgLoaded(event: Event & { currentTarget: HTMLImageElement }) {
|
|
||||||
event.currentTarget.classList.add("loaded");
|
|
||||||
}
|
|
||||||
|
|
||||||
export function PreviewCard(props: {
|
export function PreviewCard(props: {
|
||||||
src: mastodon.v1.PreviewCard;
|
src: mastodon.v1.PreviewCard;
|
||||||
alwaysCompact?: boolean;
|
alwaysCompact?: boolean;
|
||||||
|
@ -89,8 +81,6 @@ export function PreviewCard(props: {
|
||||||
>
|
>
|
||||||
<Show when={props.src.image}>
|
<Show when={props.src.image}>
|
||||||
<img
|
<img
|
||||||
onLoadStart={onResetImg}
|
|
||||||
onLoad={onImgLoaded}
|
|
||||||
crossOrigin="anonymous"
|
crossOrigin="anonymous"
|
||||||
src={props.src.image!}
|
src={props.src.image!}
|
||||||
width={props.src.width || undefined}
|
width={props.src.width || undefined}
|
||||||
|
|
Loading…
Reference in a new issue