Skip to content

Commit

Permalink
Move relics page to main nav.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtoups committed Aug 22, 2021
1 parent 38b398d commit 5600899
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 47 deletions.
3 changes: 1 addition & 2 deletions scripts/components/poem/poem.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@
<a href="https://www.instagram.com/the.orb.astrology/" target="_blank" class="social-icon instagram"></a>
</div>
<nav class="aux">
<a data-bind="click: (data, event) => { vm.launchModal('relicsPlaceholder') }" href="#"><img src="/styles/png/relics.png"></a>
<a data-bind="click: (data, event) => { vm.launchModal('relics') }" href="#"><img src="/styles/png/relics.png"></a>
<a href="https://www.paypal.com/donate?hosted_button_id=PDE4GSNZWLD3G" target="_blank"><img src="/styles/png/tithe.png"></a>
<a data-bind="click: (data, event) => { vm.launchModal('clergy') }" href="#"><img src="/styles/png/clergy.png"></a>
</nav>
</div>
<div class="sacred-rites" data-bind="click: (data, event) => { vm.launchModal('relics') }"></div>
10 changes: 1 addition & 9 deletions scripts/components/relics/relics.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- ko if: ritePassed -->
<section data-bind="css: {masked: !ready()}">
<section>
<div class="content">

<div class="print-pitch" data-bind="if: vm.printScreenshot(), css: {masked: buying}">
Expand Down Expand Up @@ -104,10 +103,3 @@
</div>
</div>
</section>
<!-- /ko -->
<!-- ko if: !ritePassed() -->
<div class="rc">
<p>Awaiting sacred rites...</p>
<input data-bind="textInput: sacredRite">
</div>
<!-- /ko -->
42 changes: 7 additions & 35 deletions scripts/components/relics/relics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@ define(['ko', 'paypal', 'api'], (ko, paypal, api) => {
return function(params){
let self = this;

self.ready = ko.observable(false);
vm.modal.loadingComplete(false);
params.closeCb(() => { self.ready(false) });
self.ritePassed = ko.observable(false);
self.sacredRite = ko.observable();
self.sacredRite.subscribe(nv => {
if (nv.length > 3) {
try {
paypal.validateClergy(nv)
.then(response => {
if (response.status === 200) self.ritePassed(true)
else self.ritePassed(false);
});
} catch {
// shh
}
}
});

self.ready.subscribe(nv => {
vm.modal.modalLoading(!nv);
if (nv) { vm.modal.loadingComplete(true); }
});

self.buying = ko.observable(false);
self.initiateOrder = () => { self.buying(true) };
self.cancelOrder = () => { self.buying(false) };
Expand Down Expand Up @@ -166,7 +142,8 @@ define(['ko', 'paypal', 'api'], (ko, paypal, api) => {
}
})
self.mmTransitioning = ko.observable(false);


self.orderComplete = ko.observable(false);
self.saveOrderData = data => {
let body = {
orderName: self.name(),
Expand All @@ -191,16 +168,11 @@ define(['ko', 'paypal', 'api'], (ko, paypal, api) => {
});
};

self.orderComplete = ko.observable(false);
self.ritePassed.subscribe(nv => {
vm.modal.modalLoading(true);
paypal.createButton({
onApprove: self.saveOrderData,
state: self.ready,
address: self.ppAddress,
name: self.name
});
paypal.createButton({
onApprove: self.saveOrderData,
state: self.ready,
address: self.ppAddress,
name: self.name
});

}
});
2 changes: 1 addition & 1 deletion styles/components/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@include pseudo-clone('before');
&:before { content: none; }
&.loading-text:before {
content: "Please wait...";
content: "Loading...";
font-family: $serif;
font-style: italic;
display: flex;
Expand Down

0 comments on commit 5600899

Please sign in to comment.