This file contains hidden or 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
export default function MyApp({ Component, pageProps }) { | |
useEffect(() => { | |
let scroll; | |
import('locomotive-scroll').then((locomotiveModule) => { | |
scroll = new locomotiveModule.default({ | |
el: document.querySelector('[data-scroll-container]'), | |
smooth: true, | |
smoothMobile: false, | |
resetNativeScroll: true, | |
}); |
This file contains hidden or 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
import { useEffect } from 'react'; | |
export function useOutsideClick(containerRef, triggerRef, cb) { | |
function isOutsideClick(evt) { | |
if ( | |
(containerRef.current !== null && | |
containerRef.current.contains(evt.target)) || | |
(triggerRef !== null && triggerRef.current.contains(evt.target)) | |
) { | |
return cb({ |
This file contains hidden or 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
//custom-dynamic-type.swift | |
protocol CustomDynamicTypeable { | |
func preferredFont(forTextStyle style: UIFontTextStyle) -> UIFont? | |
func font(forSize pointSize: CGFloat) -> UIFont? | |
} | |
// judson-enum.swift | |
enum JudsonFont: String, CustomDynamicTypeable { | |
case regular = "Judson-Regular" | |
case bold = "Judson-Bold" |
This file contains hidden or 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
import UIKit | |
extension UIFont { | |
class func systemFontOfSize(size: CGFloat) -> UIFont { | |
return UIFont(name: "CustomFont-Regular", size: size)! | |
} | |
func lightSystemFontOfSize(size: CGFloat) -> UIFont { | |
return UIFont(name: "CustomFont-Light", size: size)! | |
} | |
func boldSystemFontOfSize(size: CGFloat) -> UIFont { |