浏览代码

Adds sponsor page

main
Steve Ruiz 4 年前
父节点
当前提交
2b88b7114b
共有 4 个文件被更改,包括 86 次插入13 次删除
  1. 0
    1
      pages/api/auth/[...nextauth].ts
  2. 85
    12
      pages/sponsorware.tsx
  3. 二进制
      public/images/hello.mp4
  4. 1
    0
      styles/stitches.config.ts

+ 0
- 1
pages/api/auth/[...nextauth].ts 查看文件

@@ -1,6 +1,5 @@
1 1
 import { NextApiRequest, NextApiResponse } from 'next'
2 2
 import NextAuth from 'next-auth'
3
-import { signin } from 'next-auth/client'
4 3
 import Providers from 'next-auth/providers'
5 4
 
6 5
 export default function (req: NextApiRequest, res: NextApiResponse) {

+ 85
- 12
pages/sponsorware.tsx 查看文件

@@ -1,16 +1,89 @@
1
+import styled from 'styles'
2
+import { signin, signout, useSession } from 'next-auth/client'
3
+
1 4
 export default function Sponsorware() {
5
+  const [session, loading] = useSession()
6
+
2 7
   return (
3
-    <div>
4
-      Hey, this site is for sponsors only for the moment. Sorry! If you're
5
-      really curious,{' '}
6
-      <a
7
-        href="https://github.com/sponsors/steveruizok"
8
-        target="_blank"
9
-        rel="noopener noreferrer"
10
-      >
11
-        Sponsor me on Github
12
-      </a>{' '}
13
-      and try that again.
14
-    </div>
8
+    <Content>
9
+      <h1>tldraw is sponsorware</h1>
10
+      <video src="images/hello.mp4" autoPlay muted loop />
11
+      <p>
12
+        Hey, thanks for visiting <a href="https://tldraw.com/">tldraw</a>, a
13
+        tiny little drawing app by{' '}
14
+        <a href="https://twitter.com/steveruizok">steveruizok</a>.
15
+      </p>
16
+      <p>
17
+        {' '}
18
+        This project is currently:{' '}
19
+        <ul>
20
+          <li>in development</li>
21
+          <li>only available for my sponsors</li>
22
+        </ul>
23
+      </p>
24
+      <p>
25
+        If you'd like to try it out,{' '}
26
+        <a
27
+          href="https://github.com/sponsors/steveruizok"
28
+          target="_blank"
29
+          rel="noopener noreferrer"
30
+        >
31
+          sponsor me on Github
32
+        </a>{' '}
33
+        (at $1 or more) and sign in below.
34
+      </p>
35
+      <Button onClick={() => signin('github')}>Sign in With Github</Button>
36
+      <button onClick={() => signout()}>Sign Out</button>
37
+      <pre>{JSON.stringify(session, null, 2)}</pre>
38
+    </Content>
15 39
   )
16 40
 }
41
+
42
+const Content = styled('div', {
43
+  width: '720px',
44
+  maxWidth: 'calc(100% - 16px)',
45
+  backgroundColor: '$panel',
46
+  margin: '72px auto',
47
+  borderRadius: '4px',
48
+  boxShadow: '0px 2px 4px rgba(0,0,0,.2)',
49
+  padding: '16px',
50
+  overflow: 'hidden',
51
+  color: '$text',
52
+
53
+  '& a': {
54
+    color: '$bounds',
55
+    backgroundColor: '$boundsBg',
56
+    padding: '2px 4px',
57
+    margin: '0 -3px',
58
+    borderRadius: '2px',
59
+  },
60
+
61
+  '& p': {
62
+    fontFamily: '$body',
63
+    fontSize: '$3',
64
+    lineHeight: 1.5,
65
+  },
66
+
67
+  '& video': {
68
+    maxWidth: '100%',
69
+    boxShadow: '0px 2px 4px rgba(0,0,0,.2)',
70
+    borderRadius: '4px',
71
+    overflow: 'hidden',
72
+    margin: '16px 0',
73
+  },
74
+})
75
+
76
+const Button = styled('button', {
77
+  width: '100%',
78
+  padding: '12px 0',
79
+  display: 'flex',
80
+  alignItems: 'center',
81
+  justifyContent: 'center',
82
+  font: '$ui',
83
+  fontWeight: 'bold',
84
+  fontSize: '$3',
85
+  background: '$bounds',
86
+  color: '$panel',
87
+  border: 'none',
88
+  margin: '32px 0 8px 0',
89
+})

二进制
public/images/hello.mp4 查看文件


+ 1
- 0
styles/stitches.config.ts 查看文件

@@ -12,6 +12,7 @@ const { styled, global, css, theme, getCssString } = createCss({
12 12
       selected: 'rgba(66, 133, 244, 1.000)',
13 13
       bounds: 'rgba(65, 132, 244, 1.000)',
14 14
       boundsBg: 'rgba(65, 132, 244, 0.05)',
15
+      highlight: 'rgba(65, 132, 244, 0.15)',
15 16
       overlay: 'rgba(0, 0, 0, 0.15)',
16 17
       border: '#aaa',
17 18
       canvas: '#fafafa',

正在加载...
取消
保存