mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-24 03:36:22 +01:00
list of sponsors + fixes
- added list of sponsors, if you host an instance, it can be enabled with showSponsors. - fixed download button thickness on ios. - about button now opens about tab when no new changelog is available.
This commit is contained in:
parent
6c314a1a62
commit
a57ee53b21
15 changed files with 101 additions and 32 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "cobalt",
|
"name": "cobalt",
|
||||||
"description": "save what you love",
|
"description": "save what you love",
|
||||||
"version": "7.5.1",
|
"version": "7.6",
|
||||||
"author": "wukko",
|
"author": "wukko",
|
||||||
"exports": "./src/cobalt.js",
|
"exports": "./src/cobalt.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -74,5 +74,15 @@
|
||||||
"copy": ["-c:a", "copy"],
|
"copy": ["-c:a", "copy"],
|
||||||
"audio": ["-ar", "48000", "-ac", "2", "-b:a", "320k"],
|
"audio": ["-ar", "48000", "-ac", "2", "-b:a", "320k"],
|
||||||
"m4a": ["-movflags", "frag_keyframe+empty_moov"]
|
"m4a": ["-movflags", "frag_keyframe+empty_moov"]
|
||||||
}
|
},
|
||||||
|
"sponsors": [{
|
||||||
|
"name": "royale",
|
||||||
|
"fullName": "RoyaleHosting",
|
||||||
|
"url": "https://royalehosting.net/",
|
||||||
|
"logo": {
|
||||||
|
"width": 605,
|
||||||
|
"height": 136,
|
||||||
|
"scale": 5
|
||||||
|
}
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,10 +315,11 @@ button:active,
|
||||||
color: var(--accent);
|
color: var(--accent);
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 1.6rem;
|
font-size: 1.8rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
letter-spacing: -0.36rem;
|
letter-spacing: -0.35rem;
|
||||||
|
font-weight: normal!important;
|
||||||
}
|
}
|
||||||
#download-button:disabled {
|
#download-button:disabled {
|
||||||
color: var(--accent-subtext);
|
color: var(--accent-subtext);
|
||||||
|
@ -759,9 +760,6 @@ button:active,
|
||||||
user-select: none;
|
user-select: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
}
|
}
|
||||||
.collapse-list.last {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
.collapse-header {
|
.collapse-header {
|
||||||
padding: 0.5rem var(--padding-1);
|
padding: 0.5rem var(--padding-1);
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
|
@ -948,6 +946,27 @@ button:active,
|
||||||
.collapse-list.last.expanded .collapse-header {
|
.collapse-list.last.expanded .collapse-header {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
.sponsored-by-text {
|
||||||
|
text-align: center!important;
|
||||||
|
font-size: .85rem;
|
||||||
|
color: var(--accent-subtext);
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
#sponsored-logos {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.2rem 1rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
.sponsored-logo svg {
|
||||||
|
height: inherit;
|
||||||
|
width: inherit;
|
||||||
|
}
|
||||||
|
.sponsored-logo svg path {
|
||||||
|
fill: var(--accent-subtext);
|
||||||
|
}
|
||||||
/* prevent resizing fliecker on ios if web app is installed as standalone */
|
/* prevent resizing fliecker on ios if web app is installed as standalone */
|
||||||
@media all and (display-mode: standalone) {
|
@media all and (display-mode: standalone) {
|
||||||
#home.visible {
|
#home.visible {
|
||||||
|
@ -1092,7 +1111,7 @@ button:active,
|
||||||
}
|
}
|
||||||
.popup.small.visible {
|
.popup.small.visible {
|
||||||
transform: none;
|
transform: none;
|
||||||
transition: transform 200ms cubic-bezier(0.075, 0.82, 0.165, 1), opacity 130ms ease-in-out;
|
transition: transform 210ms cubic-bezier(0.062, 0.82, 0.165, 1), opacity 130ms ease-in-out;
|
||||||
}
|
}
|
||||||
.popup.small #popup-header {
|
.popup.small #popup-header {
|
||||||
background: none;
|
background: none;
|
||||||
|
|
|
@ -194,7 +194,7 @@ function popup(type, action, text) {
|
||||||
store.isPopupOpen = true;
|
store.isPopupOpen = true;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "about":
|
case "about":
|
||||||
let tabId = sGet("seenAbout") ? "changelog" : "about";
|
let tabId = sGet("changelogStatus") !== `${version}` ? "changelog" : "about";
|
||||||
if (text) tabId = text;
|
if (text) tabId = text;
|
||||||
eid(`tab-button-${type}-${tabId}`).click();
|
eid(`tab-button-${type}-${tabId}`).click();
|
||||||
break;
|
break;
|
||||||
|
|
1
src/front/sponsors/royale.svg
Normal file
1
src/front/sponsors/royale.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 5.5 KiB |
|
@ -144,6 +144,7 @@
|
||||||
"NewDomainWelcome": "cobalt is moving! same features, same owner, simply a more rememberable domain. and still no ads.\n\n<span class=\"text-backdrop\">cobalt.tools</span> is the new main domain, aka where you are now. make sure to update your bookmarks and reinstall the web app!",
|
"NewDomainWelcome": "cobalt is moving! same features, same owner, simply a more rememberable domain. and still no ads.\n\n<span class=\"text-backdrop\">cobalt.tools</span> is the new main domain, aka where you are now. make sure to update your bookmarks and reinstall the web app!",
|
||||||
"DataTransferSuccess": "btw, your settings have been transferred automatically :)",
|
"DataTransferSuccess": "btw, your settings have been transferred automatically :)",
|
||||||
"DataTransferError": "something went wrong when transferring your preferences. you'll have to open settings and configure cobalt by hand.",
|
"DataTransferError": "something went wrong when transferring your preferences. you'll have to open settings and configure cobalt by hand.",
|
||||||
"SupportNotAffiliated": "cobalt is <span class=\"text-backdrop\">not affiliated</span> with any services listed above."
|
"SupportNotAffiliated": "cobalt is <span class=\"text-backdrop\">not affiliated</span> with any services listed above.",
|
||||||
|
"SponsoredBy": "sponsored by"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,7 @@
|
||||||
"DataTransferSuccess": "кстати, твои настройки были перенесены автоматически :)",
|
"DataTransferSuccess": "кстати, твои настройки были перенесены автоматически :)",
|
||||||
"DataTransferError": "при переносе настроек что-то пошло не так. придётся зайти в настройки и настроить кобальт вручную.",
|
"DataTransferError": "при переносе настроек что-то пошло не так. придётся зайти в настройки и настроить кобальт вручную.",
|
||||||
"SupportNotAffiliated": "кобальт <span class=\"text-backdrop\">не аффилирован</span> ни с одним из перечисленных выше сервисов.",
|
"SupportNotAffiliated": "кобальт <span class=\"text-backdrop\">не аффилирован</span> ни с одним из перечисленных выше сервисов.",
|
||||||
"SupportMetaNoticeRU": "деятельность meta platforms inc. (владелец instagram) запрещена на территории россии."
|
"SupportMetaNoticeRU": "деятельность meta platforms inc. (владелец instagram) запрещена на территории россии.",
|
||||||
|
"SponsoredBy": "спонсируется"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { links, repo } from "../modules/config.js";
|
import { links, repo } from "../modules/config.js";
|
||||||
import loadJson from "../modules/sub/loadJSON.js";
|
import { loadJSON } from "../modules/sub/loadFromFs.js";
|
||||||
|
|
||||||
const locPath = './src/localization/languages';
|
const locPath = './src/localization/languages';
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ let languages = [];
|
||||||
export async function loadLoc() {
|
export async function loadLoc() {
|
||||||
const files = await fs.promises.readdir(locPath).catch((e) => { return [] });
|
const files = await fs.promises.readdir(locPath).catch((e) => { return [] });
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
loc[file.split('.')[0]] = loadJson(`${locPath}/${file}`);
|
loc[file.split('.')[0]] = loadJSON(`${locPath}/${file}`);
|
||||||
languages.push(file.split('.')[0])
|
languages.push(file.split('.')[0])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { replaceBase } from "../../localization/manager.js";
|
import { replaceBase } from "../../localization/manager.js";
|
||||||
import loadJSON from "../sub/loadJSON.js";
|
import { loadJSON } from "../sub/loadFromFs.js";
|
||||||
|
|
||||||
let changelog = loadJSON('./src/modules/changelog/changelog.json')
|
let changelog = loadJSON('./src/modules/changelog/changelog.json')
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import loadJson from "./sub/loadJSON.js";
|
import { loadJSON } from "./sub/loadFromFs.js";
|
||||||
const config = loadJson("./src/config.json");
|
const config = loadJSON("./src/config.json");
|
||||||
const packageJson = loadJson("./package.json");
|
const packageJson = loadJSON("./package.json");
|
||||||
const servicesConfigJson = loadJson("./src/modules/processing/servicesConfig.json");
|
const servicesConfigJson = loadJSON("./src/modules/processing/servicesConfig.json");
|
||||||
|
|
||||||
export const
|
export const
|
||||||
services = servicesConfigJson.config,
|
services = servicesConfigJson.config,
|
||||||
|
@ -16,4 +16,5 @@ export const
|
||||||
ffmpegArgs = config.ffmpegArgs,
|
ffmpegArgs = config.ffmpegArgs,
|
||||||
supportedAudio = config.supportedAudio,
|
supportedAudio = config.supportedAudio,
|
||||||
celebrations = config.celebrations,
|
celebrations = config.celebrations,
|
||||||
links = config.links
|
links = config.links,
|
||||||
|
sponsors = config.sponsors
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { authorInfo, celebrations } from "../config.js";
|
import { authorInfo, celebrations, sponsors } from "../config.js";
|
||||||
import emoji from "../emoji.js";
|
import emoji from "../emoji.js";
|
||||||
|
import { loadFile } from "../sub/loadFromFs.js";
|
||||||
|
|
||||||
export const backButtonSVG = `<svg width="22" height="22" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
export const backButtonSVG = `<svg width="22" height="22" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M14.1905 28.5L2 16L14.1905 3.5L16.2857 5.62054L7.65986 14.4654H30V17.5346H7.65986L16.2857 26.3516L14.1905 28.5Z" fill="#E1E1E1"/>
|
<path d="M14.1905 28.5L2 16L14.1905 3.5L16.2857 5.62054L7.65986 14.4654H30V17.5346H7.65986L16.2857 26.3516L14.1905 28.5Z" fill="#E1E1E1"/>
|
||||||
|
@ -255,3 +256,21 @@ export function webLoc(t, arr) {
|
||||||
}
|
}
|
||||||
return `{${base}};`
|
return `{${base}};`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function sponsoredList() {
|
||||||
|
let base = ``;
|
||||||
|
let altText = ``
|
||||||
|
for (let i = 0; i < sponsors.length; i++) {
|
||||||
|
let s = sponsors[i];
|
||||||
|
let loadedLogo = loadFile(`./src/front/sponsors/${s.name}.svg`);
|
||||||
|
|
||||||
|
altText += `${s.fullName ? s.fullName : s.name}, `;
|
||||||
|
base +=
|
||||||
|
`<a class="sponsored-logo ${s.name}"
|
||||||
|
href="${s.url}" target="_blank"
|
||||||
|
style="width: calc(${s.logo.width}px / ${s.logo.scale}); height: calc(${s.logo.height}px / ${s.logo.scale});">
|
||||||
|
${loadedLogo}
|
||||||
|
</a>`
|
||||||
|
}
|
||||||
|
return `<div id="sponsored-logos" aria-label="${altText.slice(0, -2)}">${base}</div>`
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { checkbox, collapsibleList, explanation, footerButtons, multiPagePopup, popup, popupWithBottomButtons, sep, settingsCategory, switcher, socialLink, socialLinks, urgentNotice, keyboardShortcuts, webLoc } from "./elements.js";
|
import { checkbox, collapsibleList, explanation, footerButtons, multiPagePopup, popup, popupWithBottomButtons, sep, settingsCategory, switcher, socialLink, socialLinks, urgentNotice, keyboardShortcuts, webLoc, sponsoredList } from "./elements.js";
|
||||||
import { services as s, authorInfo, version, repo, donations, supportedAudio } from "../config.js";
|
import { services as s, authorInfo, version, repo, donations, supportedAudio } from "../config.js";
|
||||||
import { getCommitInfo } from "../sub/currentCommit.js";
|
import { getCommitInfo } from "../sub/currentCommit.js";
|
||||||
import loc from "../../localization/manager.js";
|
import loc from "../../localization/manager.js";
|
||||||
|
@ -164,7 +164,17 @@ export default function(obj) {
|
||||||
title: `${emoji("📑")} ${t("CollapseLegal")}`,
|
title: `${emoji("📑")} ${t("CollapseLegal")}`,
|
||||||
body: t("FairUse")
|
body: t("FairUse")
|
||||||
}])
|
}])
|
||||||
}]
|
},
|
||||||
|
...(process.env.showSponsors ?
|
||||||
|
[{
|
||||||
|
text: t("SponsoredBy"),
|
||||||
|
classes: ["sponsored-by-text"],
|
||||||
|
nopadding: true
|
||||||
|
}, {
|
||||||
|
text: sponsoredList(),
|
||||||
|
raw: true
|
||||||
|
}] : []
|
||||||
|
)]
|
||||||
})
|
})
|
||||||
}, {
|
}, {
|
||||||
name: "changelog",
|
name: "changelog",
|
||||||
|
|
16
src/modules/sub/loadFromFs.js
Normal file
16
src/modules/sub/loadFromFs.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import * as fs from "fs";
|
||||||
|
|
||||||
|
export function loadJSON(path) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(fs.readFileSync(path, 'utf-8'))
|
||||||
|
} catch(e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export function loadFile(path) {
|
||||||
|
try {
|
||||||
|
return fs.readFileSync(path, 'utf-8')
|
||||||
|
} catch(e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,9 +0,0 @@
|
||||||
import * as fs from "fs";
|
|
||||||
|
|
||||||
export default function(path) {
|
|
||||||
try {
|
|
||||||
return JSON.parse(fs.readFileSync(path, 'utf-8'))
|
|
||||||
} catch(e) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@ import "dotenv/config";
|
||||||
|
|
||||||
import { getJSON } from "../modules/api.js";
|
import { getJSON } from "../modules/api.js";
|
||||||
import { services } from "../modules/config.js";
|
import { services } from "../modules/config.js";
|
||||||
import loadJSON from "../modules/sub/loadJSON.js";
|
import { loadJSON } from "../modules/sub/loadFromFs.js";
|
||||||
import { checkJSONPost } from "../modules/sub/utils.js";
|
import { checkJSONPost } from "../modules/sub/utils.js";
|
||||||
|
|
||||||
let tests = loadJSON('./src/test/tests.json');
|
let tests = loadJSON('./src/test/tests.json');
|
||||||
|
|
Loading…
Reference in a new issue