Styling of home

This commit is contained in:
Sebastian Seedorf
2022-08-22 17:04:39 +02:00
parent 537a18fb88
commit d964748a66
55 changed files with 1791 additions and 341 deletions

View File

@@ -2,7 +2,7 @@
"plugins": ["unused-imports", "@typescript-eslint"],
"extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
"parserOptions": {
"project": ["./tsconfig.json", "./tsconfig.test.json"],
"project": ["./tsconfig.json", "./tsconfig.test.json", "./tsconfig.node.json"],
"extraFileExtensions": [".json"]
},
"rules": {

View File

@@ -6,6 +6,7 @@
<entryData>
<resourceRoots>
<path value="file://$PROJECT_DIR$/res" />
<path value="file://$PROJECT_DIR$/public" />
</resourceRoots>
</entryData>
</entry>

View File

@@ -1,4 +1,5 @@
{
"plugins": ["stylelint-use-logical"],
"extends": ["stylelint-config-standard", "stylelint-config-idiomatic-order"],
"rules": {
"selector-pseudo-class-no-unknown": [
@@ -12,6 +13,7 @@
"declaration-block-no-duplicate-properties": true,
"no-duplicate-selectors": true,
"selector-class-pattern": "^.*|([a-z][a-zA-Z0-9]+)$",
"custom-property-pattern": ".*"
"custom-property-pattern": ".*",
"csstools/use-logical": "always"
}
}

View File

@@ -1,35 +1,39 @@
.span {
background: lightgray;
font-size: 1em;
border: 1px solid white;
display: inline-block;
position: relative;
padding-inline: 0.2em;
display: inline-block;
border: 1px solid var(--md-sys-color-outline);
background: var(--md-sys-color-surface-variant);
border-radius: 4px;
color: var(--md-sys-color-on-surface-variant);
font-size: 1em;
padding-inline: 0.2em;
}
.spanSimple {
padding-inline-start: 0.2em;
position: relative;
display: inline-block;
padding-inline-start: 0.2em;
}
.tooltip {
--background: lightsalmon;
--arrow-width: 0.6em;
--arrow-height: 0.4em;
display: none;
--background: var(--md-sys-color-primary-container);
position: absolute;
left: calc(100% + var(--arrow-width));
top: -5000%;
bottom: -5000%;
margin: auto 0;
z-index: 1;
display: none;
width: max-content;
height: max-content;
background: var(--background);
padding: 0.5em;
margin: auto 0;
background: var(--background);
border-radius: 0.7em;
z-index: 1;
box-shadow: 0 0 6px 1px var(--md-sys-color-shadow);
color: var(--md-sys-color-on-primary-container);
inset-block: -5000%;
inset-inline-start: calc(100% + var(--arrow-width));
--arrow-width: 0.6em;
--arrow-height: 0.4em;
}
.span:is(:focus, :hover) > .tooltip {
@@ -37,16 +41,15 @@
}
.tooltip::before {
content: "";
border-style: solid;
top: 0;
bottom: 0;
margin: auto 0;
position: absolute;
height: max-content;
border-width: var(--arrow-height) var(--arrow-width) var(--arrow-height) 0;
border-style: solid;
border-color: transparent var(--background) transparent transparent;
position: absolute;
left: calc(var(--arrow-width) * -1 + 1px);
margin: auto 0;
content: "";
inset-block: 0;
inset-inline-start: calc(var(--arrow-width) * -1 + 1px);
}
.img {
@@ -58,11 +61,11 @@
}
.base {
color: darkgreen;
color: var(--md-sys-color-tertiary);
}
.produced {
color: darkgoldenrod;
color: var(--md-ref-palette-primary70);
}
.unknown {
@@ -89,32 +92,9 @@
.rightClick {
height: 1em;
transform: scaleX(-1) translateY(0.1em);
transform: scaleX(-1) translateY(0.1em) !important;
}
.clickBtn {
fill: red;
}
@media (prefers-color-scheme: dark) {
.span {
border-color: #111111;
background-color: #444;
}
.base {
color: lightgreen;
}
.produced {
color: lightsalmon;
}
.unknown {
color: lightgray;
}
.tooltip {
--background: darkred;
}
}

View File

@@ -1,24 +1,53 @@
.root {
position: relative;
border: 2px solid black;
padding: 1em 0.5em;
border: 1px solid var(--md-sys-color-outline);
background-color: var(--md-sys-color-surface);
border-radius: 4px;
}
.heading {
display: inline-block;
margin-block-start: 0;
}
.heading:not(:focus-visible)::after {
display: inline-block;
width: 1em;
height: 1em;
background-color: var(--md-sys-color-on-background);
content: "";
mask: url("/factorio/pencil.svg") no-repeat 50% 50%;
opacity: 0.8;
padding-inline-start: 0.5em;
}
.quit {
--color: darkred;
--color: var(--md-sys-color-error);
position: absolute;
right: 1em;
top: 1em;
border-radius: 999999px;
background: transparent;
border: 1px solid var(--color);
background: transparent;
border-radius: 999999px;
color: var(--color);
font-weight: 700;
font-weight: 500;
inset-block-start: 1em;
inset-inline-end: 1em;
}
.quit:is(:focus, :hover) {
--color: red;
filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.5));
--color: var(--md-ref-palette-error60);
filter: drop-shadow(0 0 2px var(--md-ref-palette-neutral-variant70));
}
.label {
display: block;
}
.marginTop {
display: block;
margin-block-start: 1em;
}
.flex {
@@ -30,18 +59,3 @@
.flex > * {
width: max-content;
}
@media (prefers-color-scheme: dark) {
.root {
border-color: gray;
}
.quit {
--color: indianred;
}
.quit:is(:focus, :hover) {
--color: red;
filter: drop-shadow(0px 0px 2px rgba(255, 255, 255, 0.5));
}
}

View File

@@ -5,13 +5,14 @@ import styles from './GroupBox.module.css'
import { EntitySpan } from '../EntitySpan/EntitySpan'
import { useGroups } from '../../contexts/GroupProvider'
import { calculateInputs } from '../../../src/calculateInputs'
import { fixedEncodeURIComponent, uniquify } from '../../../src/utils'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { uniquify } from '../../../src/utils'
import { useFactories } from '../../contexts/FactoryProvider'
import { i18n, I18n } from '../../shared/I18n/I18n'
import { useIntl } from 'react-intl'
import { GraphIcon } from '../../icons/GraphIcon'
import { ButtonVisualize } from '../../shared/ButtonVisualize/ButtonVisualize'
import { Heading } from '../../shared/Heading'
import typography from '../../../styles/typography.module.css'
import cx from 'classnames'
interface Props {
group: Group
@@ -19,7 +20,6 @@ interface Props {
const GroupBoxBase: FC<Props> = ({ group }) => {
const intl = useIntl()
const { query } = useRouter()
const { factories, findFactory } = useFactories()
const {
doNotSuggest,
@@ -33,6 +33,7 @@ const GroupBoxBase: FC<Props> = ({ group }) => {
getInputType
} = useGroups()
const { name, exports, malls } = group
const nameForId = useMemo(() => name.replace(/[^a-z\d_-]/gi, ''), [name])
const [isDeleteConfirm, setDeleteConfirm] = useState(false)
@@ -79,26 +80,30 @@ const GroupBoxBase: FC<Props> = ({ group }) => {
return (
<div className={styles.root}>
<h3
<ButtonVisualize groupId={group.name} />
<Heading
type={'subsection'}
className={styles.heading}
contentEditable={true}
suppressContentEditableWarning={true}
onBlur={event => {
event.currentTarget.innerText = event.currentTarget.innerText.trim()
renameGroup(name, event.currentTarget.innerText)
}}
>
{name}
</h3>
<Link
href={{
pathname: `/visualize/${fixedEncodeURIComponent(group.name)}`,
query
onKeyDown={event => {
if (event.key === 'Enter') {
event.preventDefault()
event.currentTarget.blur()
}
if (event.key === 'Escape') {
event.preventDefault()
event.currentTarget.innerText = name
event.currentTarget.blur()
}
}}
>
<a>
<GraphIcon />
</a>
</Link>
{name}
</Heading>
<button
className={styles.quit}
onBlur={() => setDeleteConfirm(false)}
@@ -107,23 +112,31 @@ const GroupBoxBase: FC<Props> = ({ group }) => {
>
{isDeleteConfirm ? i18n(intl, 'page.home.group.delete.confirmation') : 'X'}
</button>
<h4>
<I18n id={'page.home.group.item.export'} />
</h4>
<FactorySelect
id={name + '-exports'}
factories={exports}
onSetFactories={setExportFactories}
/>
<h4>
<I18n id={'page.home.group.item.mall'} />
</h4>
<FactorySelect id={name + '-malls'} factories={malls} onSetFactories={setMallFactories} />
<label htmlFor={nameForId + '-exports'} className={styles.label}>
<span className={typography.titleMedium}>
<I18n id={'page.home.group.item.export'} />
</span>
<FactorySelect
id={nameForId + '-exports'}
factories={exports}
onSetFactories={setExportFactories}
/>
</label>
<label htmlFor={nameForId + '-exports'} className={cx(styles.label, styles.marginTop)}>
<span className={typography.titleMedium}>
<I18n id={'page.home.group.item.mall'} />
</span>
<FactorySelect
id={nameForId + '-malls'}
factories={malls}
onSetFactories={setMallFactories}
/>
</label>
{inputs.length ? (
<>
<h4>
<span className={cx(typography.titleMedium, styles.marginTop)}>
<I18n id={'page.home.group.item.input'} values={{ amount: inputs.length }} />
</h4>
</span>
<div className={styles.flex}>
{inputs.map(input => (
<EntitySpan
@@ -142,12 +155,12 @@ const GroupBoxBase: FC<Props> = ({ group }) => {
) : null}
{intermediates.length ? (
<>
<h4>
<span className={cx(typography.titleMedium, styles.marginTop)}>
<I18n
id={'page.home.group.item.intermediate'}
values={{ amount: intermediates.length }}
/>
</h4>
</span>
<div className={styles.flex}>
{intermediates.map(intermediate => (
<EntitySpan
@@ -161,9 +174,9 @@ const GroupBoxBase: FC<Props> = ({ group }) => {
) : null}
{suggestionsExport.length ? (
<>
<h4>
<span className={cx(typography.titleMedium, styles.marginTop)}>
<I18n id={'page.home.group.item.suggestion.export'} />
</h4>
</span>
<div className={styles.flex}>
{suggestionsExport.map(suggestion => (
<EntitySpan
@@ -183,9 +196,9 @@ const GroupBoxBase: FC<Props> = ({ group }) => {
) : null}
{suggestionMall.length ? (
<>
<h4>
<span className={cx(typography.titleMedium, styles.marginTop)}>
<I18n id={'page.home.group.item.suggestion.mall'} />
</h4>
</span>
<div className={styles.flex}>
{suggestionMall.map(suggestion => (
<EntitySpan

View File

@@ -1,17 +1,17 @@
.content {
max-width: 80ch;
margin: 0 auto;
text-align: justify;
}
.grid {
display: grid;
margin-top: 2em;
gap: 1em;
grid-template-columns: repeat(auto-fit, minmax(450px, max-content));
margin-block-start: -2em;
}
.missingFactories {
display: flex;
flex-wrap: wrap;
gap: 0.1em;
}
.missingFactories > * {
.entitySpanList > * {
width: max-content;
}

View File

@@ -1,125 +1,38 @@
import { ElementRef, FC, useMemo, useRef } from 'react'
import { FC } from 'react'
import { GroupBox } from './GroupBox/GroupBox'
import styles from './Home.module.css'
import { EnrichedEntity } from '../../src/types'
import { EntitySpan } from './EntitySpan/EntitySpan'
import { useGroups } from '../contexts/GroupProvider'
import { Preferences } from './Preferences/Preferences'
import { download, streamToArrayBuffer } from '../../src/download'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { i18n, I18n } from '../shared/I18n/I18n'
import { useFactories } from '../contexts/FactoryProvider'
import { GraphIcon } from '../icons/GraphIcon'
import { useIntl } from 'react-intl'
import { SectionPreferences } from './SectionPreferences/SectionPreferences'
import { I18n } from '../shared/I18n/I18n'
import { Heading } from '../shared/Heading'
import { Paragraph } from '../shared/Paragraph/Paragraph'
import { Section } from '../shared/Section/Section'
import { SectionAddMissing } from './SectionAddMissing/SectionAddMissing'
import { SectionShare } from './SectionShare/SectionShare'
import { ButtonVisualize } from '../shared/ButtonVisualize/ButtonVisualize'
export const Home: FC = () => {
const intl = useIntl()
const { query } = useRouter()
const { factories } = useFactories()
const preferencesRef = useRef<ElementRef<typeof Preferences>>(null)
const { groups, doNotSuggest, ignoredFactories, setIgnoredFactories, store, load } = useGroups()
const inputRef = useRef<HTMLInputElement>(null)
const [missingExport, missingMall] = useMemo<[EnrichedEntity[], EnrichedEntity[]]>(() => {
return factories
.filter(factory => !doNotSuggest.has(factory.href) && factory.recipe)
.reduce(
(acc, factory) =>
(factory.usedBy?.length ?? 0) >= 3
? [[...acc[0], factory], acc[1]]
: [acc[0], [...acc[1], factory]],
[[], []] as [EnrichedEntity[], EnrichedEntity[]]
)
}, [factories, doNotSuggest])
const { groups } = useGroups()
return (
<main>
<h1>
<I18n id={'page.home.title'} />
</h1>
<p>
<I18n id={'page.home.description'} />
</p>
<button
onClick={() => {
download('factorio-microservices.bin', store())
}}
>
<I18n id={'page.home.pref.download'} />
</button>
<input
type={'file'}
multiple={false}
ref={inputRef}
onChange={async evt => {
const stream = evt.currentTarget.files?.[0].stream() as
| globalThis.ReadableStream<Uint8Array>
| undefined
if (stream) {
const array = await streamToArrayBuffer(stream)
load(array)
if (inputRef.current) inputRef.current.value = null as unknown as string
}
}}
/>
<Link href={{ pathname: '/visualize', query }}>
<a>
<I18n id={'page.home.pref.visualize'} />
<GraphIcon />
</a>
</Link>
<Preferences ref={preferencesRef} />
<fieldset>
<legend>
<I18n id={'page.home.group.missing.export.title'} />
</legend>
<span>
<I18n id={'page.home.group.missing.export.description'} />
</span>
<div className={styles.missingFactories}>
{missingExport.map(missing => (
<EntitySpan
key={missing.href}
value={missing}
onClick={() => {
preferencesRef.current?.addGroup(missing.name, [missing.href])
}}
onContextMenu={event => {
event.preventDefault()
setIgnoredFactories([...ignoredFactories, missing.href])
}}
leftClickText={i18n(intl, 'page.home.tooltip.action.add_to_new_export')}
rightClickText={i18n(intl, 'page.home.tooltip.action.exclude_suggestion')}
/>
))}
</div>
</fieldset>
<fieldset>
<legend>
<I18n id={'page.home.group.missing.mall.title'} />
</legend>
<span>
<I18n id={'page.home.group.missing.mall.description'} />
</span>
<div className={styles.missingFactories}>
{missingMall.map(missing => (
<EntitySpan
key={missing.href}
value={missing}
onClick={() => {
preferencesRef.current?.addGroup(missing.name, undefined, [missing.href])
}}
onContextMenu={event => {
event.preventDefault()
setIgnoredFactories([...ignoredFactories, missing.href])
}}
leftClickText={i18n(intl, 'page.home.tooltip.action.add_to_new_mall')}
rightClickText={i18n(intl, 'page.home.tooltip.action.exclude_suggestion')}
/>
))}
</div>
</fieldset>
<Section>
<Heading type={'pageTitle'}>
<I18n id={'page.home.title'} />
</Heading>
<Paragraph size={'large'}>
<I18n id={'page.home.description'} />
</Paragraph>
</Section>
<SectionShare />
<SectionPreferences />
<SectionAddMissing />
<Section>
<Heading type={'section'}>
<I18n id={'page.home.group.title'} />
<ButtonVisualize large={true} />
</Heading>
</Section>
<div className={styles.grid}>
{Object.values(groups)
.sort((a, b) => a.name.localeCompare(b.name))

View File

@@ -1,74 +0,0 @@
import { forwardRef, ForwardRefRenderFunction, useImperativeHandle, useState } from 'react'
import { FactorySelect } from '../FactorySelect/FactorySelect'
import { useGroups } from '../../contexts/GroupProvider'
import { i18n, I18n } from '../../shared/I18n/I18n'
import { useIntl } from 'react-intl'
interface Handle {
addGroup(preferredName: string, exported?: string[], mall?: string[]): boolean
}
const PreferencesBase: ForwardRefRenderFunction<Handle> = (_, forwardedRef) => {
const intl = useIntl()
const DEFAULT_NAME = i18n(intl, 'page.home.group.add.default_group_name')
useImperativeHandle(forwardedRef, () => ({
addGroup(preferredName: string, exported?: string[], mall?: string[]) {
const name = newGroupValue !== DEFAULT_NAME ? newGroupValue : preferredName
const result = addGroup(name, exported, mall)
result && setNewGroupValue(DEFAULT_NAME)
return result
}
}))
const { addGroup, baseFactories, setBaseFactories, ignoredFactories, setIgnoredFactories } =
useGroups()
const [newGroupValue, setNewGroupValue] = useState(DEFAULT_NAME)
return (
<>
<fieldset>
<legend>
<I18n id={'page.home.pref.basic.title'} />
</legend>
<span>
<I18n id={'page.home.pref.basic.description'} />
</span>
<FactorySelect
id={'baseFactoriesSelect'}
factories={baseFactories}
onSetFactories={setBaseFactories}
fixInputs={true}
/>
</fieldset>
<fieldset>
<legend>
<I18n id={'page.home.pref.ignored.title'} />
</legend>
<span>
<I18n id={'page.home.pref.ignored.description'} />
</span>
<FactorySelect
id={'ignoredFactoriesSelect'}
factories={ignoredFactories}
onSetFactories={setIgnoredFactories}
/>
</fieldset>
<fieldset>
<legend>
<I18n id={'page.home.group.add.title'} />
</legend>
<input value={newGroupValue} onChange={e => setNewGroupValue(e.target.value)} />
<button
disabled={!newGroupValue}
onClick={() => {
addGroup(newGroupValue)
setNewGroupValue(DEFAULT_NAME)
}}
>
<I18n id={'page.home.group.add.button_text'} values={{ name: newGroupValue }} />
</button>
</fieldset>
</>
)
}
export const Preferences = forwardRef(PreferencesBase)

View File

@@ -2,6 +2,7 @@ import { FC } from 'react'
import { Recipe } from '../../../src/types'
import { EntityIcon } from '../EntityIcon/EntityIcon'
import styles from './Recipe.module.css'
import { I18n } from '../../shared/I18n/I18n'
interface Props {
recipe: Recipe
@@ -23,7 +24,8 @@ export const RecipeSpan: FC<Props> = ({ recipe }) => {
const after = Object.entries({ ...recipe.output }).map(toEntityIcon)
return (
<span className={styles.recipe}>
{joinByPlus([toEntityIcon(['/Time', recipe.time]), ...before])} {joinByPlus(after)}
{joinByPlus([toEntityIcon(['/Time', recipe.time]), ...before])}{' '}
<I18n id={'component.recipe.arrow'} /> {joinByPlus(after)}
</span>
)
}

View File

@@ -0,0 +1,9 @@
.addBtn {
margin-inline: 1em;
}
.entitySpanList {
display: flex;
flex-wrap: wrap;
gap: 0.1em;
}

View File

@@ -0,0 +1,123 @@
import { FC, useCallback, useMemo, useState } from 'react'
import { Heading } from '../../shared/Heading'
import { i18n, I18n } from '../../shared/I18n/I18n'
import { Paragraph } from '../../shared/Paragraph/Paragraph'
import styles from './SectionAddMissing.module.css'
import { EntitySpan } from '../EntitySpan/EntitySpan'
import { Section } from '../../shared/Section/Section'
import { EnrichedEntity } from '../../../src/types'
import { useFactories } from '../../contexts/FactoryProvider'
import { useGroups } from '../../contexts/GroupProvider'
import { useIntl } from 'react-intl'
import { Input } from '../../shared/Input/Input'
import { Button } from '../../shared/Button/Button'
export const SectionAddMissing: FC = () => {
const intl = useIntl()
const DEFAULT_NAME = useMemo(() => i18n(intl, 'page.home.group.add.default_group_name'), [intl])
const { factories } = useFactories()
const { addGroup: addGroupCtx, doNotSuggest, ignoredFactories, setIgnoredFactories } = useGroups()
const [newGroupValue, setNewGroupValue] = useState(DEFAULT_NAME)
const addGroup = useCallback(
(preferredName: string, exported?: string[], mall?: string[]) => {
const name = newGroupValue !== DEFAULT_NAME ? newGroupValue : preferredName
const result = addGroupCtx(name, exported, mall)
result && setNewGroupValue(DEFAULT_NAME)
return result
},
[DEFAULT_NAME, addGroupCtx, newGroupValue]
)
const [missingExport, missingMall] = useMemo<[EnrichedEntity[], EnrichedEntity[]]>(() => {
return factories
.filter(factory => !doNotSuggest.has(factory.href) && factory.recipe)
.reduce(
(acc, factory) =>
(factory.usedBy?.length ?? 0) >= 3
? [[...acc[0], factory], acc[1]]
: [acc[0], [...acc[1], factory]],
[[], []] as [EnrichedEntity[], EnrichedEntity[]]
)
}, [factories, doNotSuggest])
return (
<Section color={'secondary'}>
<Heading type={'section'}>
<I18n id={'page.home.group.add.title'} />
</Heading>
<Input value={newGroupValue} onChange={e => setNewGroupValue(e.target.value)} />
<Button
className={styles.addBtn}
disabled={!newGroupValue}
onClick={() => {
addGroup(newGroupValue)
setNewGroupValue(DEFAULT_NAME)
}}
>
<I18n id={'page.home.group.add.button_text'} values={{ name: newGroupValue }} />
</Button>
<Heading type={'subsection'}>
<I18n id={'page.home.group.missing.export.title'} />
</Heading>
<Paragraph size={'subtitle'}>
<I18n id={'page.home.group.missing.export.description'} />
</Paragraph>
{missingExport.length ? (
<div className={styles.entitySpanList}>
{missingExport.map(missing => (
<EntitySpan
key={missing.href}
value={missing}
onClick={() => {
addGroup(missing.name, [missing.href])
}}
onContextMenu={event => {
event.preventDefault()
setIgnoredFactories([...ignoredFactories, missing.href])
}}
leftClickText={i18n(intl, 'page.home.tooltip.action.add_to_new_export')}
rightClickText={i18n(intl, 'page.home.tooltip.action.exclude_suggestion')}
/>
))}
</div>
) : (
<Paragraph size={'medium'}>
<em>
<I18n id={'page.home.group.missing.none'} />
</em>
</Paragraph>
)}
<Heading type={'subsection'}>
<I18n id={'page.home.group.missing.mall.title'} />
</Heading>
<Paragraph size={'subtitle'}>
<I18n id={'page.home.group.missing.mall.description'} />
</Paragraph>
{missingMall.length ? (
<div className={styles.entitySpanList}>
{missingMall.map(missing => (
<EntitySpan
key={missing.href}
value={missing}
onClick={() => {
addGroup(missing.name, undefined, [missing.href])
}}
onContextMenu={event => {
event.preventDefault()
setIgnoredFactories([...ignoredFactories, missing.href])
}}
leftClickText={i18n(intl, 'page.home.tooltip.action.add_to_new_mall')}
rightClickText={i18n(intl, 'page.home.tooltip.action.exclude_suggestion')}
/>
))}
</div>
) : (
<Paragraph size={'medium'}>
<em>
<I18n id={'page.home.group.missing.none'} />
</em>
</Paragraph>
)}
</Section>
)
}

View File

@@ -0,0 +1,3 @@
.margin-top {
margin-block-start: 2em;
}

View File

@@ -0,0 +1,45 @@
import { FC } from 'react'
import { FactorySelect } from '../FactorySelect/FactorySelect'
import { useGroups } from '../../contexts/GroupProvider'
import { I18n } from '../../shared/I18n/I18n'
import { Section } from '../../shared/Section/Section'
import { Heading } from '../../shared/Heading'
import { Paragraph } from '../../shared/Paragraph/Paragraph'
import { Collapsible } from '../../shared/Collapsible/Collapsible'
import styles from './SectionPreferences.module.css'
export const SectionPreferences: FC = () => {
const { baseFactories, setBaseFactories, ignoredFactories, setIgnoredFactories } = useGroups()
return (
<Section>
<Collapsible id={'collapseBase'}>
<Heading type={'section'}>
<I18n id={'page.home.pref.basic.title'} />
</Heading>
<Paragraph size={'subtitle'}>
<I18n id={'page.home.pref.basic.description'} />
</Paragraph>
<FactorySelect
id={'baseFactoriesSelect'}
factories={baseFactories}
onSetFactories={setBaseFactories}
fixInputs={true}
/>
</Collapsible>
<Collapsible id={'collapseIgnored'} className={styles.marginTop}>
<Heading type={'section'}>
<I18n id={'page.home.pref.ignored.title'} />
</Heading>
<Paragraph size={'subtitle'}>
<I18n id={'page.home.pref.ignored.description'} />
</Paragraph>
<FactorySelect
id={'ignoredFactoriesSelect'}
factories={ignoredFactories}
onSetFactories={setIgnoredFactories}
/>
</Collapsible>
</Section>
)
}

View File

@@ -0,0 +1,30 @@
.shareGrid {
display: grid;
gap: 3em;
grid-template-columns: repeat(auto-fit, minmax(30ch, 1fr));
}
.downloadBtn {
width: 100%;
}
.uploadInput {
display: inline-block;
width: 100%;
padding: 2em 0.5em;
border: 1px dashed var(--md-sys-color-on-secondary-container);
margin: 1em 0;
background-color: var(--md-sys-color-secondary-container);
border-radius: 4px;
color: var(--md-sys-color-on-secondary-container);
text-align: center;
}
.shareInput {
width: 100%;
}
.uploadInput > input {
width: 0;
visibility: hidden;
}

View File

@@ -0,0 +1,80 @@
import { FC, useEffect, useState } from 'react'
import styles from './SectionShare.module.css'
import { Heading } from '../../shared/Heading'
import { Paragraph } from '../../shared/Paragraph/Paragraph'
import { Button } from '../../shared/Button/Button'
import cx from 'classnames'
import typography from '../../../styles/typography.module.css'
import { download, streamToArrayBuffer } from '../../../src/download'
import { I18n } from '../../shared/I18n/I18n'
import { Input } from '../../shared/Input/Input'
import { Section } from '../../shared/Section/Section'
import { useGroups } from '../../contexts/GroupProvider'
export const SectionShare: FC = () => {
const { store, load } = useGroups()
const [location, setLocation] = useState('')
useEffect(() => {
setLocation(window.location.href)
}, [])
return (
<Section color={'primary'}>
<div className={styles.shareGrid}>
<div>
<Heading type={'section'}>
<I18n id={'page.home.share.download.title'} />
</Heading>
<Paragraph size={'medium'}>
<I18n id={'page.home.share.download.description'} />
</Paragraph>
<Button
className={cx(styles.downloadBtn, typography.bodyLarge)}
onClick={() => {
download('factorio-microservices.bin', store())
}}
>
<I18n id={'page.home.pref.download'} />
</Button>
<label className={styles.uploadInput}>
<I18n id={'page.home.share.download.upload_text'} />
<input
type={'file'}
multiple={false}
onChange={async evt => {
const stream = evt.currentTarget.files?.[0].stream() as
| globalThis.ReadableStream<Uint8Array>
| undefined
if (stream) {
const array = await streamToArrayBuffer(stream)
load(array)
evt.currentTarget.value = null as unknown as string
}
}}
/>
</label>
</div>
<div>
<Heading type={'section'}>
<I18n id={'page.home.share.link.title'} />
</Heading>
<Paragraph size={'medium'}>
<I18n id={'page.home.share.link.description'} />
</Paragraph>
<Paragraph size={'medium'}>
<strong>
<I18n id={'page.home.share.link.warning'} />
</strong>
</Paragraph>
<Input
className={styles.shareInput}
readOnly={true}
value={location}
onClick={e => e.currentTarget.select()}
/>
</div>
</div>
</Section>
)
}

View File

@@ -1,11 +1,7 @@
.icon {
height: 1em;
fill: currentcolor;
padding-inline: 0.5ch;
stroke: currentcolor;
transform: translateY(0.1em);
}
@media (prefers-color-scheme: dark) {
.icon {
filter: invert(100%);
}
}

View File

@@ -0,0 +1,13 @@
.root {
padding: 1em;
border: 0;
background-color: var(--md-sys-color-secondary);
border-radius: 4px;
color: var(--md-sys-color-on-secondary);
transition: box-shadow 0.075s linear;
}
.root:hover,
.root:focus-visible {
box-shadow: 2px 2px 5px 1px rgba(0 0 0 / 50%);
}

View File

@@ -0,0 +1,13 @@
import { ButtonHTMLAttributes, FC } from 'react'
import cx from 'classnames'
import styles from './Button.module.css'
type Props = ButtonHTMLAttributes<HTMLButtonElement>
export const Button: FC<Props> = ({ className, children, ...rest }) => {
return (
<button className={cx(styles.root, className)} {...rest}>
{children}
</button>
)
}

View File

@@ -0,0 +1,15 @@
.root {
display: inline-block;
margin-block-start: -0.4em;
padding-inline: 0.5em;
vertical-align: middle;
}
.link {
display: inline;
padding: 0.2em;
border-radius: 4px;
box-shadow: 0 0 0 1px var(--md-sys-color-tertiary);
color: var(--md-sys-color-tertiary);
font-size: var(--md-sys-typescale-body-small-font-size);
}

View File

@@ -0,0 +1,25 @@
import { FC } from 'react'
import { I18n } from '../I18n/I18n'
import { GraphIcon } from '../../icons/GraphIcon'
import Link from 'next/link'
import { useRouter } from 'next/router'
import styles from './ButtonVisualize.module.css'
interface Props {
groupId?: string
large?: true
}
export const ButtonVisualize: FC<Props> = ({ groupId, large }) => {
const { query } = useRouter()
return (
<span className={styles.root}>
<Link href={{ pathname: !groupId ? '/visualize' : `/visualize/${groupId}`, query }}>
<a className={styles.link}>
{large ? <I18n id={'page.home.pref.visualize'} /> : null}
<GraphIcon />
</a>
</Link>
</span>
)
}

View File

@@ -0,0 +1,58 @@
.collapsible {
position: relative;
}
.toggle {
display: none;
}
.label {
position: absolute;
z-index: 100;
inset-block-start: 0;
inset-inline-end: 0;
}
.label::before {
display: block;
width: 1em;
height: 1em;
border: 1px solid var(--md-ref-palette-neutral-variant80);
border-radius: 4px;
content: "-";
font-size: 0.5em;
line-height: 1em;
margin-block-start: 0.5em;
text-align: center;
}
.content {
position: relative;
overflow: hidden;
max-height: 100vh;
transition: max-height 0.25s ease-in;
}
.content::after {
position: absolute;
height: 3em;
background: linear-gradient(to bottom, rgba(0 0 0 / 0%) 0%, var(--color-bg) 100%);
content: "";
inset-block-end: 0;
inset-inline: 0;
pointer-events: none;
transition: height 0.25s ease-in-out;
}
.toggle:checked + .label::before {
content: "+";
}
.toggle:not(:checked) + .label + .content::after {
height: 0;
}
.toggle:checked + .label + .content {
max-height: 5em;
transition: max-height 0.25s ease-out;
}

View File

@@ -0,0 +1,25 @@
import { FC, PropsWithChildren } from 'react'
import styles from './Collapsible.module.css'
import cx from 'classnames'
import typography from '../../../styles/typography.module.css'
interface Props {
id: string
className?: string
}
export const Collapsible: FC<PropsWithChildren<Props>> = ({ id, className, children }) => {
return (
<div className={cx(styles.collapsible, className)}>
<input id={id} className={styles.toggle} type='checkbox' defaultChecked={true} />
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label
htmlFor={id}
id={id}
className={cx(styles.label, typography.displaySmall)}
defaultChecked={true}
/>
<div className={styles.content}>{children}</div>
</div>
)
}

View File

@@ -0,0 +1,35 @@
import { createElement, FC, HTMLAttributes, PropsWithChildren } from 'react'
import cx from 'classnames'
import typography from '../../styles/typography.module.css'
interface Props extends HTMLAttributes<HTMLSpanElement & HTMLHeadingElement> {
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'span'
type: 'pageTitle' | 'section' | 'subsection'
className?: string
}
export const Heading: FC<PropsWithChildren<Props>> = ({
tag,
type,
className,
children,
...rest
}) => {
const TAG: Record<Props['type'], Exclude<Props['tag'], undefined>> = {
pageTitle: 'h1',
section: 'h2',
subsection: 'h3'
}
return createElement(
tag ?? TAG[type],
{
className: cx(className, {
[typography.displayLarge]: type === 'pageTitle',
[typography.headlineMedium]: type === 'section',
[typography.titleLarge]: type === 'subsection'
}),
...rest
},
children
)
}

View File

@@ -0,0 +1,8 @@
.root {
padding: 1em 0.5em;
border: 1px solid var(--color-text, var(--md-sys-color-on-background));
margin: 0 0 1em;
background-color: var(--color-bg, var(--md-sys-color-background));
border-radius: 4px;
font-size: var(--md-sys-typescale-body-small-font-size);
}

View File

@@ -0,0 +1,9 @@
import { FC, InputHTMLAttributes } from 'react'
import styles from './Input.module.css'
import cx from 'classnames'
type Props = InputHTMLAttributes<HTMLInputElement>
export const Input: FC<Props> = ({ className, ...rest }) => {
return <input className={cx(className, styles.root)} {...rest} />
}

View File

@@ -0,0 +1,3 @@
.subtitle {
margin-block-start: -2em;
}

View File

@@ -0,0 +1,23 @@
import { FC, PropsWithChildren } from 'react'
import cx from 'classnames'
import typography from '../../../styles/typography.module.css'
import styles from './Paragraph.module.css'
interface Props {
size: 'large' | 'medium' | 'small' | 'subtitle'
}
export const Paragraph: FC<PropsWithChildren<Props>> = ({ size, children }) => {
return (
<p
className={cx({
[typography.bodyLarge]: size === 'large',
[typography.bodyMedium]: size === 'medium',
[typography.bodySmall]: size === 'small' || size === 'subtitle',
[styles.subtitle]: size === 'subtitle'
})}
>
{children}
</p>
)
}

View File

@@ -0,0 +1,33 @@
.content {
max-width: 80ch;
margin: 0 auto;
padding-block: 2em;
text-align: justify;
--color-bg: var(--md-sys-color-background);
--color-text: var(--md-sys-color-on-background);
}
.primary {
--color-bg: var(--md-sys-color-primary-container);
--color-text: var(--md-sys-color-on-primary-container);
}
.secondary {
--color-bg: var(--md-sys-color-secondary-container);
--color-text: var(--md-sys-color-on-secondary-container);
}
.tertiary {
--color-bg: var(--md-sys-color-tertiary-container);
--color-text: var(--md-sys-color-on-tertiary-container);
}
.primary,
.secondary,
.tertiary {
background-color: var(--color-bg);
box-shadow: 0 0 0 100vmax var(--color-bg);
clip-path: inset(0 -100vmax);
color: var(--color-text);
}

View File

@@ -0,0 +1,26 @@
import { createContext, FC, PropsWithChildren, useContext } from 'react'
import styles from './Section.module.css'
import cx from 'classnames'
type SectionContextType = 'primary' | 'secondary' | 'tertiary' | undefined
interface Props {
color?: SectionContextType
}
const SectionContext = createContext<SectionContextType>(undefined)
export const useSectionColor = () => useContext(SectionContext)
export const Section: FC<PropsWithChildren<Props>> = ({ color, children }) => {
return (
<div
className={cx(styles.content, {
[styles.primary]: color === 'primary',
[styles.secondary]: color === 'secondary',
[styles.tertiary]: color === 'tertiary'
})}
>
<SectionContext.Provider value={color}>{children}</SectionContext.Provider>
</div>
)
}

View File

@@ -43,7 +43,7 @@ export const NodeOverview: FC<Props> = ({ node, className, ...props }) => {
</div>
) : null}
<h4>
<I18n id={'page.visualize.imports'} />
<I18n id={'page.visualize.overview.imports'} />
</h4>
<div className={styles.small}>
{node.inputs.map(input => (
@@ -53,7 +53,7 @@ export const NodeOverview: FC<Props> = ({ node, className, ...props }) => {
{node.outputs.length ? (
<>
<h4>
<I18n id={'page.visualize.exports'} />
<I18n id={'page.visualize.overview.exports'} />
</h4>
<div className={styles.small}>
{node.outputs.map(input => (

View File

@@ -9,8 +9,11 @@ import Head from 'next/head'
import { ScrollContainer } from './ScrollContainer/ScrollContainer'
import { ProducingGraph } from './ProducingGraph/ProducingGraph'
import { useFactories } from '../contexts/FactoryProvider'
import { i18n, I18n } from '../shared/I18n/I18n'
import { useIntl } from 'react-intl'
export const PageDetails: FC = () => {
const intl = useIntl()
const {
query: { name }
} = useRouter()
@@ -61,12 +64,16 @@ export const PageDetails: FC = () => {
return (
<>
<Head>
<title>Factorio Microservices</title>
<meta name='description' content='Create Factorio microservices' />
<title>
<I18n id={'page.visualize.details.title'} values={{ name: group?.name ?? '' }} />
</title>
<meta name='description' content={i18n(intl, 'page.home.head.meta.description')} />
</Head>
<main>
<ScrollContainer>
<h1>{name}</h1>
<h1>
<I18n id={'page.visualize.details.title'} values={{ name: group?.name ?? '' }} />
</h1>
<ProducingGraph
nodes={producingNodes}
inputs={inputFactories}

View File

@@ -6,8 +6,11 @@ import { ScrollContainer } from './ScrollContainer/ScrollContainer'
import { ProducingGraph } from './ProducingGraph/ProducingGraph'
import { NodeOverview, OverviewGraphNode } from './NodeOverview/NodeOverview'
import { useFactories } from '../contexts/FactoryProvider'
import { i18n, I18n } from '../shared/I18n/I18n'
import { useIntl } from 'react-intl'
export const PageOverview: FC = () => {
const intl = useIntl()
const { exportedFactories, baseFactories, groups } = useGroups()
const { findFactory } = useFactories()
@@ -28,12 +31,16 @@ export const PageOverview: FC = () => {
return (
<>
<Head>
<title>Factorio Microservices</title>
<meta name='description' content='Create Factorio microservices' />
<title>
<I18n id={'page.visualize.details.title'} />
</title>
<meta name='description' content={i18n(intl, 'page.home.head.meta.description')} />
</Head>
<main>
<ScrollContainer>
<h1>Factorio Microservices</h1>
<h1>
<I18n id={'page.visualize.details.title'} />
</h1>
<ProducingGraph
nodes={producingNodes}
inputs={baseFactories}

View File

@@ -21,6 +21,22 @@ const nextConfig = {
locales: ['en', 'de', 'nl'],
defaultLocale: 'en',
localeDetection: false
},
webpack: config => {
config.module?.rules?.forEach(rule => {
rule.oneOf?.forEach(oneOf => {
const loader = oneOf?.use
if (!loader || !Array.isArray(loader)) return
loader.forEach(l => {
if (l.loader?.includes('/css-loader') && l.options.modules) {
// mde-ui needs camelCase as well as BEM, so preserve both
l.options.modules.exportLocalsConvention = 'camelCase'
}
})
})
})
return config
}
}

View File

@@ -52,6 +52,7 @@
"stylelint": "^14.10.0",
"stylelint-config-idiomatic-order": "^8.1.0",
"stylelint-config-standard": "^27.0.0",
"stylelint-use-logical": "^2.0.0",
"ts-node": "^10.9.1",
"typescript": "4.7.4"
}

View File

@@ -1,3 +1,6 @@
import '../styles/font-faces.css'
import '../styles/tokens.css'
import '../styles/theme.css'
import '../styles/globals.css'
import type { AppProps } from 'next/app'
import { FC } from 'react'

202
public/fonts/LICENSE.txt Normal file
View File

@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

1
public/pencil.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" enable-background="new 0 0 50 50"><path d="M9.6 40.4l2.5-9.9L27 15.6l7.4 7.4-14.9 14.9-9.9 2.5zm4.3-8.9l-1.5 6.1 6.1-1.5L31.6 23 27 18.4 13.9 31.5z"/><path d="M17.8 37.3c-.6-2.5-2.6-4.5-5.1-5.1l.5-1.9c3.2.8 5.7 3.3 6.5 6.5l-1.9.5z"/><path d="M29.298 19.287l1.414 1.414-13.01 13.02-1.414-1.412z"/><path d="M11 39l2.9-.7c-.3-1.1-1.1-1.9-2.2-2.2L11 39z"/><path d="M35 22.4L27.6 15l3-3 .5.1c3.6.5 6.4 3.3 6.9 6.9l.1.5-3.1 2.9zM30.4 15l4.6 4.6.9-.9c-.5-2.3-2.3-4.1-4.6-4.6l-.9.9z"/></svg>

After

Width:  |  Height:  |  Size: 544 B

View File

@@ -9,6 +9,13 @@
"page.home.pref.basic.description": "Grundlegende Waren können nicht in Fabriken hergestellt werden. Es kann sinnvoll sein hier z.B. Eisenplatten hinzuzufügen, wenn jene direkt beim Erz hergestellt werden.",
"page.home.pref.ignored.title": "Ignorierte Waren",
"page.home.pref.ignored.description": "Waren, die im Einkaufszentrum hergestellt werden sollen (z.B. Befeuerter Greifarm, weil es nicht benötigt wird) und auch nicht zwischen den Mikroservices exportiert werden sollen (z.B. Zahnräder, weil die bei Bedarf in der Fabrik selbst als Zwischenprodukt hergestellt wird).",
"page.home.share.download.title": "Download & Upload",
"page.home.share.download.description": "Lade hier deine Daten herunter, um sie für einen späteren Upload zu speichern. Alle auf dieser Seite vorgenommenen Änderungen werden automatisch gespeichert und können nicht rückgängig gemacht werden. Am besten lädst du daher die Daten daher herunter bevor du etwas ausprobierst.",
"page.home.share.download.upload_text": "Klicke zum Hochladen oder ziehe einen Speicherstand in diesen Bereich!",
"page.home.share.link.title": "Teile und Herrsche!",
"page.home.share.link.description": "Du kannst auch mit deinen Freunden zusammenarbeiten! Teile einfach den folgenden Link!",
"page.home.share.link.warning": "Warnung: Jeder mit diesem Link kann bearbeiten!",
"page.home.group.title": "Gruppen von Microservices",
"page.home.group.add.title": "Neue Gruppe hinzufügen",
"page.home.group.add.default_group_name": "Neue Gruppe",
"page.home.group.add.button_text": "Gruppe \"{name}\" hinzufügen",
@@ -32,6 +39,9 @@
"page.home.tooltip.action.add_to_new_export": "Erstelle eine neue Gruppe mit diesem Namen und gut als exportierte Fabrik",
"page.home.tooltip.action.add_to_export": "Ware zu exportierten Fabriken hinzufügen",
"page.home.tooltip.action.add_to_mall": "Ware als Einkaufszentrum hinzufügen",
"page.visualize.imports": "Importe",
"page.visualize.exports": "Exporte"
"page.visualize.overview.imports": "Importe",
"page.visualize.overview.exports": "Exporte",
"page.visualize.overview.title": "Zusammenhänge der Services",
"page.visualize.details.title": "Group \"{name}\"",
"component.recipe.arrow": "→"
}

View File

@@ -9,6 +9,13 @@
"page.home.pref.basic.description": "Basic goods cannot be produced in factories. It may make sense to add iron plates here, for example, if they are produced directly at the ore.",
"page.home.pref.ignored.title": "Ignored goods",
"page.home.pref.ignored.description": "Goods that are to be manufactured in in the mall (e.g., burner inserter because it is not needed) and also are not to be exported between microservices (e.g., gears because that is manufactured in the factory itself as an intermediate product when needed).",
"page.home.share.download.title": "Download & Upload",
"page.home.share.download.description": "Download your data here to store it for later upload. All changes made on this page are automatically saved and cannot be undone. So it is recommended to store a stable state before testing something out.",
"page.home.share.download.upload_text": "Click to upload or drop save in this area!",
"page.home.share.link.title": "Divide and Conquer!",
"page.home.share.link.description": "You can also work together with your friends! Just share the following link!",
"page.home.share.link.warning": "Warning: Everyone with this link can edit!",
"page.home.group.title": "Groups of Microservices",
"page.home.group.add.title": "Add a new group",
"page.home.group.add.default_group_name": "New Group",
"page.home.group.add.button_text": "Add group \"{name}\"",
@@ -32,6 +39,9 @@
"page.home.tooltip.action.add_to_new_export": "Create a new group with this name and good as exported factory",
"page.home.tooltip.action.add_to_export": "Add good to exported factories",
"page.home.tooltip.action.add_to_mall": "Add good to mall factories",
"page.visualize.imports": "Imports",
"page.visualize.exports": "Exports"
"page.visualize.overview.imports": "Imports",
"page.visualize.overview.exports": "Exports",
"page.visualize.overview.title": "Interrelationships of Groups",
"page.visualize.details.title": "Group \"{name}\"",
"component.recipe.arrow": "→"
}

View File

@@ -9,9 +9,16 @@
"page.home.pref.basic.description": "Basisgoederen kunnen niet in fabrieken worden geproduceerd. Het kan zinvol zijn om hier bijvoorbeeld ijzeren platen toe te voegen, als ze direct aan het erts worden geproduceerd.",
"page.home.pref.ignored.title": "Genegeerde goederen",
"page.home.pref.ignored.description": "Goederen die in in het winkelcentrum moeten worden gefabriceerd (bijv. branderinserter omdat die niet nodig is) en ook niet tussen microservices moeten worden geëxporteerd (bijv. tandwielen omdat dat in de fabriek zelf als tussenproduct wordt gefabriceerd als dat nodig is).",
"page.home.share.download.title": "Downloaden & uploaden",
"page.home.share.download.description": "Download hier je gegevens om ze op te slaan en later te uploaden. Alle wijzigingen op deze pagina worden automatisch opgeslagen en kunnen niet ongedaan worden gemaakt. Het is daarom het beste om de gegevens te downloaden voordat je iets uitprobeert.",
"page.home.share.download.upload_text": "Klik om een opgeslagen bestand te uploaden of te slepen naar dit gebied!",
"page.home.share.link.title": "Verdeel en heers!",
"page.home.share.link.description": "Je kunt ook samenwerken met je vrienden! Deel gewoon de volgende link!",
"page.home.share.link.warning": "Waarschuwing: iedereen met deze link kan bewerken!",
"page.home.group.title": "Microservices groepen",
"page.home.group.add.title": "Voeg een nieuwe groep toe",
"page.home.group.add.default_group_name": "Nieuwe groep",
"page.home.group.add.button_text": "Groep toevoegen {naam}",
"page.home.group.add.button_text": "Groep \"{name}\" toevoegen",
"page.home.group.missing.export.title": "Ontbrekende export fabrieken",
"page.home.group.missing.export.description": "Een lijst van alle goederen die geen basisgoederen of genegeerde goederen zijn, en die nog bij geen enkele groep worden geëxporteerd of als winkelcentrumfabriek zijn toegevoegd. Alleen in deze lijst indien gebruikt door ten minste 3 andere goederen.",
"page.home.group.missing.mall.title": "Ontbrekende winkelcentrumfabrieken",
@@ -19,8 +26,8 @@
"page.home.group.missing.none": "Alle fabrieken toegevoegd!",
"page.home.group.item.export": "Uitgevoerde goederen",
"page.home.group.item.mall": "Winkelcentrum goederen",
"page.home.group.item.input": "Ingevoerde goederen ({bedrag})",
"page.home.group.item.intermediate": "Tussenliggende fabrieken ({bedrag})",
"page.home.group.item.input": "Ingevoerde goederen ({amount})",
"page.home.group.item.intermediate": "Tussenliggende fabrieken ({amount})",
"page.home.group.item.suggestion.export": "Voorgestelde exportgoederen",
"page.home.group.item.suggestion.mall": "Voorgestelde winkelcentrum goederen",
"page.home.group.delete.confirmation": "Groep permanent verwijderen?",
@@ -32,6 +39,9 @@
"page.home.tooltip.action.add_to_new_export": "Maak een nieuwe groep met deze naam en goed als geëxporteerde fabriek",
"page.home.tooltip.action.add_to_export": "Voeg goed toe aan geëxporteerde fabrieken",
"page.home.tooltip.action.add_to_mall": "Goed toevoegen aan fabrieken in winkelcentrum",
"page.visualize.imports": "Invoer",
"page.visualize.exports": "Uitvoer"
"page.visualize.overview.imports": "Invoer",
"page.visualize.overview.exports": "Uitvoer",
"page.visualize.overview.title": "Microservice Relaties",
"page.visualize.details.title": "Groep \"{name}\"",
"component.recipe.arrow": "→"
}

231
styles/colors.module.css Normal file
View File

@@ -0,0 +1,231 @@
.primary {
background-color: var(--md-sys-color-primary);
}
.primary-text {
color: var(--md-sys-color-primary);
}
.on-primary {
background-color: var(--md-sys-color-on-primary);
}
.on-primary-text {
color: var(--md-sys-color-on-primary);
}
.primary-container {
background-color: var(--md-sys-color-primary-container);
}
.primary-container-text {
color: var(--md-sys-color-primary-container);
}
.on-primary-container {
background-color: var(--md-sys-color-on-primary-container);
}
.on-primary-container-text {
color: var(--md-sys-color-on-primary-container);
}
.secondary {
background-color: var(--md-sys-color-secondary);
}
.secondary-text {
color: var(--md-sys-color-secondary);
}
.on-secondary {
background-color: var(--md-sys-color-on-secondary);
}
.on-secondary-text {
color: var(--md-sys-color-on-secondary);
}
.secondary-container {
background-color: var(--md-sys-color-secondary-container);
}
.secondary-container-text {
color: var(--md-sys-color-secondary-container);
}
.on-secondary-container {
background-color: var(--md-sys-color-on-secondary-container);
}
.on-secondary-container-text {
color: var(--md-sys-color-on-secondary-container);
}
.tertiary {
background-color: var(--md-sys-color-tertiary);
}
.tertiary-text {
color: var(--md-sys-color-tertiary);
}
.on-tertiary {
background-color: var(--md-sys-color-on-tertiary);
}
.on-tertiary-text {
color: var(--md-sys-color-on-tertiary);
}
.tertiary-container {
background-color: var(--md-sys-color-tertiary-container);
}
.tertiary-container-text {
color: var(--md-sys-color-tertiary-container);
}
.on-tertiary-container {
background-color: var(--md-sys-color-on-tertiary-container);
}
.on-tertiary-container-text {
color: var(--md-sys-color-on-tertiary-container);
}
.error {
background-color: var(--md-sys-color-error);
}
.error-text {
color: var(--md-sys-color-error);
}
.error-container {
background-color: var(--md-sys-color-error-container);
}
.error-container-text {
color: var(--md-sys-color-error-container);
}
.on-error {
background-color: var(--md-sys-color-on-error);
}
.on-error-text {
color: var(--md-sys-color-on-error);
}
.on-error-container {
background-color: var(--md-sys-color-on-error-container);
}
.on-error-container-text {
color: var(--md-sys-color-on-error-container);
}
.background {
background-color: var(--md-sys-color-background);
}
.background-text {
color: var(--md-sys-color-background);
}
.on-background {
background-color: var(--md-sys-color-on-background);
}
.on-background-text {
color: var(--md-sys-color-on-background);
}
.surface {
background-color: var(--md-sys-color-surface);
}
.surface-text {
color: var(--md-sys-color-surface);
}
.on-surface {
background-color: var(--md-sys-color-on-surface);
}
.on-surface-text {
color: var(--md-sys-color-on-surface);
}
.surface-variant {
background-color: var(--md-sys-color-surface-variant);
}
.surface-variant-text {
color: var(--md-sys-color-surface-variant);
}
.on-surface-variant {
background-color: var(--md-sys-color-on-surface-variant);
}
.on-surface-variant-text {
color: var(--md-sys-color-on-surface-variant);
}
.outline {
background-color: var(--md-sys-color-outline);
}
.outline-text {
color: var(--md-sys-color-outline);
}
.inverse-on-surface {
background-color: var(--md-sys-color-inverse-on-surface);
}
.inverse-on-surface-text {
color: var(--md-sys-color-inverse-on-surface);
}
.inverse-surface {
background-color: var(--md-sys-color-inverse-surface);
}
.inverse-surface-text {
color: var(--md-sys-color-inverse-surface);
}
.inverse-primary {
background-color: var(--md-sys-color-inverse-primary);
}
.inverse-primary-text {
color: var(--md-sys-color-inverse-primary);
}
.shadow {
background-color: var(--md-sys-color-shadow);
}
.shadow-text {
color: var(--md-sys-color-shadow);
}
.surface-tint {
background-color: var(--md-sys-color-surface-tint);
}
.surface-tint-text {
color: var(--md-sys-color-surface-tint);
}
.surface-tint-color {
background-color: var(--md-sys-color-surface-tint-color);
}
.surface-tint-color-text {
color: var(--md-sys-color-surface-tint-color);
}

31
styles/font-faces.css Normal file
View File

@@ -0,0 +1,31 @@
@font-face {
font-display: swap;
font-family: Roboto;
font-style: normal;
font-weight: 400;
src: url("/factorio/fonts/Roboto-Regular.ttf") format("woff2");
}
@font-face {
font-display: swap;
font-family: Roboto;
font-style: italic;
font-weight: 400;
src: url("/factorio/fonts/Roboto-Italic.ttf") format("woff2");
}
@font-face {
font-display: swap;
font-family: Roboto;
font-style: normal;
font-weight: 500;
src: url("/factorio/fonts/Roboto-Medium.ttf") format("woff2");
}
@font-face {
font-display: swap;
font-family: Roboto;
font-style: italic;
font-weight: 500;
src: url("/factorio/fonts/Roboto-MediumItalic.ttf") format("woff2");
}

View File

@@ -17,9 +17,9 @@ body {
}
body {
padding: 2em;
background: #fafafa;
color: black;
padding: 0 2em;
background: var(--md-sys-color-background);
color: var(--md-sys-color-on-background);
}
body.scroll {
@@ -50,15 +50,14 @@ h4 {
margin-block: 1em 0.3em;
}
strong {
font-weight: 500;
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
body {
background: #111;
color: white;
}
}
@media (max-width: 1200px) {

5
styles/theme.css Normal file
View File

@@ -0,0 +1,5 @@
@import "tokens.css";
@import "colors.module.css";
@import "typography.module.css";
@import "theme.light.css" (prefers-color-scheme: light);
@import "theme.dark.css" (prefers-color-scheme: dark);

31
styles/theme.dark.css Normal file
View File

@@ -0,0 +1,31 @@
:root {
--md-sys-color-primary: var(--md-sys-color-primary-dark);
--md-sys-color-on-primary: var(--md-sys-color-on-primary-dark);
--md-sys-color-primary-container: var(--md-sys-color-primary-container-dark);
--md-sys-color-on-primary-container: var(--md-sys-color-on-primary-container-dark);
--md-sys-color-secondary: var(--md-sys-color-secondary-dark);
--md-sys-color-on-secondary: var(--md-sys-color-on-secondary-dark);
--md-sys-color-secondary-container: var(--md-sys-color-secondary-container-dark);
--md-sys-color-on-secondary-container: var(--md-sys-color-on-secondary-container-dark);
--md-sys-color-tertiary: var(--md-sys-color-tertiary-dark);
--md-sys-color-on-tertiary: var(--md-sys-color-on-tertiary-dark);
--md-sys-color-tertiary-container: var(--md-sys-color-tertiary-container-dark);
--md-sys-color-on-tertiary-container: var(--md-sys-color-on-tertiary-container-dark);
--md-sys-color-error: var(--md-sys-color-error-dark);
--md-sys-color-error-container: var(--md-sys-color-error-container-dark);
--md-sys-color-on-error: var(--md-sys-color-on-error-dark);
--md-sys-color-on-error-container: var(--md-sys-color-on-error-container-dark);
--md-sys-color-background: var(--md-sys-color-background-dark);
--md-sys-color-on-background: var(--md-sys-color-on-background-dark);
--md-sys-color-surface: var(--md-sys-color-surface-dark);
--md-sys-color-on-surface: var(--md-sys-color-on-surface-dark);
--md-sys-color-surface-variant: var(--md-sys-color-surface-variant-dark);
--md-sys-color-on-surface-variant: var(--md-sys-color-on-surface-variant-dark);
--md-sys-color-outline: var(--md-sys-color-outline-dark);
--md-sys-color-inverse-on-surface: var(--md-sys-color-inverse-on-surface-dark);
--md-sys-color-inverse-surface: var(--md-sys-color-inverse-surface-dark);
--md-sys-color-inverse-primary: var(--md-sys-color-inverse-primary-dark);
--md-sys-color-shadow: var(--md-sys-color-shadow-dark);
--md-sys-color-surface-tint: var(--md-sys-color-surface-tint-dark);
--md-sys-color-surface-tint-color: var(--md-sys-color-surface-tint-color-dark);
}

31
styles/theme.light.css Normal file
View File

@@ -0,0 +1,31 @@
:root {
--md-sys-color-primary: var(--md-sys-color-primary-light);
--md-sys-color-on-primary: var(--md-sys-color-on-primary-light);
--md-sys-color-primary-container: var(--md-sys-color-primary-container-light);
--md-sys-color-on-primary-container: var(--md-sys-color-on-primary-container-light);
--md-sys-color-secondary: var(--md-sys-color-secondary-light);
--md-sys-color-on-secondary: var(--md-sys-color-on-secondary-light);
--md-sys-color-secondary-container: var(--md-sys-color-secondary-container-light);
--md-sys-color-on-secondary-container: var(--md-sys-color-on-secondary-container-light);
--md-sys-color-tertiary: var(--md-sys-color-tertiary-light);
--md-sys-color-on-tertiary: var(--md-sys-color-on-tertiary-light);
--md-sys-color-tertiary-container: var(--md-sys-color-tertiary-container-light);
--md-sys-color-on-tertiary-container: var(--md-sys-color-on-tertiary-container-light);
--md-sys-color-error: var(--md-sys-color-error-light);
--md-sys-color-error-container: var(--md-sys-color-error-container-light);
--md-sys-color-on-error: var(--md-sys-color-on-error-light);
--md-sys-color-on-error-container: var(--md-sys-color-on-error-container-light);
--md-sys-color-background: var(--md-sys-color-background-light);
--md-sys-color-on-background: var(--md-sys-color-on-background-light);
--md-sys-color-surface: var(--md-sys-color-surface-light);
--md-sys-color-on-surface: var(--md-sys-color-on-surface-light);
--md-sys-color-surface-variant: var(--md-sys-color-surface-variant-light);
--md-sys-color-on-surface-variant: var(--md-sys-color-on-surface-variant-light);
--md-sys-color-outline: var(--md-sys-color-outline-light);
--md-sys-color-inverse-on-surface: var(--md-sys-color-inverse-on-surface-light);
--md-sys-color-inverse-surface: var(--md-sys-color-inverse-surface-light);
--md-sys-color-inverse-primary: var(--md-sys-color-inverse-primary-light);
--md-sys-color-shadow: var(--md-sys-color-shadow-light);
--md-sys-color-surface-tint: var(--md-sys-color-surface-tint-light);
--md-sys-color-surface-tint-color: var(--md-sys-color-surface-tint-color-light);
}

293
styles/tokens.css Normal file
View File

@@ -0,0 +1,293 @@
:root {
--md-source: #e69100;
/* primary */
--md-ref-palette-primary0: #000;
--md-ref-palette-primary10: #2b1700;
--md-ref-palette-primary20: #472a00;
--md-ref-palette-primary25: #563400;
--md-ref-palette-primary30: #663e00;
--md-ref-palette-primary35: #764800;
--md-ref-palette-primary40: #865300;
--md-ref-palette-primary50: #a86900;
--md-ref-palette-primary60: #cb8000;
--md-ref-palette-primary70: #ef980f;
--md-ref-palette-primary80: #ffb963;
--md-ref-palette-primary90: #ffddb9;
--md-ref-palette-primary95: #ffeedf;
--md-ref-palette-primary98: #fff8f4;
--md-ref-palette-primary99: #fffbff;
--md-ref-palette-primary100: #fff;
/* secondary */
--md-ref-palette-secondary0: #000;
--md-ref-palette-secondary10: #001f2a;
--md-ref-palette-secondary20: #003546;
--md-ref-palette-secondary25: #004155;
--md-ref-palette-secondary30: #004d64;
--md-ref-palette-secondary35: #005a74;
--md-ref-palette-secondary40: #006684;
--md-ref-palette-secondary50: #0081a6;
--md-ref-palette-secondary60: #0d9cc8;
--md-ref-palette-secondary70: #42b7e4;
--md-ref-palette-secondary80: #69d3ff;
--md-ref-palette-secondary90: #bee9ff;
--md-ref-palette-secondary95: #e0f4ff;
--md-ref-palette-secondary98: #f4faff;
--md-ref-palette-secondary99: #fafcff;
--md-ref-palette-secondary100: #fff;
/* tertiary */
--md-ref-palette-tertiary0: #000;
--md-ref-palette-tertiary10: #002105;
--md-ref-palette-tertiary20: #00390e;
--md-ref-palette-tertiary25: #004613;
--md-ref-palette-tertiary30: #005318;
--md-ref-palette-tertiary35: #00601d;
--md-ref-palette-tertiary40: #0a6e24;
--md-ref-palette-tertiary50: #2f883b;
--md-ref-palette-tertiary60: #4ba352;
--md-ref-palette-tertiary70: #66be6a;
--md-ref-palette-tertiary80: #81da83;
--md-ref-palette-tertiary90: #9cf79c;
--md-ref-palette-tertiary95: #c7ffc2;
--md-ref-palette-tertiary98: #ebffe5;
--md-ref-palette-tertiary99: #f6fff0;
--md-ref-palette-tertiary100: #fff;
/* neutral */
--md-ref-palette-neutral0: #000;
--md-ref-palette-neutral10: #2b1700;
--md-ref-palette-neutral20: #472a00;
--md-ref-palette-neutral25: #573300;
--md-ref-palette-neutral30: #663e00;
--md-ref-palette-neutral35: #764800;
--md-ref-palette-neutral40: #875300;
--md-ref-palette-neutral50: #a86900;
--md-ref-palette-neutral60: #c8811e;
--md-ref-palette-neutral70: #e79b38;
--md-ref-palette-neutral80: #ffb963;
--md-ref-palette-neutral90: #ffddb9;
--md-ref-palette-neutral95: #ffeedf;
--md-ref-palette-neutral98: #fff8f4;
--md-ref-palette-neutral99: #fffbff;
--md-ref-palette-neutral100: #fff;
/* neutral-variant */
--md-ref-palette-neutral-variant0: #000;
--md-ref-palette-neutral-variant10: #231a11;
--md-ref-palette-neutral-variant20: #392f24;
--md-ref-palette-neutral-variant25: #443a2f;
--md-ref-palette-neutral-variant30: #504539;
--md-ref-palette-neutral-variant35: #5c5045;
--md-ref-palette-neutral-variant40: #685c50;
--md-ref-palette-neutral-variant50: #827568;
--md-ref-palette-neutral-variant60: #9d8e81;
--md-ref-palette-neutral-variant70: #b8a99a;
--md-ref-palette-neutral-variant80: #d4c4b5;
--md-ref-palette-neutral-variant90: #f1e0d0;
--md-ref-palette-neutral-variant95: #ffeedf;
--md-ref-palette-neutral-variant98: #fff8f4;
--md-ref-palette-neutral-variant99: #fffbff;
--md-ref-palette-neutral-variant100: #fff;
/* error */
--md-ref-palette-error0: #000;
--md-ref-palette-error10: #410002;
--md-ref-palette-error20: #690005;
--md-ref-palette-error25: #7e0007;
--md-ref-palette-error30: #93000a;
--md-ref-palette-error35: #a80710;
--md-ref-palette-error40: #ba1a1a;
--md-ref-palette-error50: #de3730;
--md-ref-palette-error60: #ff5449;
--md-ref-palette-error70: #ff897d;
--md-ref-palette-error80: #ffb4ab;
--md-ref-palette-error90: #ffdad6;
--md-ref-palette-error95: #ffedea;
--md-ref-palette-error98: #fff8f7;
--md-ref-palette-error99: #fffbff;
--md-ref-palette-error100: #fff;
/* light */
--md-sys-color-primary-light: #865300;
--md-sys-color-on-primary-light: #fff;
--md-sys-color-primary-container-light: #ffddb9;
--md-sys-color-on-primary-container-light: #2b1700;
--md-sys-color-secondary-light: #006684;
--md-sys-color-on-secondary-light: #fff;
--md-sys-color-secondary-container-light: #bee9ff;
--md-sys-color-on-secondary-container-light: #001f2a;
--md-sys-color-tertiary-light: #0a6e24;
--md-sys-color-on-tertiary-light: #fff;
--md-sys-color-tertiary-container-light: #9cf79c;
--md-sys-color-on-tertiary-container-light: #002105;
--md-sys-color-error-light: #ba1a1a;
--md-sys-color-error-container-light: #ffdad6;
--md-sys-color-on-error-light: #fff;
--md-sys-color-on-error-container-light: #410002;
--md-sys-color-background-light: #fffbff;
--md-sys-color-on-background-light: #2b1700;
--md-sys-color-surface-light: #fffbff;
--md-sys-color-on-surface-light: #2b1700;
--md-sys-color-surface-variant-light: #f1e0d0;
--md-sys-color-on-surface-variant-light: #504539;
--md-sys-color-outline-light: #827568;
--md-sys-color-inverse-on-surface-light: #ffeedf;
--md-sys-color-inverse-surface-light: #472a00;
--md-sys-color-inverse-primary-light: #ffb963;
--md-sys-color-shadow-light: #000;
--md-sys-color-surface-tint-light: #865300;
--md-sys-color-surface-tint-color-light: #865300;
/* dark */
--md-sys-color-primary-dark: #ffb963;
--md-sys-color-on-primary-dark: #472a00;
--md-sys-color-primary-container-dark: #663e00;
--md-sys-color-on-primary-container-dark: #ffddb9;
--md-sys-color-secondary-dark: #69d3ff;
--md-sys-color-on-secondary-dark: #003546;
--md-sys-color-secondary-container-dark: #004d64;
--md-sys-color-on-secondary-container-dark: #bee9ff;
--md-sys-color-tertiary-dark: #81da83;
--md-sys-color-on-tertiary-dark: #00390e;
--md-sys-color-tertiary-container-dark: #005318;
--md-sys-color-on-tertiary-container-dark: #9cf79c;
--md-sys-color-error-dark: #ffb4ab;
--md-sys-color-error-container-dark: #93000a;
--md-sys-color-on-error-dark: #690005;
--md-sys-color-on-error-container-dark: #ffdad6;
--md-sys-color-background-dark: #2b1700;
--md-sys-color-on-background-dark: #ffddb9;
--md-sys-color-surface-dark: #2b1700;
--md-sys-color-on-surface-dark: #ffddb9;
--md-sys-color-surface-variant-dark: #504539;
--md-sys-color-on-surface-variant-dark: #d4c4b5;
--md-sys-color-outline-dark: #9d8e81;
--md-sys-color-inverse-on-surface-dark: #2b1700;
--md-sys-color-inverse-surface-dark: #ffddb9;
--md-sys-color-inverse-primary-dark: #865300;
--md-sys-color-shadow-dark: #000;
--md-sys-color-surface-tint-dark: #ffb963;
--md-sys-color-surface-tint-color-dark: #ffb963;
/* label - small */
--md-sys-typescale-label-small-font-family-name: roboto;
--md-sys-typescale-label-small-font-family-style: normal;
--md-sys-typescale-label-small-font-weight: 500;
--md-sys-typescale-label-small-font-size: 11px;
--md-sys-typescale-label-small-letter-spacing: 0.5px;
--md-sys-typescale-label-small-line-height: 16px;
/* label - medium */
--md-sys-typescale-label-medium-font-family-name: roboto;
--md-sys-typescale-label-medium-font-family-style: normal;
--md-sys-typescale-label-medium-font-weight: 500;
--md-sys-typescale-label-medium-font-size: 12px;
--md-sys-typescale-label-medium-letter-spacing: 0.5px;
--md-sys-typescale-label-medium-line-height: 16px;
/* label - large */
--md-sys-typescale-label-large-font-family-name: roboto;
--md-sys-typescale-label-large-font-family-style: normal;
--md-sys-typescale-label-large-font-weight: 500;
--md-sys-typescale-label-large-font-size: 14px;
--md-sys-typescale-label-large-letter-spacing: 0.1px;
--md-sys-typescale-label-large-line-height: 20px;
/* body - small */
--md-sys-typescale-body-small-font-family-name: roboto;
--md-sys-typescale-body-small-font-family-style: normal;
--md-sys-typescale-body-small-font-weight: 400;
--md-sys-typescale-body-small-font-size: 12px;
--md-sys-typescale-body-small-letter-spacing: 0.4px;
--md-sys-typescale-body-small-line-height: 16px;
/* body - medium */
--md-sys-typescale-body-medium-font-family-name: roboto;
--md-sys-typescale-body-medium-font-family-style: normal;
--md-sys-typescale-body-medium-font-weight: 400;
--md-sys-typescale-body-medium-font-size: 14px;
--md-sys-typescale-body-medium-letter-spacing: 0.25px;
--md-sys-typescale-body-medium-line-height: 20px;
/* body - large */
--md-sys-typescale-body-large-font-family-name: roboto;
--md-sys-typescale-body-large-font-family-style: normal;
--md-sys-typescale-body-large-font-weight: 400;
--md-sys-typescale-body-large-font-size: 16px;
--md-sys-typescale-body-large-letter-spacing: 0.5px;
--md-sys-typescale-body-large-line-height: 24px;
/* headline - small */
--md-sys-typescale-headline-small-font-family-name: roboto;
--md-sys-typescale-headline-small-font-family-style: normal;
--md-sys-typescale-headline-small-font-weight: 400;
--md-sys-typescale-headline-small-font-size: 24px;
--md-sys-typescale-headline-small-letter-spacing: 0;
--md-sys-typescale-headline-small-line-height: 32px;
/* headline - medium */
--md-sys-typescale-headline-medium-font-family-name: roboto;
--md-sys-typescale-headline-medium-font-family-style: normal;
--md-sys-typescale-headline-medium-font-weight: 400;
--md-sys-typescale-headline-medium-font-size: 28px;
--md-sys-typescale-headline-medium-letter-spacing: 0;
--md-sys-typescale-headline-medium-line-height: 36px;
/* headline - large */
--md-sys-typescale-headline-large-font-family-name: roboto;
--md-sys-typescale-headline-large-font-family-style: normal;
--md-sys-typescale-headline-large-font-weight: 400;
--md-sys-typescale-headline-large-font-size: 32px;
--md-sys-typescale-headline-large-letter-spacing: 0;
--md-sys-typescale-headline-large-line-height: 40px;
/* display - small */
--md-sys-typescale-display-small-font-family-name: roboto;
--md-sys-typescale-display-small-font-family-style: normal;
--md-sys-typescale-display-small-font-weight: 400;
--md-sys-typescale-display-small-font-size: 36px;
--md-sys-typescale-display-small-letter-spacing: 0;
--md-sys-typescale-display-small-line-height: 44px;
/* display - medium */
--md-sys-typescale-display-medium-font-family-name: roboto;
--md-sys-typescale-display-medium-font-family-style: normal;
--md-sys-typescale-display-medium-font-weight: 400;
--md-sys-typescale-display-medium-font-size: 45px;
--md-sys-typescale-display-medium-letter-spacing: 0;
--md-sys-typescale-display-medium-line-height: 52px;
/* display - large */
--md-sys-typescale-display-large-font-family-name: roboto;
--md-sys-typescale-display-large-font-family-style: normal;
--md-sys-typescale-display-large-font-weight: 400;
--md-sys-typescale-display-large-font-size: 57px;
--md-sys-typescale-display-large-letter-spacing: -0.25px;
--md-sys-typescale-display-large-line-height: 64px;
/* title - small */
--md-sys-typescale-title-small-font-family-name: roboto;
--md-sys-typescale-title-small-font-family-style: normal;
--md-sys-typescale-title-small-font-weight: 500;
--md-sys-typescale-title-small-font-size: 14px;
--md-sys-typescale-title-small-letter-spacing: 0.1px;
--md-sys-typescale-title-small-line-height: 20px;
/* title - medium */
--md-sys-typescale-title-medium-font-family-name: roboto;
--md-sys-typescale-title-medium-font-family-style: normal;
--md-sys-typescale-title-medium-font-weight: 500;
--md-sys-typescale-title-medium-font-size: 16px;
--md-sys-typescale-title-medium-letter-spacing: 0.15px;
--md-sys-typescale-title-medium-line-height: 24px;
/* title - large */
--md-sys-typescale-title-large-font-family-name: roboto;
--md-sys-typescale-title-large-font-family-style: normal;
--md-sys-typescale-title-large-font-weight: 400;
--md-sys-typescale-title-large-font-size: 22px;
--md-sys-typescale-title-large-letter-spacing: 0;
--md-sys-typescale-title-large-line-height: 28px;
}

View File

@@ -0,0 +1,134 @@
.label-small {
font-family: var(--md-sys-typescale-label-small-font-family-name);
font-size: var(--md-sys-typescale-label-small-font-size);
font-style: var(--md-sys-typescale-label-small-font-family-style);
font-weight: var(--md-sys-typescale-label-small-font-weight);
letter-spacing: var(--md-sys-typescale-label-small-letter-spacing);
line-height: var(--md-sys-typescale-label-small-line-height);
}
.label-medium {
font-family: var(--md-sys-typescale-label-medium-font-family-name);
font-size: var(--md-sys-typescale-label-medium-font-size);
font-style: var(--md-sys-typescale-label-medium-font-family-style);
font-weight: var(--md-sys-typescale-label-medium-font-weight);
letter-spacing: var(--md-sys-typescale-label-medium-letter-spacing);
line-height: var(--md-sys-typescale-label-medium-line-height);
}
.label-large {
font-family: var(--md-sys-typescale-label-large-font-family-name);
font-size: var(--md-sys-typescale-label-large-font-size);
font-style: var(--md-sys-typescale-label-large-font-family-style);
font-weight: var(--md-sys-typescale-label-large-font-weight);
letter-spacing: var(--md-sys-typescale-label-large-letter-spacing);
line-height: var(--md-sys-typescale-label-large-line-height);
}
.body-small {
font-family: var(--md-sys-typescale-body-small-font-family-name);
font-size: var(--md-sys-typescale-body-small-font-size);
font-style: var(--md-sys-typescale-body-small-font-family-style);
font-weight: var(--md-sys-typescale-body-small-font-weight);
letter-spacing: var(--md-sys-typescale-body-small-letter-spacing);
line-height: var(--md-sys-typescale-body-small-line-height);
}
.body-medium {
font-family: var(--md-sys-typescale-body-medium-font-family-name);
font-size: var(--md-sys-typescale-body-medium-font-size);
font-style: var(--md-sys-typescale-body-medium-font-family-style);
font-weight: var(--md-sys-typescale-body-medium-font-weight);
letter-spacing: var(--md-sys-typescale-body-medium-letter-spacing);
line-height: var(--md-sys-typescale-body-medium-line-height);
}
.body-large {
font-family: var(--md-sys-typescale-body-large-font-family-name);
font-size: var(--md-sys-typescale-body-large-font-size);
font-style: var(--md-sys-typescale-body-large-font-family-style);
font-weight: var(--md-sys-typescale-body-large-font-weight);
letter-spacing: var(--md-sys-typescale-body-large-letter-spacing);
line-height: var(--md-sys-typescale-body-large-line-height);
}
.headline-small {
font-family: var(--md-sys-typescale-headline-small-font-family-name);
font-size: var(--md-sys-typescale-headline-small-font-size);
font-style: var(--md-sys-typescale-headline-small-font-family-style);
font-weight: var(--md-sys-typescale-headline-small-font-weight);
letter-spacing: var(--md-sys-typescale-headline-small-letter-spacing);
line-height: var(--md-sys-typescale-headline-small-line-height);
}
.headline-medium {
font-family: var(--md-sys-typescale-headline-medium-font-family-name);
font-size: var(--md-sys-typescale-headline-medium-font-size);
font-style: var(--md-sys-typescale-headline-medium-font-family-style);
font-weight: var(--md-sys-typescale-headline-medium-font-weight);
letter-spacing: var(--md-sys-typescale-headline-medium-letter-spacing);
line-height: var(--md-sys-typescale-headline-medium-line-height);
}
.headline-large {
font-family: var(--md-sys-typescale-headline-large-font-family-name);
font-size: var(--md-sys-typescale-headline-large-font-size);
font-style: var(--md-sys-typescale-headline-large-font-family-style);
font-weight: var(--md-sys-typescale-headline-large-font-weight);
letter-spacing: var(--md-sys-typescale-headline-large-letter-spacing);
line-height: var(--md-sys-typescale-headline-large-line-height);
}
.display-small {
font-family: var(--md-sys-typescale-display-small-font-family-name);
font-size: var(--md-sys-typescale-display-small-font-size);
font-style: var(--md-sys-typescale-display-small-font-family-style);
font-weight: var(--md-sys-typescale-display-small-font-weight);
letter-spacing: var(--md-sys-typescale-display-small-letter-spacing);
line-height: var(--md-sys-typescale-display-small-line-height);
}
.display-medium {
font-family: var(--md-sys-typescale-display-medium-font-family-name);
font-size: var(--md-sys-typescale-display-medium-font-size);
font-style: var(--md-sys-typescale-display-medium-font-family-style);
font-weight: var(--md-sys-typescale-display-medium-font-weight);
letter-spacing: var(--md-sys-typescale-display-medium-letter-spacing);
line-height: var(--md-sys-typescale-display-medium-line-height);
}
.display-large {
font-family: var(--md-sys-typescale-display-large-font-family-name);
font-size: var(--md-sys-typescale-display-large-font-size);
font-style: var(--md-sys-typescale-display-large-font-family-style);
font-weight: var(--md-sys-typescale-display-large-font-weight);
letter-spacing: var(--md-sys-typescale-display-large-letter-spacing);
line-height: var(--md-sys-typescale-display-large-line-height);
}
.title-small {
font-family: var(--md-sys-typescale-title-small-font-family-name);
font-size: var(--md-sys-typescale-title-small-font-size);
font-style: var(--md-sys-typescale-title-small-font-family-style);
font-weight: var(--md-sys-typescale-title-small-font-weight);
letter-spacing: var(--md-sys-typescale-title-small-letter-spacing);
line-height: var(--md-sys-typescale-title-small-line-height);
}
.title-medium {
font-family: var(--md-sys-typescale-title-medium-font-family-name);
font-size: var(--md-sys-typescale-title-medium-font-size);
font-style: var(--md-sys-typescale-title-medium-font-family-style);
font-weight: var(--md-sys-typescale-title-medium-font-weight);
letter-spacing: var(--md-sys-typescale-title-medium-letter-spacing);
line-height: var(--md-sys-typescale-title-medium-line-height);
}
.title-large {
font-family: var(--md-sys-typescale-title-large-font-family-name);
font-size: var(--md-sys-typescale-title-large-font-size);
font-style: var(--md-sys-typescale-title-large-font-family-style);
font-weight: var(--md-sys-typescale-title-large-font-weight);
letter-spacing: var(--md-sys-typescale-title-large-letter-spacing);
line-height: var(--md-sys-typescale-title-large-line-height);
}

View File

@@ -16,5 +16,5 @@
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "scripts"]
"exclude": ["node_modules", "scripts", "styles/font-faces.css"]
}

View File

@@ -3510,6 +3510,11 @@ stylelint-order@^3.1.1:
postcss "^7.0.17"
postcss-sorting "^5.0.1"
stylelint-use-logical@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/stylelint-use-logical/-/stylelint-use-logical-2.0.0.tgz#9fa9cffacf3d86ea4867477b0599127b05552f6e"
integrity sha512-4wRXETzWSF3yc9znj28VOZZ+VyVys1jeb6L341tit3KkKuAqib1PkGq5lQK0Xf2NhdoHkEHCaFSJfCL8u6UTOA==
stylelint@^14.10.0:
version "14.10.0"
resolved "https://registry.npmjs.org/stylelint/-/stylelint-14.10.0.tgz"