Skip to content

Commit

Permalink
Merge pull request #88 from n0-computer/sendme
Browse files Browse the repository at this point in the history
Sendme
  • Loading branch information
b5 authored Dec 21, 2023
2 parents de0c93d + 8136654 commit a8520a9
Show file tree
Hide file tree
Showing 17 changed files with 739 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@algolia/autocomplete-core": "^1.11.1",
"@headlessui/react": "^1.7.17",
"@headlessui/tailwindcss": "^0.2.0",
"@heroicons/react": "^2.0.18",
"@heroicons/react": "^2.1.1",
"@lottiefiles/lottie-interactivity": "^1.6.2",
"@lottiefiles/lottie-player": "^2.0.2",
"@lottiefiles/react-lottie-player": "^3.5.3",
Expand Down
201 changes: 201 additions & 0 deletions public/img/sendme/sendme_hero_1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions public/sendme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
# Copyright 2023 n0. All rights reserved. Dual MIT/Apache license.

set -e

repo="n0-computer/sendme"
release_url="https://api.github.com/repos/$repo/releases/latest"

if [ "$OS" = "Windows_NT" ]; then
echo "Error: this installer only works on linux & macOS." 1>&2
exit 1
else
case $(uname -sm) in
"Darwin x86_64") target="darwin-x86_64" ;;
"Darwin arm64") target="darwin-aarch64" ;;
"Linux x86_64") target="linux-x86_64" ;;
"Linux arm64"|"Linux aarch64") target="linux-aarch64" ;;
*) target="linux-x86_64" ;;
esac
fi

echo "Downloading $repo for $target"
release_target_url=$(
curl -s "$release_url" |
grep "browser_download_url" |
grep "$target" |
sed -re 's/.*: "([^"]+)".*/\1/' \
)

curl -sL "$release_target_url" | tar xz
16 changes: 16 additions & 0 deletions src/app/sendme/PageIcon.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";

export function PageIcon() {
return (
<svg id="a" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
<g>
<path d="m27,199c-.55,0-1-.45-1-1V30.41L55.41,1h117.59c.55,0,1,.45,1,1v196c0,.55-.45,1-1,1H27Z" style={{ fill: '#fff', strokeWidth: 0 }} />
<path d="m173,2v196H27V30.83L55.83,2h117.17m0-2H55l-30,30v168c0,1.1.9,2,2,2h146c1.1,0,2-.9,2-2V2c0-1.1-.9-2-2-2h0Z" style={{ strokeWidth: 0 }} />
</g>
<g>
<path d="m27.41,29L54,2.41v25.59c0,.55-.45,1-1,1h-25.59Z" style={{ fill: '#fff', strokeWidth: 0 }} />
<path d="m53,4.83v23.17h-23.17L53,4.83m2-4.83l-30,30h28c1.1,0,2-.9,2-2V0h0Z" style={{ strokeWidth: 0 }} />
</g>
</svg>
)
}
48 changes: 48 additions & 0 deletions src/app/sendme/bg.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from 'react'

export default function Background() {
return (
<div className="absolute inset-0 -z-10 mx-0 w-full h-full max-w-none overflow-hidden">
<svg id="visual" viewBox="0 0 900 600">
<defs>
<filter id="blur1" x="-10%" y="-10%" width="120%" height="120%">
<feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend>
<feGaussianBlur stdDeviation="161" result="effect1_foregroundBlur"></feGaussianBlur>
</filter>

<circle id="shape" cx="450" cy="300" r="1200" />
<filter id="noise">
<feTurbulence
type="fractalNoise"
baseFrequency="19.5"
numOctaves="10"
result="turbulence"
/>
<feComposite operator="in" in="turbulence" in2="SourceAlpha" result="composite"/>
<feColorMatrix in="composite" type="luminanceToAlpha" />
<feBlend in="SourceGraphic" in2="composite" mode="color-burn" />
</filter>
<mask id="gradient">
<linearGradient id="fade">
<stop offset="0%" stop-color="black" stop-opacity="0.6" />
<stop offset="65%" stop-color="white" stop-opacity="0.9" />
<stop offset="75%" stop-color="white" stop-opacity="1" />
</linearGradient>
<use href="#shape" fill="url('#fade')" />
</mask>
</defs>
<rect width="900" height="600" fill="#6600FF"></rect>
<g filter="url(#blur1)">
<circle cx="28" cy="89" fill="#00CC99" r="357"></circle>
<circle cx="845" cy="44" fill="#6600FF" r="357"></circle>
<circle cx="500" cy="119" fill="#00CC99" r="357"></circle>
<circle cx="197" cy="377" fill="#00CC99" r="357"></circle>
<circle cx="106" cy="591" fill="#6600FF" r="357"></circle>
<circle cx="309" cy="517" fill="#00CC99" r="357"></circle>
</g>
<use href="#shape" fill="hsl(337, 92%, 69%)" mask="url(#gradient)" filter="url('#noise')" />
</svg>
</div>
)
}
14 changes: 14 additions & 0 deletions src/app/sendme/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import SendmePage from '@/components/SendmePage'

