mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-28 09:18:45 +00:00
Improve homepage (#245)
* Improve how generators are listed on home * Add some icons for generators * Remove debug * Refactor cachedFetch and use generated changelogs * Add limit to how many changes are shown by default * Add more generator icons * Refactor cards * Fix generator icons for light theme * Add more worldgen icons * Add remaining generator icons * Refactor navigation and badges style * Group on homepage for guides and tools * Fix header button style * Add versions and technical changelog to homepage * Make it clear that not all changes could be documented
This commit is contained in:
15
src/app/components/Badge.tsx
Normal file
15
src/app/components/Badge.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { hashString } from '../Utils.js'
|
||||
import { Octicon } from './index.js'
|
||||
|
||||
interface Props {
|
||||
label: string,
|
||||
active?: boolean,
|
||||
onClick?: (e: MouseEvent) => unknown,
|
||||
}
|
||||
export function Badge({ label, active, onClick }: Props) {
|
||||
const color = label === 'breaking' ? 5 : hashString(label) % 360
|
||||
return <div class={`badge${active ? ' active' : ''}${onClick ? ' clickable' : ''}`} style={`--tint: ${color}`} onClick={onClick}>
|
||||
{label === 'breaking' && Octicon.alert}
|
||||
{label}
|
||||
</div>
|
||||
}
|
||||
Reference in New Issue
Block a user