use chora web

This commit is contained in:
ryanchristo 2023-11-08 16:35:49 -08:00
parent 2f54c32808
commit e83fdac27c
34 changed files with 25 additions and 338 deletions

View file

@ -1,145 +1,5 @@
@font-face { @import 'chora/styles/main.css';
font-family: 'Ubuntu';
font-style: normal;
font-weight: normal;
src: url('../public/font/Ubuntu-Regular.ttf');
}
@font-face {
font-family: 'Ubuntu';
font-style: italic;
font-weight: normal;
src: url('../public/font/Ubuntu-Italic.ttf');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: bold;
src: url('../public/font/Ubuntu-Bold.ttf');
}
@font-face {
font-family: 'Ubuntu';
font-style: italic;
font-weight: bold;
src: url('../public/font/Ubuntu-BoldItalic.ttf');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 300;
src: url('../public/font/Ubuntu-Light.ttf');
}
@font-face {
font-family: 'Ubuntu';
font-style: italic;
font-weight: 300;
src: url('../public/font/Ubuntu-LightItalic.ttf');
}
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 500;
src: url('../public/font/Ubuntu-Medium.ttf');
}
@font-face {
font-family: 'Ubuntu';
font-style: italic;
font-weight: 500;
src: url('../public/font/Ubuntu-MediumItalic.ttf');
}
:root {
--color-error: rgb(245, 45, 45);
--color-theme: rgb(0, 195, 165);
--font-family: 'Ubuntu', sans-serif;
--footer-height: 320px;
--header-height: 80px;
--sidebar-width: 240px;
--transition: 0.25s;
/* light theme */
--background-primary: rgb(255, 255, 255);
--background-primary-transparent: rgba(255, 255, 255, 0.98);
--background-secondary: rgb(250, 250, 250);
--background-secondary-transparent: rgba(250, 250, 250, 0.98);
--box-shadow: 0 0 4px rgb(245, 245, 245);
--box-shadow-color: rgb(245, 245, 245);
--color-text: rgb(10, 10, 10);
--color-text-placeholder: rgba(10, 10, 10, 0.5);
}
.dark-theme { .dark-theme {
--background-primary: rgb(17, 17, 17); composes: dark-theme from 'chora/styles/main.css';
--background-primary-transparent: rgba(17, 17, 17, 0.98);
--background-secondary: rgb(22, 22, 22);
--background-secondary-transparent: rgba(22, 22, 22, 0.98);
--box-shadow: 0 0 4px rgb(27, 27, 27);
--box-shadow-color: rgb(27, 27, 27);
--color-text: rgb(245, 245, 245);
--color-text-placeholder: rgba(245, 245, 245, 0.5);
}
* {
margin: 0;
padding: 0;
}
html {
cursor: default;
}
body {
font-family: var(--font-family);
font-weight: 300;
overflow-x: hidden;
}
main {
color: var(--color-text);
}
h1,
h2,
h3,
h4,
h5 {
font-weight: 400;
}
p {
line-height: 1.75;
}
a,
a:active {
color: var(--color-theme);
font-weight: 400;
text-decoration: none;
transition: var(--transition);
}
a:hover {
opacity: 0.75;
}
button {
background: var(--color-theme);
border: none;
border-radius: 1em;
color: var(--background-primary);
font-family: var(--font-family);
font-size: 1em;
outline: none;
transition: var(--transition);
}
button:hover {
cursor: pointer;
opacity: 0.75;
} }

View file

@ -1,4 +1,6 @@
import { ThemeContextProvider } from '@contexts/ThemeContext' 'use client'
import { ThemeContextProvider } from 'chora/contexts'
import Footer from '@components/Footer' import Footer from '@components/Footer'
import Header from '@components/Header' import Header from '@components/Header'

BIN
bun.lockb

Binary file not shown.

View file

@ -1,8 +1,8 @@
'use client' 'use client'
import { ThemeContext } from '@contexts/ThemeContext' import { ThemeContext } from 'chora/contexts'
import darkBackground from '../public/images/chora_dark.png' import darkBackground from 'chora/assets/images/chora_dark.png'
import lightBackground from '../public/images/chora_light.png' import lightBackground from 'chora/assets/images/chora_light.png'
import Image from 'next/image' import Image from 'next/image'
import { useContext } from 'react' import { useContext } from 'react'

