Skip to content

Commit

Permalink
Prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
Pseudonian committed Jan 19, 2025
1 parent 431a533 commit 30de530
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 8 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added Pictures/.DS_Store
Binary file not shown.
Binary file added Pictures/PseudoShop/.DS_Store
Binary file not shown.
Binary file added Pictures/PseudoShop/ascended-monthly-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Pictures/PseudoShop/omega-monthly-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Pictures/PseudoShop/transcended-monthly-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Pictures/ascended-monthly-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Pictures/omega-monthly-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Pictures/reincarnated-monthly-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Pictures/transcended-monthly-sub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Synergism.css
Original file line number Diff line number Diff line change
Expand Up @@ -4037,6 +4037,11 @@ form input:hover {
margin-top: 8px;
}

.pseudoCoinSubImage {
height: 48px;
width: 48px;
}

.pseudoCoinText {
width: 90%;
height: 80px;
Expand Down
23 changes: 15 additions & 8 deletions src/purchases/SubscriptionsSubtab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ const formatter = Intl.NumberFormat('en-US', {
})

const tierCosts = [0, 300, 600, 1000, 2000]

async function changeSubscription (productId: string, type: 'upgrade' | 'downgrade') {
const confirm = await Confirm('confirm message here')

const tier = upgradeResponse.tier
const existingCosts = tierCosts[tier] ?? 0
const newSub = subscriptionProducts.find((v) => v.id === productId)
const newSubPrice = newSub!.price
const newSubName = newSub!.name
const confirm = (type === 'downgrade') ?
await Confirm(`You are downgrading to ${newSubName}, which costs ${formatter.format((existingCosts - newSubPrice)/100)} less per month. New cost: ${formatter.format(newSubPrice / 100)} per month. Downgrading takes effect immediately!`) :
await Confirm(`You are upgrading to ${newSubName}, which costs ${formatter.format((newSubPrice - existingCosts)/100)} more per month. New cost: ${formatter.format(newSubPrice / 100)} per month`)

if (!confirm) {
return
Expand All @@ -30,9 +38,8 @@ async function changeSubscription (productId: string, type: 'upgrade' | 'downgra
const response = await fetch(url, {
method: 'POST'
})

// TODO: something
console.log(response, await response.text())
console.log(response, response.text())
return Alert(`You are now subscribed to ${newSubName}!`)
}

function clickHandler (this: HTMLButtonElement, e: HTMLElementEventMap['click']) {
Expand Down Expand Up @@ -76,7 +83,7 @@ export const createIndividualSubscriptionHTML = (product: Product, existingCosts
return `
<section class="subscriptionContainer" key="${product.id}">
<div>
<img class="pseudoCoinImage" alt="${product.name}" src="./Pictures/${product.id}.png" />
<img class="pseudoCoinSubImage" alt="${product.name}" src="./Pictures/${product.id}.png" />
<p class="pseudoCoinText">
${product.name.split(' - ').join('<br>')}
</p>
Expand All @@ -93,7 +100,7 @@ export const createIndividualSubscriptionHTML = (product: Product, existingCosts
return `
<section class="subscriptionContainer" key="${product.id}">
<div>
<img class="pseudoCoinImage" alt="${product.name}" src="./Pictures/${product.id}.png" />
<img class="pseudoCoinSubImage" alt="${product.name}" src="./Pictures/${product.id}.png" />
<p class="pseudoCoinText">
${product.name.split(' - ').join('<br>')}
</p>
Expand All @@ -110,7 +117,7 @@ export const createIndividualSubscriptionHTML = (product: Product, existingCosts
return `
<section class="subscriptionContainer" key="${product.id}">
<div>
<img class="pseudoCoinImage" alt="${product.name}" src="./Pictures/${product.id}.png" />
<img class="pseudoCoinSubImage" alt="${product.name}" src="./Pictures/${product.id}.png" />
<p class="pseudoCoinText">
${product.name.split(' - ').join('<br>')}
</p>
Expand Down

0 comments on commit 30de530

Please sign in to comment.