-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fabricius Seifert
committed
Jun 14, 2024
1 parent
24b358e
commit b42366f
Showing
10 changed files
with
357 additions
and
186 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
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,140 @@ | ||
--- | ||
const { title, variant = "primary", href } = Astro.props; | ||
--- | ||
|
||
<a | ||
class=`unset mt-2 mb-2 mx-auto c_Button c_Button--${variant} c_Button--size-normal` | ||
href={href} | ||
> | ||
<span class="c_Button__inner">{title}</span> | ||
</a> | ||
|
||
<style> | ||
.c_Button--size-normal { | ||
--button-height: 50px; | ||
} | ||
|
||
.c_Button--size-small { | ||
--button-height: 40px; | ||
} | ||
|
||
a.c_Button { | ||
text-decoration: none; | ||
display: inline-block; | ||
height: var(--button-height); | ||
border-radius: calc(var(--button-height) / 2); | ||
padding: 2px; | ||
border: 0; | ||
background: linear-gradient(180deg, rgb(168, 168, 168), rgb(255, 255, 255)), | ||
var(--accent-color); | ||
box-shadow: 0 -2px 3px rgb(229, 229, 229), 0 2px 3px 2px rgb(255, 255, 255), | ||
0 0 25px rgba(0, 0, 0, 0.05), 0 -10px 5px rgb(255, 255, 255) inset; | ||
position: relative; | ||
text-transform: uppercase; | ||
letter-spacing: 0.3em; | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
text-decoration: none; | ||
font-size: 16px; | ||
} | ||
|
||
.c_Button--primary { | ||
--accent-color: #ff5a55; | ||
color: #fff; | ||
} | ||
|
||
.c_Button--secondary { | ||
--accent-color: #ffffff; | ||
color: #000; | ||
} | ||
|
||
.c_Button--rounded.c_Button--size-normal { | ||
@media (max-width: 499px) { | ||
--button-height: 40px; | ||
} | ||
@media (min-width: 500px) { | ||
--button-height: 66px; | ||
} | ||
width: var(--button-height); | ||
} | ||
|
||
.c_Button--rounded.c_Button--size-small { | ||
--button-height: 40px; | ||
|
||
width: var(--button-height); | ||
} | ||
|
||
.c_Button--rounded .c_Button__inner { | ||
padding: 0; | ||
} | ||
|
||
@media (max-width: 499px) { | ||
.c_Button--rounded svg { | ||
width: 20px; | ||
height: 20px; | ||
} | ||
} | ||
|
||
.c_Button[disabled] { | ||
--accent-color: #d3d3d3; | ||
pointer-events: none; | ||
} | ||
|
||
.c_Button::before { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
border-radius: inherit; | ||
left: 0; | ||
background: linear-gradient( | ||
0deg, | ||
rgba(0, 0, 0, 0.19), | ||
rgba(255, 255, 255, 0.3) | ||
), | ||
var(--accent-color); | ||
content: ""; | ||
box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.1); | ||
display: block; | ||
transition: transform 0.3s, box-shadow 0.3s, background 0.1s 0.2s; | ||
} | ||
|
||
.c_Button__inner { | ||
position: relative; | ||
padding-left: 30px; | ||
padding-right: 30px; | ||
background-color: var(--accent-color); | ||
height: calc(var(--button-height) - 4px); | ||
border-radius: inherit; | ||
display: grid; | ||
place-content: center; | ||
transition: transform 0.3s, background 0.3s, box-shadow 0.3s; | ||
-webkit-user-select: none; /* Safari */ | ||
-ms-user-select: none; /* IE 10 and IE 11 */ | ||
user-select: none; | ||
white-space: nowrap; | ||
} | ||
|
||
.c_Button:hover .c_Button__inner, | ||
.c_Button:focus .c_Button__inner { | ||
background: linear-gradient(0deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05)), | ||
var(--accent-color); | ||
} | ||
|
||
.c_Button:active::before { | ||
background: linear-gradient(0deg, rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0.16)), | ||
var(--accent-color); | ||
box-shadow: 0 0 3px rgba(0, 0, 0, 0.6) inset, | ||
0 2px 1px -1px rgba(0, 0, 0, 0.1); | ||
transform: scale(0.97); | ||
transition: all 0.1s, background 0.05s; | ||
} | ||
|
||
.c_Button:active .c_Button__inner { | ||
transform: scale(0.97); | ||
background: linear-gradient(0deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), | ||
var(--accent-color); | ||
transition: all 0.1s; | ||
box-shadow: 0 5px 5px rgba(0, 0, 0, 0.2) inset, | ||
0 -3px 3px rgba(255, 255, 255, 0.2) inset; | ||
} | ||
</style> |
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
Oops, something went wrong.