View file

@ -1,8 +1,8 @@
'use client' 'use client'
import { ThemeContext } from '@contexts/ThemeContext' import { ThemeContext } from 'chora/contexts'
import choraLogoDark from '../public/images/chora_dark_small.png' import choraLogoDark from 'chora/assets//images/chora_dark_small.png'
import choraLogoLight from '../public/images/chora_light_small.png' import choraLogoLight from 'chora/assets//images/chora_light_small.png'
import Image from 'next/image' import Image from 'next/image'
import Link from 'next/link' import Link from 'next/link'
import { useContext } from 'react' import { useContext } from 'react'
@ -14,7 +14,7 @@ const Footer = () => {
return ( return (
<div className={styles.footer}> <div className={styles.footer}>
<div style={{ display: 'none' }}>{darkTheme.toString()}</div> <div style={{ display: 'none' }}>{darkTheme?.toString()}</div>
<div> <div>
<div className={styles.title}> <div className={styles.title}>
<Image alt="chora" src={darkTheme ? choraLogoDark : choraLogoLight} /> <Image alt="chora" src={darkTheme ? choraLogoDark : choraLogoLight} />

View file

@ -16,6 +16,10 @@
margin: 0 1em; margin: 0 1em;
} }
.header button {
background: none;
}
/* title */ /* title */
.title { .title {

View file

@ -1,9 +1,9 @@
'use client' 'use client'
import { ThemeContext } from '@contexts/ThemeContext' import { ThemeContext } from 'chora/contexts'
import choraLogoDark from '../public/images/chora_dark_small.png' import ThemeButton from 'chora/components/ThemeButton'
import choraLogoLight from '../public/images/chora_light_small.png' import choraLogoDark from 'chora/assets/images/chora_dark_small.png'
import ThemeButton from '@components/ThemeButton' import choraLogoLight from 'chora/assets/images/chora_light_small.png'
import Image from 'next/image' import Image from 'next/image'
import Link from 'next/link' import Link from 'next/link'
import { useContext } from 'react' import { useContext } from 'react'
@ -23,7 +23,7 @@ const Header = () => {
return ( return (
<div className={styles.header}> <div className={styles.header}>
<div style={{ display: 'none' }}>{darkTheme.toString()}</div> <div style={{ display: 'none' }}>{darkTheme?.toString()}</div>
<div> <div>
<div className={styles.title}> <div className={styles.title}>
<Link href="/"> <Link href="/">

View file

@ -1,8 +0,0 @@
.button {
align-items: center;
background: none;
display: inline-flex;
height: var(--header-height);
margin: 0;
padding: 0;
}

View file

@ -1,19 +0,0 @@
import * as React from 'react'
import styles from './ThemeButton.module.css'
const ThemeButton = ({ darkTheme, toggleTheme }: any) => (
<button className={styles.button} onClick={toggleTheme}>
<svg
xmlns="http://www.w3.org/2000/svg"
height="1.5em"
width="1.5em"
viewBox="0 0 100 100"
>
<circle cx="50" cy="50" r="40" fill={darkTheme ? '#F5F5F5' : '#0A0A0A'} />
<circle cx="60" cy="50" r="35" fill={darkTheme ? '#111111' : '#FFFFFF'} />
</svg>
</button>
)
export default ThemeButton

View file

@ -1,56 +0,0 @@
'use client'
import * as React from 'react'
import { createContext, useEffect, useState } from 'react'
export const cachedDarkKey = 'chora-web-dark'
const initDarkTheme = () => {
let initDarkTheme = false
if (
typeof localStorage !== 'undefined' &&
localStorage.getItem(cachedDarkKey)
) {
initDarkTheme = localStorage.getItem(cachedDarkKey) === 'true'
} else if (typeof window !== 'undefined') {
initDarkTheme = window.matchMedia('(prefers-color-scheme: dark)').matches
}
return initDarkTheme
}
const ThemeContext = createContext<any>({})
const ThemeContextProvider = (props: any) => {
const [darkTheme, setDarkTheme] = useState<boolean>(initDarkTheme())
useEffect(() => {
if (typeof window !== 'undefined' && typeof localStorage !== 'undefined') {
const root = window.document.documentElement
if (darkTheme) {
root.classList.add('dark-theme')
root.style.backgroundColor = '#161616' // --background-secondary (dark-theme)
} else {
root.classList.remove('dark-theme')
root.style.backgroundColor = '#FAFAFA' // --background-secondary (light-theme)
}
localStorage.setItem(cachedDarkKey, darkTheme ? 'true' : 'false')
}
}, [darkTheme])
return (
<ThemeContext.Provider
value={{
darkTheme,
setDarkTheme,
}}
>
{props.children}
</ThemeContext.Provider>
)
}
export { ThemeContext, ThemeContextProvider }

View file

@ -20,6 +20,8 @@
"clean": "rm -rf .next dist node_modules" "clean": "rm -rf .next dist node_modules"
}, },
"dependencies": { "dependencies": {
"chora": "npm:@chora-io/chora@v0.1.0-alpha2",
"cosmos": "npm:@chora-io/cosmos@v0.1.0-alpha2",
"next": "^14", "next": "^14",
"react": "^18", "react": "^18",
"react-dom": "^18" "react-dom": "^18"

View file

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Before After
Before After

View file

@ -1,96 +0,0 @@
-------------------------------
UBUNTU FONT LICENCE Version 1.0
-------------------------------
PREAMBLE
This licence allows the licensed fonts to be used, studied, modified and
redistributed freely. The fonts, including any derivative works, can be
bundled, embedded, and redistributed provided the terms of this licence
are met. The fonts and derivatives, however, cannot be released under
any other licence. The requirement for fonts to remain under this
licence does not require any document created using the fonts or their
derivatives to be published under this licence, as long as the primary
purpose of the document is not to be a vehicle for the distribution of
the fonts.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this licence and clearly marked as such. This may
include source files, build scripts and documentation.
"Original Version" refers to the collection of Font Software components
as received under this licence.
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to
a new environment.
"Copyright Holder(s)" refers to all individuals and companies who have a
copyright ownership of the Font Software.
"Substantially Changed" refers to Modified Versions which can be easily
identified as dissimilar to the Font Software by users of the Font
Software comparing the Original Version with the Modified Version.
To "Propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification and with or without charging
a redistribution fee), making available to the public, and in some
countries other activities as well.
PERMISSION & CONDITIONS
This licence does not grant any rights under trademark law and all such
rights are reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of the Font Software, to propagate the Font Software, subject to
the below conditions:
1) Each copy of the Font Software must contain the above copyright
notice and this licence. These can be included either as stand-alone
text files, human-readable headers or in the appropriate machine-
readable metadata fields within text or binary files as long as those
fields can be easily viewed by the user.
2) The font name complies with the following:
(a) The Original Version must retain its name, unmodified.
(b) Modified Versions which are Substantially Changed must be renamed to
avoid use of the name of the Original Version or similar names entirely.
(c) Modified Versions which are not Substantially Changed must be
renamed to both (i) retain the name of the Original Version and (ii) add
additional naming elements to distinguish the Modified Version from the
Original Version. The name of such Modified Versions must be the name of
the Original Version, with "derivative X" where X represents the name of
the new work, appended to that name.
3) The name(s) of the Copyright Holder(s) and any contributor to the
Font Software shall not be used to promote, endorse or advertise any
Modified Version, except (i) as required by this licence, (ii) to
acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with
their explicit written permission.
4) The Font Software, modified or unmodified, in part or in whole, must
be distributed entirely under this licence, and must not be distributed
under any other licence. The requirement for fonts to remain under this
licence does not affect any document created using the Font Software,
except any version of the Font Software extracted from a document
created using the Font Software may only be distributed under this
licence.
TERMINATION
This licence becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

View file

@ -1,3 +1,3 @@
module.exports = { module.exports = {
content: ['./app/**/*.{js,ts,jsx,tsx}'], content: ['./app/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
} }

View file

@ -20,9 +20,7 @@
} }
], ],
"paths": { "paths": {
"@components/*": ["components/*"], "@components/*": ["components/*"]
"@contexts/*": ["contexts/*"],
"@hooks/*": ["hooks/*"]
} }
}, },
"include": [ "include": [