|
| 1 | +import { css, cx } from 'hono/css'; |
| 2 | + |
| 3 | +import theme from '../theme.ts'; |
| 4 | + |
| 5 | +const styles = { |
| 6 | + banner: css` |
| 7 | + color: ${theme.text.inverted}; |
| 8 | + display: flex; |
| 9 | + flex-direction: row; |
| 10 | + flex-wrap: wrap; |
| 11 | + align-items: center; |
| 12 | + position: relative; |
| 13 | + isolation: isolate; |
| 14 | + padding-top: ${theme.spacing(1)}; |
| 15 | + padding-bottom: ${theme.spacing(1)}; |
| 16 | +
|
| 17 | + &::before { |
| 18 | + content: ''; |
| 19 | + position: absolute; |
| 20 | + width: 100vw; |
| 21 | + left: 50%; |
| 22 | + transform: translateX(-50%); |
| 23 | + background: ${theme.background.brand}; |
| 24 | + top: 0; |
| 25 | + bottom: 0; |
| 26 | + z-index: -1; |
| 27 | + } |
| 28 | + `, |
| 29 | + intro: css` |
| 30 | + border-right: ${theme.spacing(0.25)} solid currentColor; |
| 31 | + margin: 0 ${theme.spacing(1)} 0 0; |
| 32 | + padding: 0 ${theme.spacing(1)} 0 0; |
| 33 | + font-size: ${theme.font.large.size}; |
| 34 | + font-weight: ${theme.font.large.weight}; |
| 35 | + `, |
| 36 | + text: css` |
| 37 | + margin: 0; |
| 38 | + `, |
| 39 | + link: css` |
| 40 | + color: currentColor; |
| 41 | + text-decoration: underline; |
| 42 | +
|
| 43 | + &:hover { |
| 44 | + text-decoration: none; |
| 45 | + } |
| 46 | + `, |
| 47 | +}; |
| 48 | + |
| 49 | +/** |
| 50 | + * Standard cdnjs HTML layout for the page pre-footer banner. |
| 51 | + * |
| 52 | + * @param props Component props. |
| 53 | + * @param props.class Optional additional class name(s) to apply to the banner. |
| 54 | + */ |
| 55 | +export default ({ class: className }: { class?: string | Promise<string> }) => ( |
| 56 | + <div class={cx(styles.banner, className)}> |
| 57 | + <p class={styles.intro}>Help support cdnjs</p> |
| 58 | + <p class={styles.text}> |
| 59 | + You can{' '} |
| 60 | + <a |
| 61 | + href="https://github.com/cdnjs/packages/issues" |
| 62 | + rel="noopener" |
| 63 | + class={styles.link} |
| 64 | + > |
| 65 | + contribute on GitHub |
| 66 | + </a>{' '} |
| 67 | + to get involved with cdnjs! Or, help fund the maintenance of cdnjs |
| 68 | + via{' '} |
| 69 | + <a |
| 70 | + href="https://github.com/cdnjs/packages?sponsor" |
| 71 | + rel="noopener" |
| 72 | + class={styles.link} |
| 73 | + > |
| 74 | + GitHub Sponsors |
| 75 | + </a> |
| 76 | + ,{' '} |
| 77 | + <a |
| 78 | + href="https://opencollective.com/cdnjs" |
| 79 | + rel="noopener" |
| 80 | + class={styles.link} |
| 81 | + > |
| 82 | + Open Collective |
| 83 | + </a> |
| 84 | + , or{' '} |
| 85 | + <a |
| 86 | + href="https://www.patreon.com/cdnjs" |
| 87 | + rel="noopener" |
| 88 | + class={styles.link} |
| 89 | + > |
| 90 | + Patreon |
| 91 | + </a> |
| 92 | + . |
| 93 | + </p> |
| 94 | + </div> |
| 95 | +); |
0 commit comments