forked from betaflight/betaflight.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Fancier board docs (betaflight#446)
* Package: Add Lucide icon pack * Feature: Add spec highlight grid * Content: Update board docs with spec grid * Content: Update Airbot SuperF4 diagram
- Loading branch information
1 parent
a8084bd
commit 86ebee4
Showing
10 changed files
with
220 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-1.42 MB
(45%)
...iki/boards/current/AIRBOTSUPERF4/AIRBOTSUPERF4-images/AIRBOTSUPERF4-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from 'react'; | ||
|
||
export default function SpecBox({ icon, title, color, children, colSpan = 1 }) { | ||
let bgColor = ''; | ||
let primaryTextColor = ''; | ||
let secondaryTextColor = ''; | ||
let childFontSize = ''; | ||
|
||
switch (color) { | ||
case 'primary': | ||
bgColor = 'bg-primary-500'; | ||
primaryTextColor = 'text-black'; | ||
secondaryTextColor = 'text-black'; | ||
childFontSize = '2xl:text-3xl lg:text-xl text-3xl'; | ||
break; | ||
case 'secondary': | ||
bgColor = 'bg-primary-500/10'; | ||
primaryTextColor = 'text-primary-500'; | ||
secondaryTextColor = ''; | ||
childFontSize = '2xl:text-2xl lg:text-xl text-2xl'; | ||
break; | ||
case 'neutral': | ||
bgColor = 'bg-neutral-500/20'; | ||
primaryTextColor = ''; | ||
secondaryTextColor = ''; | ||
childFontSize = '2xl:text-2xl lg:text-xl text-2xl'; | ||
break; | ||
case 'neutral-light': | ||
bgColor = 'bg-neutral-500/10'; | ||
primaryTextColor = ''; | ||
secondaryTextColor = ''; | ||
childFontSize = '2xl:text-xl lg:text-xl text-xl'; | ||
break; | ||
default: | ||
bgColor = 'bg-neutral-500/10'; | ||
primaryTextColor = ''; | ||
secondaryTextColor = ''; | ||
childFontSize = '2xl:text-2xl lg:text-xl text-2xl'; | ||
} | ||
|
||
let colSpanClass = 'col-span-1'; | ||
|
||
switch (colSpan) { | ||
case 2: | ||
colSpanClass = 'col-span-2'; | ||
break; | ||
case 3: | ||
colSpanClass = 'col-span-3'; | ||
break; | ||
default: | ||
colSpanClass = 'col-span-1'; | ||
} | ||
|
||
return ( | ||
<div className={`${bgColor} ${colSpanClass} rounded-lg flex flex-col gap-2 p-4`}> | ||
<div className={`flex items-center gap-1 ${primaryTextColor}`}> | ||
{icon} | ||
<div className="font-bold">{title}</div> | ||
</div> | ||
<div className={`${secondaryTextColor} ${childFontSize} font-semibold`}>{children}</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.