Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2042 - Add scroll-snap like behaviour on landing page #2080

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

DukeManh
Copy link
Contributor

@DukeManh DukeManh commented Apr 5, 2021

Issue This PR Addresses

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Fixes #2042

  • This solution is limited. It only works if you scroll and release your touchpad or mouse wheel. It won't work if you keep scrolling (overriding the scroll trigger). I will try to improve this later.
  • The page will scroll down to the timeline on passing 100px threshold, and scroll up on passing height of banner - 50px thresold.

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@humphd
Copy link
Contributor

humphd commented Apr 5, 2021


./src/components/Banner.tsx:1:26
--
16:46:30.265 | Type error: Cannot find module 'smoothscroll-polyfill' or its corresponding type declarations.
16:46:30.266 | > 1 \| import smoothscroll from 'smoothscroll-polyfill';
16:46:30.266 | \|                          ^
16:46:30.266 | 2 \| import { useEffect, useState, useRef } from 'react';
16:46:30.266 | 3 \| import {
16:46:30.266 | 4 \|   makeStyles,

@DukeManh
Copy link
Contributor Author

DukeManh commented Apr 5, 2021


./src/components/Banner.tsx:1:26
--
16:46:30.265 | Type error: Cannot find module 'smoothscroll-polyfill' or its corresponding type declarations.
16:46:30.266 | > 1 \| import smoothscroll from 'smoothscroll-polyfill';
16:46:30.266 | \|                          ^
16:46:30.266 | 2 \| import { useEffect, useState, useRef } from 'react';
16:46:30.266 | 3 \| import {
16:46:30.266 | 4 \|   makeStyles,

`

@humphd . Npm run build doesn't fail locally. I don't know why @types/smoothscroll-polyfill is not working.

@humphd
Copy link
Contributor

humphd commented Apr 5, 2021

You must have something installed locally that you didn't add to package.json, and is missing on Vercel

package.json Outdated Show resolved Hide resolved
birtony
birtony previously approved these changes Apr 6, 2021
Copy link
Contributor

@birtony birtony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how this works

yuanLeeMidori
yuanLeeMidori previously approved these changes Apr 6, 2021
Copy link
Contributor

@yuanLeeMidori yuanLeeMidori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work well locally!

@humphd
Copy link
Contributor

humphd commented Apr 7, 2021

We need a rebase on this.

@DukeManh
Copy link
Contributor Author

DukeManh commented Apr 7, 2021

This solution is limited. It only works if you scroll and release your touchpad or mouse wheel. It won't work if you keep scrolling (overriding the scroll trigger). I will try to improve this later.

@DukeManh
Copy link
Contributor Author

DukeManh commented Apr 7, 2021

I just rebased, can I get another review?

PedroFonsecaDEV
PedroFonsecaDEV previously approved these changes Apr 7, 2021
@humphd
Copy link
Contributor

humphd commented Apr 7, 2021

It looks like this is still behind (needs another merge conflict fixed). If you do it, I'll review and land with you.

@DukeManh
Copy link
Contributor Author

DukeManh commented Apr 7, 2021

Can you help merge when it's ready?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[U.I 2.0][Landing Page] Scroll-snap on lading page.
5 participants