export const metadata = {
title: 'Sendme',
description:
'send files over the internet',
}

export const sections = [
{title: 'Guides', id: 'guides'},
{title: 'Resources', id: 'resources'},
]

<SendmePage />
2 changes: 2 additions & 0 deletions src/components/FooterMarketing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const navigation = {
learn: [
{ name: 'Blog', href: '/blog' },
{ name: 'Examples', href: '/docs/examples' },
{ name: "dumbpipe", href: 'https://dumbpipe.dev'},
{ name: "sendme", href: '/sendme'},
],
connect: [
{ name: 'Discord', href: 'https://iroh.computer/discord' },
Expand Down
2 changes: 1 addition & 1 deletion src/components/GithubStars.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function GithubStars(props) {
return (
<Link href="https://github.com/n0-computer/iroh" className='p-2 -mt-2 flex text-sm leading-5 fill-zinc-400 text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-600 dark:hover:fill-zinc-600 hover:bg-black/10 rounded'>
<GithubIcon className="h-5 w-5" />
<span className='ml-2 mt-0'>1k</span>
<span className='ml-2 mt-0'>1.1k</span>
</Link>
)
}
147 changes: 147 additions & 0 deletions src/components/SendmePage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
'use client';

import React from 'react'
import Image from 'next/image'
import localFont from 'next/font/local'
import clsx from 'clsx'
import {
ChatBubbleLeftIcon,
ClipboardDocumentIcon,
ClipboardDocumentCheckIcon
} from '@heroicons/react/24/outline'
import { Button } from './Button'

const koulen = localFont({
src: '../fonts/Koulen-Regular.ttf',
display: 'swap',
variable: '--font-koulen-regular',
weight: '200 900',
})

export default function SendmePage() {
const install = `curl -fsSL https://iroh.computer/sendme.sh | sh`
const [copied, setCopied] = React.useState(false)

const handleCopy = () => {
navigator.clipboard.writeText(install);
setCopied(true);
setTimeout(() => {
setCopied(false);
}, 1300);
}

return (
<div className={clsx('w-full h-full bg-white text-zinc-700', koulen.variable)}>
<div className="pt-10 mx-auto lg:max-w-5xl">
<div className='max-w-5xl mx-auto text-center mt-20'>
<p className='text-lg text-zinc-500 font-koulen'>New to send files? Try</p>
<h1 className='text-5xl lg:text-7xl font-koulen'>Sendme</h1>
<p className='text-lg text-zinc-500'>Unlimited file size. Free. No account required.</p>
</div>
<Image src="/img/sendme/sendme_hero_1.svg" alt='one computer sending files to another computer through a pipe' width='1600' height='900' className='md:-mt-20' />

<div className='md:-mt-20 mx-5 md:mx-0 h-10 border-l border-r shadow-sm' />
<div className='mx-5 md:mx-0 border-t border-l border-r shadow-sm'>
<div className='md:flex'>
<div className='px-5 py-10 border-b md:border-r md:w-5/12'>
<h2 className='text-4xl text-zinc-700 font-koulen'>File transfer<br />doesn&apos;t need to be complicated</h2>
<p className='mt-1 text-sm/6 text-gray-500'>It&apos;s like <span className='font-space-mono'>scp</span> without needing to know the IP address. Add some files to sendme, and it will give you a pastable ticket that you can give to anyone who needs your files. Sendme will connect your devices directly & transfer the data without any accounts or configuration.</p>
</div>

<div className='px-5 py-10 border-b flex-1 md:w-7/12'>
<h3 className='text-3xl font-koulen'>Install</h3>
<p className='mt-1 text-sm/6 text-gray-500'>Add sendme to your machine using shell:</p>
<button className='text-xs md:text rounded bg-zinc-100 p-2 mt-2 flex plausible-event-name=Sendme+Copy+Install+Script+Click' onClick={handleCopy}>
<div className='grow mr-10 font-spaceMono'>$ {install}</div>
{copied
? <span className='w-10 mr-1'>copied!</span>
: <span className='w-10 mr-1'></span> }
{copied
? <ClipboardDocumentCheckIcon className="h-5 w-5 text-zinc-500" />
: <ClipboardDocumentIcon className="h-5 w-5 text-zinc-500" />}
</button>
</div>
</div>
</div>

<div className='mx-5 md:mx-0 h-5 border-l border-r shadow-sm' />
<div className='mx-5 md:mx-0 border-t border-l border-r shadow-sm'>
<div className='px-5 pt-10'>
<h3 className='font-koulen text-zinc-600 text-xl'>USING SENDME:</h3>
</div>
<div className='md:flex sm:gap-5 border-b'>
<div className='md:w-1/3 p-5 pb-10'>
<div className='relative rounded border border-zinc-300 bg-zinc-100 p-2 py-8 h-40 mb-5'>
<div className='absolute top-0 left-0 p-2 flex gap-1'>
<div className='border border-zinc-400 w-3 h-3 rounded-full' />
<div className='border border-zinc-400 w-3 h-3 rounded-full' />
<div className='border border-zinc-400 w-3 h-3 rounded-full' />
</div>
<p className='font-mono font-bold text-sm'>{'>'} $ sendme provide ~/great_photos</p>
<p className='font-mono text-zinc-400 text-sm'>content added</p>
<p className='font-mono text-zinc-400 text-sm'>run sendme get blobQmFoo...</p>
</div>
<h3 className='font-koulen text-3xl'>1. Setup</h3>
<p className='mt-1 text-sm/6 text-gray-500'>pass a file or folder you want to share to sendme. It&apos;ll spit out a ticket.</p>
</div>
<div className='md:w-1/3 p-5 pb-10'>
<div className='relative p-2 flex h-40 mb-5'>
<ChatBubbleLeftIcon className='w-6 h-6 mr-2' />
<div className='rounded-tr-lg rounded-br-lg rounded-bl-lg border bg-zinc-50 p-2 pb-10 mb-2 h-20'>
hey here have some great photos:
blobQmFoo...
</div>
</div>
<h3 className='font-koulen text-3xl'>2. Paste</h3>
<p className='mt-1 text-sm/6 text-gray-500'>copy-paste the ticket to your friend.</p>
</div>
<div className='md:w-1/3 p-5 pb-10'>
<div className='relative rounded border border-zinc-300 bg-zinc-100 p-2 py-8 h-40 mb-5'>
<div className='absolute top-0 left-0 p-2 flex gap-1'>
<div className='border border-zinc-400 w-3 h-3 rounded-full' />
<div className='border border-zinc-400 w-3 h-3 rounded-full' />
<div className='border border-zinc-400 w-3 h-3 rounded-full' />
</div>
<p className='font-mono font-bold text-sm'>{'>'} $ sendme get blobQmFoo...</p>
<p className='font-mono text-zinc-400 text-sm'>fetched to great_photos</p>
</div>
<h3 className='font-koulen text-3xl'>3. Download</h3>
<p className='mt-1 text-sm/6 text-gray-500'>run get to fetch data directly from your friend.</p>
</div>
</div>
</div>

<div className='mx-5 md:mx-0 h-5 border-l border-r shadow-sm' />
<div className='mx-5 md:mx-0 border-t border-l border-r shadow-sm'>
<div>
<div className='p-5'>
<h3 className='text-2xl md:text-3xl font-koulen'>Free, for files & folders of any size</h3>
<p className='mt-1 text-sm/6 text-gray-500'>sendme works by connecting sender and receiver directly, so there&apos;s no need to upload to a server, which means no cost!</p>
</div>
<div className='md:flex border-t border-b'>
<div className='p-5 md:border-r'>
<h3 className='font-koulen text-3xl'>Fast</h3>
<p className='mt-1 text-sm/6 text-gray-500'>Sendme can saturate a 4Gbps connection.</p>
</div>
<div className='p-5 md:border-r'>
<h3 className='font-koulen text-3xl'>Resumable fetching</h3>
<p className='mt-1 text-sm/6 text-gray-500'>Interrupted downloads pick up where they left off.</p>
</div>
<div className='p-5'>
<h3 className='font-koulen text-3xl'>Integrity checks</h3>
<p className='mt-1 text-sm/6 text-gray-500'>Data is automatically verified for correctness on both send and receive.</p>
</div>
</div>
</div>

<div className='border-t border-b bg-iroh-kv-1 p-5 py-20'>
<h2 className='text-2xl font-bold font-spaceMono'>Sendme is built on <span className='text-irohPurple-500'>iroh</span></h2>
<p className='md:max-w-lg mt-5'>Just like <a className='text-irohPurple-500' href="https://dumbpipe.dev">dumbpipe</a>, sendme is built on iroh. Sendme uses iroh <a className='text-irohPurple-700' href="/docs/layers/blobs">blobs</a> to send and verfiy your files, and <a className='text-irohPurple-700' href='/docs/layers/connections'>connections</a> to establish direct links between devices for data transfer</p>
<Button href='/' variant='filled' className='mt-5 plausible-event-name=Sendme+Iroh+CTA+Click'>BUILD ON IROH</Button>
</div>
</div>
<div className='mx-5 mb-20 md:mx-0 h-5 border-l border-r' />
</div>
</div>
)
}
2 changes: 1 addition & 1 deletion src/components/icons/Github.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export function GithubIcon(props) {
return (
<svg viewBox="0 0 512 512" aria-hidden="true" {...props}>
<g>
<path clip-rule="evenodd" d="M296.133,354.174c49.885-5.891,102.942-24.029,102.942-110.192 c0-24.49-8.624-44.448-22.67-59.869c2.266-5.89,9.515-28.114-2.734-58.947c0,0-18.139-5.898-60.759,22.669 c-18.139-4.983-38.09-8.163-56.682-8.163c-19.053,0-39.011,3.18-56.697,8.163c-43.082-28.567-61.22-22.669-61.22-22.669 c-12.241,30.833-4.983,53.057-2.718,58.947c-14.061,15.42-22.677,35.379-22.677,59.869c0,86.163,53.057,104.301,102.942,110.192 c-6.344,5.452-12.241,15.873-14.507,30.387c-12.702,5.438-45.808,15.873-65.758-18.592c0,0-11.795-21.31-34.012-22.669 c0,0-22.224-0.453-1.813,13.592c0,0,14.96,6.812,24.943,32.653c0,0,13.6,43.089,76.179,29.48v38.543 c0,5.906-4.53,12.702-15.865,10.89C96.139,438.977,32.2,354.626,32.2,255.77c0-123.807,100.216-224.022,224.03-224.022 c123.347,0,224.023,100.216,223.57,224.022c0,98.856-63.946,182.754-152.828,212.688c-11.342,2.266-15.873-4.53-15.873-10.89 V395.45C311.1,374.577,304.288,360.985,296.133,354.174L296.133,354.174z M512,256.23C512,114.73,397.263,0,256.23,0 C114.73,0,0,114.73,0,256.23C0,397.263,114.73,512,256.23,512C397.263,512,512,397.263,512,256.23L512,256.23z" fill-rule="evenodd"/>
<path clipRule="evenodd" d="M296.133,354.174c49.885-5.891,102.942-24.029,102.942-110.192 c0-24.49-8.624-44.448-22.67-59.869c2.266-5.89,9.515-28.114-2.734-58.947c0,0-18.139-5.898-60.759,22.669 c-18.139-4.983-38.09-8.163-56.682-8.163c-19.053,0-39.011,3.18-56.697,8.163c-43.082-28.567-61.22-22.669-61.22-22.669 c-12.241,30.833-4.983,53.057-2.718,58.947c-14.061,15.42-22.677,35.379-22.677,59.869c0,86.163,53.057,104.301,102.942,110.192 c-6.344,5.452-12.241,15.873-14.507,30.387c-12.702,5.438-45.808,15.873-65.758-18.592c0,0-11.795-21.31-34.012-22.669 c0,0-22.224-0.453-1.813,13.592c0,0,14.96,6.812,24.943,32.653c0,0,13.6,43.089,76.179,29.48v38.543 c0,5.906-4.53,12.702-15.865,10.89C96.139,438.977,32.2,354.626,32.2,255.77c0-123.807,100.216-224.022,224.03-224.022 c123.347,0,224.023,100.216,223.57,224.022c0,98.856-63.946,182.754-152.828,212.688c-11.342,2.266-15.873-4.53-15.873-10.89 V395.45C311.1,374.577,304.288,360.985,296.133,354.174L296.133,354.174z M512,256.23C512,114.73,397.263,0,256.23,0 C114.73,0,0,114.73,0,256.23C0,397.263,114.73,512,256.23,512C397.263,512,512,397.263,512,256.23L512,256.23z" fill-rule="evenodd"/>
</g>
</svg>
)
Expand Down
Binary file added src/fonts/Koulen-Regular.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions src/lib/mdx/recma.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {mdxAnnotations} from 'mdx-annotations';

export const recmaPlugins = [mdxAnnotations.recma];
Loading

0 comments on commit a8520a9

Please sign in to comment.