redesign basics template (#4879)
This commit is contained in:
parent
0722ae0251
commit
d37a840cd2
3 changed files with 34 additions and 88 deletions
|
@ -11,8 +11,7 @@ const { href, title, body } = Astro.props;
|
||||||
<li class="link-card">
|
<li class="link-card">
|
||||||
<a href={href}>
|
<a href={href}>
|
||||||
<h2>
|
<h2>
|
||||||
{title}
|
{title} <span>→</span>
|
||||||
<span>→</span>
|
|
||||||
</h2>
|
</h2>
|
||||||
<p>
|
<p>
|
||||||
{body}
|
{body}
|
||||||
|
@ -20,57 +19,44 @@ const { href, title, body } = Astro.props;
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<style>
|
<style>
|
||||||
:root {
|
|
||||||
--link-gradient: linear-gradient(45deg, #4f39fa, #da62c4 30%, var(--color-border) 60%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.link-card {
|
.link-card {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0.15rem;
|
padding: 0.15rem;
|
||||||
background-image: var(--link-gradient);
|
background-color: white;
|
||||||
|
background-image: var(--accent-gradient);
|
||||||
background-size: 400%;
|
background-size: 400%;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
background-position: 100%;
|
background-position: 100%;
|
||||||
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
transition: background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
box-shadow: 0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-card > a {
|
.link-card > a {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
padding: 1em 1.3em;
|
padding: 1rem 1.3rem;
|
||||||
border-radius: 0.35rem;
|
border-radius: 0.35rem;
|
||||||
color: var(--text-color);
|
color: #111;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
font-size: 1.25rem;
|
||||||
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin-top: 0.75rem;
|
margin-top: 0.5rem;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
color: #444;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 span {
|
|
||||||
display: inline-block;
|
|
||||||
transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.link-card:is(:hover, :focus-within) {
|
.link-card:is(:hover, :focus-within) {
|
||||||
background-position: 0;
|
background-position: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-card:is(:hover, :focus-within) h2 {
|
.link-card:is(:hover, :focus-within) h2 {
|
||||||
color: #4f39fa;
|
color: rgb(var(--accent));
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-card:is(:hover, :focus-within) h2 span {
|
|
||||||
will-change: transform;
|
|
||||||
transform: translateX(2px);
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -19,40 +19,15 @@ const { title } = Astro.props;
|
||||||
<slot />
|
<slot />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<style>
|
<style is:global>
|
||||||
:root {
|
:root {
|
||||||
--font-size-base: clamp(1rem, 0.34vw + 0.91rem, 1.19rem);
|
--accent: 124, 58, 237;
|
||||||
--font-size-lg: clamp(1.2rem, 0.7vw + 1.2rem, 1.5rem);
|
--accent-gradient: linear-gradient(45deg, rgb(var(--accent)), #da62c4 30%, white 60%);
|
||||||
--font-size-xl: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
|
|
||||||
|
|
||||||
--color-text: hsl(12, 5%, 4%);
|
|
||||||
--color-bg: hsl(10, 21%, 95%);
|
|
||||||
--color-border: hsl(17, 24%, 90%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
font-family: system-ui, sans-serif;
|
font-family: system-ui, sans-serif;
|
||||||
font-size: var(--font-size-base);
|
background-color: #F6F6F6;
|
||||||
color: var(--color-text);
|
|
||||||
background-color: var(--color-bg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style is:global>
|
|
||||||
h1 {
|
|
||||||
font-size: var(--font-size-xl);
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: var(--font-size-lg);
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
|
||||||
Bitstream Vera Sans Mono, Courier New, monospace;
|
Bitstream Vera Sans Mono, Courier New, monospace;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import Card from '../components/Card.astro';
|
||||||
<main>
|
<main>
|
||||||
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
|
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
|
||||||
<p class="instructions">
|
<p class="instructions">
|
||||||
Check out the <code>src/pages</code> directory to get started.<br />
|
To get started, open the directory <code>src/pages</code> in your project.<br />
|
||||||
<strong>Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
|
<strong>Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
|
||||||
</p>
|
</p>
|
||||||
<ul role="list" class="link-card-grid">
|
<ul role="list" class="link-card-grid">
|
||||||
|
@ -28,7 +28,7 @@ import Card from '../components/Card.astro';
|
||||||
/>
|
/>
|
||||||
<Card
|
<Card
|
||||||
href="https://astro.build/chat/"
|
href="https://astro.build/chat/"
|
||||||
title="Chat"
|
title="Community"
|
||||||
body="Come say hi to our amazing Discord community. ❤️"
|
body="Come say hi to our amazing Discord community. ❤️"
|
||||||
/>
|
/>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -36,57 +36,42 @@ import Card from '../components/Card.astro';
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
:root {
|
|
||||||
--astro-gradient: linear-gradient(0deg, #4f39fa, #da62c4);
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin: 2rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
main {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
padding: 1em;
|
padding: 1.5rem;
|
||||||
max-width: 60ch;
|
max-width: 60ch;
|
||||||
}
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 3rem;
|
||||||
|
font-weight: 800;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
.text-gradient {
|
.text-gradient {
|
||||||
font-weight: 900;
|
background-image: var(--accent-gradient);
|
||||||
background-image: var(--astro-gradient);
|
|
||||||
-webkit-background-clip: text;
|
-webkit-background-clip: text;
|
||||||
-webkit-text-fill-color: transparent;
|
-webkit-text-fill-color: transparent;
|
||||||
background-size: 100% 200%;
|
background-size: 400%;
|
||||||
background-position-y: 100%;
|
background-position: 0%;
|
||||||
border-radius: 0.4rem;
|
|
||||||
animation: pulse 4s ease-in-out infinite;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes pulse {
|
|
||||||
0%,
|
|
||||||
100% {
|
|
||||||
background-position-y: 0%;
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
background-position-y: 80%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.instructions {
|
.instructions {
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
background: #4f39fa;
|
border: 1px solid rgba(var(--accent), 25%);
|
||||||
|
background-color: white;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border-radius: 0.4rem;
|
border-radius: 0.4rem;
|
||||||
color: var(--color-bg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.instructions code {
|
.instructions code {
|
||||||
font-size: 0.875em;
|
font-size: 0.875em;
|
||||||
border: 0.1em solid var(--color-border);
|
font-weight: bold;
|
||||||
|
background: rgba(var(--accent), 12%);
|
||||||
|
color: rgb(var(--accent));
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0.15em 0.25em;
|
padding: 0.3em 0.45em;
|
||||||
|
}
|
||||||
|
.instructions strong {
|
||||||
|
color: rgb(var(--accent));
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-card-grid {
|
.link-card-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
|
||||||
|
|
Loading…
Add table
Reference in a new issue