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
import { motion } from 'framer-motion' | |
import React from 'react' | |
const images = [ | |
{ | |
src: 'https://a0.muscache.com/im/pictures/miso/Hosting-2810308/original/a653d85a-1a97-45d7-a213-78ef2286122a.jpeg?im_w=720', | |
alt: 'Tree' | |
}, | |
{ | |
src: 'https://a0.muscache.com/im/pictures/2cc58022-2004-4034-a281-22fb622e7461.jpg?im_w=720', |
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
import { NodeViewProps, NodeViewWrapper } from '@tiptap/react' | |
import { nodePasteRule, ReactNodeViewRenderer } from '@tiptap/react' | |
import { mergeAttributes, Node } from '@tiptap/core' | |
import { Tweet } from 'react-tweet' | |
export const TweetComponent = ({ node }: NodeViewProps) => { | |
const url = node.attrs.url | |
const tweetIdRegex = /\/status\/(\d+)/g | |
const id = tweetIdRegex.exec(url)?.[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
import {ChevronLeft, ChevronRight} from 'lucide-react'; | |
import {useEffect, useState} from 'react'; | |
export function Pagination({carousel}: {carousel: HTMLElement}) { | |
// Scroll by 1 page in the given direction (-1 or +1). | |
// This uses the width of the carousel minus the padding and gap between items. | |
// Use behavior: 'smooth' and the browser will animate the scrolling. | |
let scroll = (dir: number) => { | |
let style = window.getComputedStyle(carousel); | |
carousel.scrollBy({ |