Skip to content

Commit

Permalink
add store page (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
MathyouMB authored Nov 15, 2021
1 parent 7c7436f commit 7cc38f1
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/scss/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@import "components/page-header";
@import "components/posts";
@import "components/overlaypost";
@import "components/store";
@import "components/team";
@import "components/team_card";
@import "components/event_card";
Expand Down
8 changes: 8 additions & 0 deletions assets/scss/components/_store.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.store-page {
min-height: 85vh;
height: fit-content;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
7 changes: 7 additions & 0 deletions content/store/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Store"
date: 2020-01-25T23:11:13Z
draft: false
url: "/store"
layout: store
---
147 changes: 147 additions & 0 deletions layouts/_default/store.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{{ define "main" }}
{{- partial "navbar_temp.html" . -}}
<div class="store-page">
<div id="product-component-1636959994799"></div>
<script type="text/javascript">
/*<![CDATA[*/
(function () {
var scriptURL =
"https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js";
if (window.ShopifyBuy) {
if (window.ShopifyBuy.UI) {
ShopifyBuyInit();
} else {
loadScript();
}
} else {
loadScript();
}
function loadScript() {
var script = document.createElement("script");
script.async = true;
script.src = scriptURL;
(
document.getElementsByTagName("head")[0] ||
document.getElementsByTagName("body")[0]
).appendChild(script);
script.onload = ShopifyBuyInit;
}
function ShopifyBuyInit() {
var client = ShopifyBuy.buildClient({
domain: "carletoncss.myshopify.com",
storefrontAccessToken: "d5a5f1618f7ea6ac7df47ce4d945a7d2",
});
ShopifyBuy.UI.onReady(client).then(function (ui) {
ui.createComponent("product", {
id: "7072036388920",
node: document.getElementById("product-component-1636959994799"),
moneyFormat: "%24%7B%7Bamount%7D%7D",
options: {
product: {
styles: {
product: {
"@media (min-width: 601px)": {
"max-width": "calc(25% - 20px)",
"margin-left": "20px",
"margin-bottom": "50px",
},
},
button: {
":hover": {
"background-color": "#ff0c46",
},
"background-color": "#c40729",
":focus": {
"background-color": "#ff0c46",
},
"border-radius": "8px",
"padding-left": "32px",
"padding-right": "32px",
},
},
text: {
button: "Add to cart",
},
},
productSet: {
styles: {
products: {
"@media (min-width: 601px)": {
"margin-left": "-20px",
},
},
},
},
modalProduct: {
contents: {
img: false,
imgWithCarousel: true,
button: false,
buttonWithQuantity: true,
},
styles: {
product: {
"@media (min-width: 601px)": {
"max-width": "100%",
"margin-left": "0px",
"margin-bottom": "0px",
},
},
button: {
":hover": {
"background-color": "#ff0c46",
},
"background-color": "#c40729",
":focus": {
"background-color": "#ff0c46",
},
"border-radius": "8px",
"padding-left": "32px",
"padding-right": "32px",
},
},
text: {
button: "Add to cart",
},
},
option: {},
cart: {
styles: {
button: {
":hover": {
"background-color": "#ff0c46",
},
"background-color": "#c40729",
":focus": {
"background-color": "#ff0c46",
},
"border-radius": "8px",
},
},
text: {
total: "Subtotal",
button: "Checkout",
},
},
toggle: {
styles: {
toggle: {
"background-color": "#c40729",
":hover": {
"background-color": "#ff0c46",
},
":focus": {
"background-color": "#ff0c46",
},
},
},
},
},
});
});
}
})();
/*]]>*/
</script>
</div>
{{ end }}
40 changes: 38 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7cc38f1

Please sign in to comment.