4.4: new donations popup

this was done in my ongoing effort to renovate and simplify all parts of cobalt web interface
This commit is contained in:
wukko
2022-11-20 19:46:08 +06:00
parent 9f58fbff1c
commit e03b1d3e83
12 changed files with 73 additions and 33 deletions

View File

@@ -1,10 +1,15 @@
{
"current": {
"version": "4.4",
"title": "over 1 million monthly requests. thank you.",
"banner": "onemillionr.webp",
"content": "this is a huge milestone for me, i cannot express enough how grateful i am for each and every one of you.\nthank you for using cobalt, and thank you for showing that people love the web that's friendly and bullshit-free. i'm hoping to never disappoint you in the future and keep up the good work.\n\nthank you <3\n\nif you want to thank ME, check out the renovated donations tab, which now is also linked alongside bottom action buttons."
},
"history": [{
"version": "4.3.2",
"title": "twitter improvements & changelog overhaul",
"content": "- you can download explicit content from twitter.\n- direct video links from twitter are properly supported (video/1, video/2, etc.).\n- changelog history got support for banners.\n- changelog categories are not messy anymore.\n- {appName} version in changelogs is now highlighted.\n- changelog history got separators to make text easier to read.\n- changelog history can be collapsed after loading.\n- download button takes less time to change back to pressable state.\n\nif you're a developer and would like to play around with cobalt's api, then read more about it in older changelogs below!"
},
"history": [{
}, {
"version": "4.3",
"title": "developers, developers, developers, developers",
"banner": "developersdevelopersdevelopers.webp",

View File

@@ -17,7 +17,8 @@ const names = {
"🎄": "christmas_tree",
"🕯️": "candle",
"😺": "cat",
"🐶": "dog"
"🐶": "dog",
"🎂": "cake"
}
let sizing = {
22: 0.4,

View File

@@ -129,7 +129,13 @@ export function footerButtons(obj) {
items += `<button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="${obj[i]["action"]}()" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>`;
break;
case "popup":
items += `<div class="footer-pair"><button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="popup('${obj[i]["name"]}', 1)" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button><button id="${obj[i+1]["name"]}-footer" class="switch footer-button" onclick="popup('${obj[i+1]["name"]}', 1)" aria-label="${obj[i+1]["aria"]}">${obj[i+1]["text"]}</button></div>`;
let context = obj[i]["context"] ? `, '${obj[i]["context"]}'` : ''
let context2 = obj[i+1] && obj[i+1]["context"] ? `, '${obj[i+1]["context"]}'` : ''
items += `
<div class="footer-pair">
<button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="popup('${obj[i]["name"]}', 1${context})" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>
${obj[i+1] ? `<button id="${obj[i+1]["name"]}-footer" class="switch footer-button" onclick="popup('${obj[i+1]["name"]}', 1${context2})" aria-label="${obj[i+1]["aria"]}">${obj[i+1]["text"]}</button>`: ''}
</div>`;
i++;
break;
}

View File

@@ -19,8 +19,8 @@ let audioFormats = supportedAudio.map((p) => {
return { "action": p }
})
audioFormats.unshift({ "action": "best" })
for (let i in donations["other"]) {
donateLinks += `<a id="don-${i}" class="switch autowidth" href="${donations["other"][i]}" target="_blank">${i}</a>`
for (let i in donations["links"]) {
donateLinks += `<a id="don-${i}" class="switch autowidth" href="${donations["links"][i]}" target="_blank">REPLACEME ${i}</a>`
}
let extr = ''
for (let i in donations["crypto"]) {
@@ -135,22 +135,31 @@ export default function(obj) {
header: {
closeAria: loc(obj.lang, 'AccessibilityClosePopup'),
title: emoji("💸", 30) + loc(obj.lang, 'TitlePopupDonate'),
subtitle: loc(obj.lang, 'DonateSubtitle')
subtitle: loc(obj.lang, 'DonateSub')
},
body: [{
text: donateLinks,
text: `<div class="changelog-banner"><img class="changelog-img" src="updateBanners/catsleep.webp" onerror="this.style.display='none'"></img></div>`,
raw: true
},{
text: loc(obj.lang, 'DonateExplanation')
}, {
text: donateLinks.replace(/REPLACEME/g, loc(obj.lang, 'DonateVia')),
raw: true
}, {
text: loc(obj.lang, 'DonateLinksDescription'),
classes: ["explanation"]
}, {
text: donate.replace(/REPLACEME/g, loc(obj.lang, 'ClickToCopy'))
text: `<div class="separator"></div>`,
raw: true
}, {
text: loc(obj.lang, 'DonateDescription'),
classes: ["explanation", "no-top-padding"]
text: donate.replace(/REPLACEME/g, loc(obj.lang, 'ClickToCopy')),
classes: ["desc-padding"]
}, {
text: backdropLink(authorInfo.contact, loc(obj.lang, 'LinkDonateContact')),
classes: ["bottom-link"]
text: `<div class="separator"></div>`,
raw: true
}, {
text: loc(obj.lang, 'DonateHireMe', authorInfo.link),
classes: ["desc-padding"]
}]
})
}],
@@ -314,6 +323,12 @@ export default function(obj) {
type: "popup",
text: `${emoji(celebrationsEmoji() , 22)} ${loc(obj.lang, 'AboutTab')}`,
aria: loc(obj.lang, 'AccessibilityOpenAbout')
}, {
name: "about",
type: "popup",
context: "donate",
text: `${emoji("💰", 22)} ${loc(obj.lang, 'Donate')}`,
aria: loc(obj.lang, 'AccessibilityOpenDonate')
}, {
name: "settings",
type: "popup",