Skip to content

Commit

Permalink
add graphics, button
Browse files Browse the repository at this point in the history
  • Loading branch information
jinkang-0 committed Jan 10, 2024
1 parent a9387c6 commit 8e5ccda
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
61 changes: 61 additions & 0 deletions src/components/Button.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
interface Props {
href?: string; // no href = disabled
primary?: boolean;
menu?: boolean;
}
const { href, primary, menu, ...rest } = Astro.props;
const classes = [];
if (!href) classes.push('disabled');
if (primary) classes.push('primary');
if (menu) classes.push('menu');
---

<a
class={classes.join(' ')}
href={href}
target="_blank"
referrerpolicy="no-referrer"
{...rest}
>
<slot />
</a>

<style lang="scss">
@use '../styles/colors';

a {
border-radius: 8px;
padding: 1.25rem;
background-color: colors.$secondary;
color: colors.$text;
display: flex;
width: fit-content;
align-items: center;
gap: 0.5rem;
cursor: pointer;
transition: 100ms;
}

a.menu {
padding: 0.75rem;
}

a.disabled {
cursor: default;
}

a:not(.disabled):hover {
filter: brightness(0.97);
}

a:not(.disabled):active {
filter: brightness(0.95);
}

a.primary {
background-color: colors.$primary;
}
</style>
11 changes: 11 additions & 0 deletions src/graphics/redirect_arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/graphics/stopwatch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8e5ccda

Please sign in to comment.