diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6e29ac8..c5bdf36 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -7,6 +7,7 @@ const inter = Inter_Tight({ }); // TODO: Move more over to metadata over putting in the head +// TODO: Figure out how to add viewport meta tag : see chrome issue : https://stackoverflow.com/a/77879573/2824643 export const metadata: Metadata = { title: 'iOS404', description: 'The missing web features of iOS', @@ -57,6 +58,10 @@ export default function RootLayout({ property="og:image" content="https://ios404.com/icons/ios-404-og-1200x630.jpg" /> + + diff --git a/src/components/experience.tsx b/src/components/experience.tsx index 7d5972f..a975eb4 100644 --- a/src/components/experience.tsx +++ b/src/components/experience.tsx @@ -23,8 +23,13 @@ const Button = styled.button` const config = { mass: 0.05, tension: 600, friction: 40 }; export default function Experience() { - const { activeIndex, iOSMissingFeatures, setNextFeature, filteredData } = - useCanIUseContext(); + const { + activeIndex, + iOSMissingFeatures, + setNextFeature, + filteredData, + doNotRotate, + } = useCanIUseContext(); const len = iOSMissingFeatures.length; const filteredLen = filteredData.length; const turns = useRef(0); @@ -34,7 +39,7 @@ export default function Experience() { // @ts-ignore const prevPos = filteredData.findIndex((v) => v.index === prevActiveIndex); - if (activeIndex !== -1 && prevActiveIndex !== -1) { + if (activeIndex !== -1 && prevActiveIndex !== -1 && !doNotRotate) { if (prevPos < pos) { const looping = pos === filteredLen - 1 && prevPos === 0; turns.current += looping ? -1 : 1; @@ -87,8 +92,9 @@ export default function Experience() { const value = Math.min(Math.abs(mx), 44.5); // clamping... const sign = Math.sign(mx); if (last) { + console.log({ value, filteredDatalength: filteredData.length }); if (value > 35 && filteredData.length > 1) { - setNextFeature({ forwards: sign === -1 }); + setNextFeature({ forwards: sign === -1, action: 'swipe' }); return; } else { api.start({ @@ -155,7 +161,11 @@ export default function Experience() { >