mirror of
https://codeberg.org/andyscott-pages/andyscott-dot-me.git
synced 2024-12-22 01:33:11 -05:00
adding store section and store horizontal component
This commit is contained in:
parent
82f17479bc
commit
5b5cb6da49
9 changed files with 99 additions and 3 deletions
BIN
public/squared_item.png
Normal file
BIN
public/squared_item.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8 KiB |
24
src/components/HorizontalShopItem.astro
Normal file
24
src/components/HorizontalShopItem.astro
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
const { title, img, desc, url, badge, tags, target = "_blank", pricing, oldPricing, checkoutUrl } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="rounded-lg bg-base-100 hover:shadow-xl transition ease-in-out hover:scale-[102%]">
|
||||||
|
<div class="hero-content flex-col md:flex-row">
|
||||||
|
<img src={img} alt={title} class="max-w-full md:max-w-[13rem] rounded-lg" />
|
||||||
|
<div class="grow w-full p-5 md:p-0">
|
||||||
|
<h1 class="text-xl font-bold">
|
||||||
|
{title}
|
||||||
|
{badge && <div class="badge badge-secondary mx-2">{badge}</div>}
|
||||||
|
</h1>
|
||||||
|
<div>
|
||||||
|
<span class="text-xl mr-1"> {pricing}</span>
|
||||||
|
<span class="text-md opacity-50 line-through">{oldPricing}</span>
|
||||||
|
</div>
|
||||||
|
<p class="py-1 text-1xl">{desc}</p>
|
||||||
|
<div class="card-actions md:justify-end mt-3 md:mt-0 flex">
|
||||||
|
<a class="btn btn-primary grow md:grow-0" href={checkoutUrl}>Buy Now</a>
|
||||||
|
<a href={url} class="btn btn-outline grow md:grow-0">Details </a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -14,6 +14,7 @@
|
||||||
<!-- Sidebar content here -->
|
<!-- Sidebar content here -->
|
||||||
<li><a href="/">Home</a></li>
|
<li><a href="/">Home</a></li>
|
||||||
<li><a href="/projects">Projects</a></li>
|
<li><a href="/projects">Projects</a></li>
|
||||||
|
<li><a href="/store/1">Store</a></li>
|
||||||
<li><a href="/blog/1">Blog</a></li>
|
<li><a href="/blog/1">Blog</a></li>
|
||||||
<li><a href="/cv">CV</a></li>
|
<li><a href="/cv">CV</a></li>
|
||||||
<li><a href="https://manuelernestog.github.io/paylink/" target="_blank">Support my Work</a></li>
|
<li><a href="https://manuelernestog.github.io/paylink/" target="_blank">Support my Work</a></li>
|
||||||
|
|
|
@ -12,7 +12,7 @@ export async function getStaticPaths({ paginate }) {
|
||||||
const { page } = Astro.props;
|
const { page } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout>
|
<BaseLayout title = "Blog">
|
||||||
<ul>
|
<ul>
|
||||||
<!--List the array of astronaut info-->
|
<!--List the array of astronaut info-->
|
||||||
{page.data.map(( post ) => (
|
{page.data.map(( post ) => (
|
||||||
|
|
|
@ -3,7 +3,7 @@ import BaseLayout from "../layouts/BaseLayout.astro";
|
||||||
import TimeLineElement from "../components/cv/TimeLine.astro";
|
import TimeLineElement from "../components/cv/TimeLine.astro";
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout>
|
<BaseLayout title = "Resume">
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<div class="text-3xl w-full font-bold">Profile</div>
|
<div class="text-3xl w-full font-bold">Profile</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import BaseLayout from "../layouts/BaseLayout.astro";
|
||||||
import HorizontalCard from "../components/HorizontalCard.astro";
|
import HorizontalCard from "../components/HorizontalCard.astro";
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout>
|
<BaseLayout title = "Projects">
|
||||||
<div>
|
<div>
|
||||||
<div class="text-3xl w-full font-bold mb-5">Projects Header</div>
|
<div class="text-3xl w-full font-bold mb-5">Projects Header</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
42
src/pages/store/[page].astro
Normal file
42
src/pages/store/[page].astro
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||||
|
import HorizontalShopItem from "../../components/HorizontalShopItem.astro";
|
||||||
|
|
||||||
|
export async function getStaticPaths({ paginate }) {
|
||||||
|
const posts = (await Astro.glob("./*.{md,mdx}")).sort(
|
||||||
|
(a, b) => new Date(b.frontmatter.pubDate).valueOf() - new Date(a.frontmatter.pubDate).valueOf()
|
||||||
|
);
|
||||||
|
|
||||||
|
return paginate(posts, { pageSize: 10 });
|
||||||
|
}
|
||||||
|
const { page } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title = "Store">
|
||||||
|
<ul>
|
||||||
|
<!--List the array of astronaut info-->
|
||||||
|
{page.data.map(( post ) => (
|
||||||
|
<HorizontalShopItem
|
||||||
|
title={post.frontmatter.title}
|
||||||
|
img={post.frontmatter.heroImage}
|
||||||
|
desc={post.frontmatter.description}
|
||||||
|
pricing={post.frontmatter.pricing}
|
||||||
|
oldPricing={post.frontmatter.oldPricing}
|
||||||
|
checkoutUrl={post.frontmatter.checkoutUrl}
|
||||||
|
badge={post.frontmatter.badge}
|
||||||
|
tags={post.frontmatter.tags}
|
||||||
|
url={post.url}
|
||||||
|
target="_self"
|
||||||
|
/>
|
||||||
|
<div class="divider my-0"></div>
|
||||||
|
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="flex justify-between">
|
||||||
|
{page.url.prev ? <a href={page.url.prev} class="btn btn-ghost my-10 mx-5" > <svg class="h-6 w-6 fill-current md:h-8 md:w-8" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"></path></svg> Recent posts</a> : <div></div>}
|
||||||
|
{page.url.next ? <a href={page.url.next} class="btn btn-ghost my-10 mx-5">Older Posts <svg class="h-6 w-6 fill-current md:h-8 md:w-8" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <path d="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"></path></svg></a> : <div></div>}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</BaseLayout>
|
15
src/pages/store/item1.md
Normal file
15
src/pages/store/item1.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
layout: "../../layouts/PostLayout.astro"
|
||||||
|
title: "Demo Item 1"
|
||||||
|
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
||||||
|
pubDate: "Sep 10 2022"
|
||||||
|
pricing: "$15"
|
||||||
|
badge: "Featured"
|
||||||
|
tags: ['Tag1','Tag2']
|
||||||
|
checkoutUrl: "https://github.com/"
|
||||||
|
heroImage: "/squared_item.png"
|
||||||
|
---
|
||||||
|
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||||
|
|
||||||
|
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
|
14
src/pages/store/item2.md
Normal file
14
src/pages/store/item2.md
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
layout: "../../layouts/PostLayout.astro"
|
||||||
|
title: "Demo Item 2"
|
||||||
|
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
|
||||||
|
pubDate: "Sep 11 2022"
|
||||||
|
pricing: "$10"
|
||||||
|
oldPricing: "$25.5"
|
||||||
|
checkoutUrl: "https://github.com/"
|
||||||
|
heroImage: "/squared_item.png"
|
||||||
|
---
|
||||||
|
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
|
||||||
|
|
||||||
|
Morbi tristique senectus et netus. Id semper risus in hendrerit gravida rutrum quisque non tellus. Habitasse platea dictumst quisque sagittis purus sit amet. Tellus molestie nunc non blandit massa. Cursus vitae congue mauris rhoncus. Accumsan tortor posuere ac ut. Fringilla urna porttitor rhoncus dolor. Elit ullamcorper dignissim cras tincidunt lobortis. In cursus turpis massa tincidunt dui ut ornare lectus. Integer feugiat scelerisque varius morbi enim nunc. Bibendum neque egestas congue quisque egestas diam. Cras ornare arcu dui vivamus arcu felis bibendum. Dignissim suspendisse in est ante in nibh mauris. Sed tempus urna et pharetra pharetra massa massa ultricies mi.
|
Loading…
Reference in a new issue