Skip to content
Snippets Groups Projects
Commit fd2c3260 authored by insert's avatar insert
Browse files

Initial commit.

parent 08589b62
Branches master
No related merge requests found
[submodule "public/api"]
path = public/api
url = https://gitlab.insrt.uk/revolt/api
/// <reference types="next" />
/// <reference types="next/types/global" />
......@@ -8,8 +8,19 @@
"start": "next start"
},
"dependencies": {
"base64-js": "^1.3.1",
"core-js": "^3.6.5",
"mobx": "^4.2.0",
"next": "9.5.2",
"react": "16.13.1",
"react-dom": "16.13.1"
"react": "^16.13.1",
"react-dom": "^16.13.1",
"redoc": "^2.0.0-rc.40",
"sass": "^1.26.10",
"styled-components": "^5.1.1"
},
"devDependencies": {
"@types/base64-js": "^1.3.0",
"@types/react": "^16.9.49",
"typescript": "^4.0.2"
}
}
import '../styles/globals.css'
import '../styles/globals.scss';
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return <Component {...pageProps} />;
}
export default MyApp
export default MyApp;
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default (req, res) => {
res.statusCode = 200
res.json({ name: 'John Doe' })
}
import Head from 'next/head'
import styles from '../styles/Home.module.css'
export default function Home() {
return (
<div className={styles.container}>
<Head>
<title>Create Next App</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<main className={styles.main}>
<h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>
<p className={styles.description}>
Get started by editing{' '}
<code className={styles.code}>pages/index.js</code>
</p>
<div className={styles.grid}>
<a href="https://nextjs.org/docs" className={styles.card}>
<h3>Documentation &rarr;</h3>
<p>Find in-depth information about Next.js features and API.</p>
</a>
<a href="https://nextjs.org/learn" className={styles.card}>
<h3>Learn &rarr;</h3>
<p>Learn about Next.js in an interactive course with quizzes!</p>
</a>
<a
href="https://github.com/vercel/next.js/tree/master/examples"
className={styles.card}
>
<h3>Examples &rarr;</h3>
<p>Discover and deploy boilerplate example Next.js projects.</p>
</a>
<a
href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
>
<h3>Deploy &rarr;</h3>
<p>
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>
<footer className={styles.footer}>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} />
</a>
</footer>
</div>
)
}
import Head from 'next/head';
import { RedocStandalone } from 'redoc';
import { theme } from '../src/theme';
export default function Home() {
return (
<div>
<RedocStandalone
specUrl="/api/0.2.11.yaml"
options={{
theme: {
colors: {
primary: {
main: '#ff4754'
}
},
rightPanel: {
backgroundColor: '#1f1f1f'
}
}
}}
/>
</div>
)
}
Subproject commit 923312bf889e4e824c697eb2955d6bbd87126325
export const theme = {
spacing: {
unit: 5,
sectionHorizontal: ({ spacing }) => spacing.unit * 8,
sectionVertical: ({ spacing }) => spacing.unit * 8,
},
breakpoints: {
small: '50rem',
medium: '75rem',
large: '105rem',
},
colors: {
tonalOffset: 0.3,
primary: {
main: 'red' // FIXME: branding red
//main: '#32329f',
//light: ({ colors }) => lighten(colors.tonalOffset, colors.primary.main),
//dark: ({ colors }) => darken(colors.tonalOffset, colors.primary.main),
//contrastText: ({ colors }) => readableColor(colors.primary.main),
},
success: {
main: '#5dc167',
//light: ({ colors }) => lighten(colors.tonalOffset * 2, colors.success.main),
//dark: ({ colors }) => darken(colors.tonalOffset, colors.success.main),
//contrastText: ({ colors }) => readableColor(colors.success.main),
},
warning: {
main: '#ffa500',
//light: ({ colors }) => lighten(colors.tonalOffset, colors.warning.main),
//dark: ({ colors }) => darken(colors.tonalOffset, colors.warning.main),
contrastText: '#ffffff',
},
error: {
main: '#f44f4c',
//light: ({ colors }) => lighten(colors.tonalOffset, colors.error.main),
//dark: ({ colors }) => darken(colors.tonalOffset, colors.error.main),
//contrastText: ({ colors }) => readableColor(colors.error.main),
},
gray: {
50: '#0A0A0A',
100: '#050505',
},
text: {
primary: '#eee'
//secondary: ({ colors }) => lighten(colors.tonalOffset, colors.text.primary),
},
border: {
dark: 'rgba(0,0,0, 0.1)',
light: '#ffffff',
},
responses: {
success: {
color: ({ colors }) => colors.success.main,
//backgroundColor: ({ colors }) => transparentize(0.93, colors.success.main),
},
error: {
color: ({ colors }) => colors.error.main,
//backgroundColor: ({ colors }) => transparentize(0.93, colors.error.main),
},
redirect: {
color: ({ colors }) => colors.warning.main,
//backgroundColor: ({ colors }) => transparentize(0.9, colors.responses.redirect.color),
},
info: {
color: '#87ceeb',
//backgroundColor: ({ colors }) => transparentize(0.9, colors.responses.info.color),
},
},
http: {
get: '#6bbd5b',
post: '#248fb2',
put: '#9b708b',
options: '#d3ca12',
patch: '#e09d43',
delete: '#e27a7a',
basic: '#999',
link: '#31bbb6',
head: '#c167e4',
},
},
schema: {
/*linesColor: theme =>
lighten(
theme.colors.tonalOffset,
desaturate(theme.colors.tonalOffset, theme.colors.primary.main),
),*/
defaultDetailsWidth: '75%',
typeNameColor: theme => theme.colors.text.secondary,
typeTitleColor: theme => theme.schema.typeNameColor,
requireLabelColor: theme => theme.colors.error.main,
labelsTextSize: '0.9em',
nestingSpacing: '1em',
nestedBackground: '#111',
arrow: {
size: '1.1em',
color: theme => theme.colors.text.secondary,
},
},
typography: {
fontSize: '14px',
lineHeight: '1.5em',
fontWeightRegular: '400',
fontWeightBold: '600',
fontWeightLight: '300',
fontFamily: 'Roboto, sans-serif',
smoothing: 'antialiased',
optimizeSpeed: true,
headings: {
fontFamily: 'Montserrat, sans-serif',
fontWeight: '400',
lineHeight: '1.6em',
},
code: {
fontSize: '13px',
fontFamily: 'Courier, monospace',
lineHeight: ({ typography }) => typography.lineHeight,
fontWeight: ({ typography }) => typography.fontWeightRegular,
color: '#e53935',
backgroundColor: 'rgba(38, 50, 56, 0.05)',
wrap: false,
},
links: {
color: ({ colors }) => colors.primary.main,
visited: ({ typography }) => typography.links.color,
//hover: ({ typography }) => lighten(0.2, typography.links.color),
},
},
sidebar: {
width: '260px',
backgroundColor: '#1f1f1f',
textColor: '#eee',
/*activeTextColor: theme =>
theme.sidebar.textColor !== defaultTheme.sidebar!.textColor
? theme.sidebar.textColor
: theme.colors.primary.main,*/
groupItems: {
textTransform: 'uppercase',
},
level1Items: {
textTransform: 'none',
},
arrow: {
size: '1.5em',
color: theme => theme.sidebar.textColor,
},
},
logo: {
maxHeight: ({ sidebar }) => sidebar.width,
maxWidth: ({ sidebar }) => sidebar.width,
gutter: '2px',
},
rightPanel: {
backgroundColor: '#1f1f1f',
width: '40%',
textColor: '#ffffff',
},
codeBlock: {
//backgroundColor: ({ rightPanel }) => darken(0.1, rightPanel.backgroundColor),
},
};
.container {
min-height: 100vh;
padding: 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.footer {
width: 100%;
height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
}
.footer img {
margin-left: 0.5rem;
}
.footer a {
display: flex;
justify-content: center;
align-items: center;
}
.title a {
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 4rem;
}
.title,
.description {
text-align: center;
}
.description {
line-height: 1.5;
font-size: 1.5rem;
}
.code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
margin-top: 3rem;
}
.card {
margin: 1rem;
flex-basis: 45%;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
}
.card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
}
.card h3 {
margin: 0 0 1rem 0;
font-size: 1.5rem;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
.logo {
height: 1em;
}
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
}
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
html,
body {
padding: 0;
margin: 0;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
.navbar {
//background: #1f1f1f;
//color: white;
padding: 1em;
h1 {
margin: 0;
}
}
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment