chore: formatting

This commit is contained in:
Kainoa Kanter 2023-05-12 20:11:41 -07:00
parent 26aa19c9cc
commit 8877598799
11 changed files with 1101 additions and 453 deletions

View File

@ -1,11 +1,15 @@
export class PreventAiLearning1683682889948 { export class PreventAiLearning1683682889948 {
name = 'PreventAiLearning1683682889948' name = "PreventAiLearning1683682889948";
async up(queryRunner) { async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "user_profile" ADD "preventAiLearning" boolean NOT NULL DEFAULT true`); await queryRunner.query(
} `ALTER TABLE "user_profile" ADD "preventAiLearning" boolean NOT NULL DEFAULT true`,
);
}
async down(queryRunner) { async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "preventAiLearning"`); await queryRunner.query(
} `ALTER TABLE "user_profile" DROP COLUMN "preventAiLearning"`,
);
}
} }

View File

@ -192,7 +192,8 @@ export default define(meta, paramDef, async (ps, _user, token) => {
if (typeof ps.autoAcceptFollowed === "boolean") if (typeof ps.autoAcceptFollowed === "boolean")
profileUpdates.autoAcceptFollowed = ps.autoAcceptFollowed; profileUpdates.autoAcceptFollowed = ps.autoAcceptFollowed;
if (typeof ps.noCrawle === "boolean") profileUpdates.noCrawle = ps.noCrawle; if (typeof ps.noCrawle === "boolean") profileUpdates.noCrawle = ps.noCrawle;
if (typeof ps.preventAiLearning === "boolean") profileUpdates.preventAiLearning = ps.preventAiLearning; if (typeof ps.preventAiLearning === "boolean")
profileUpdates.preventAiLearning = ps.preventAiLearning;
if (typeof ps.isCat === "boolean") updates.isCat = ps.isCat; if (typeof ps.isCat === "boolean") updates.isCat = ps.isCat;
if (typeof ps.speakAsCat === "boolean") updates.speakAsCat = ps.speakAsCat; if (typeof ps.speakAsCat === "boolean") updates.speakAsCat = ps.speakAsCat;
if (typeof ps.injectFeaturedNote === "boolean") if (typeof ps.injectFeaturedNote === "boolean")

File diff suppressed because it is too large Load Diff

View File

@ -146,8 +146,18 @@ export default defineComponent({
backdrop-filter: var(--blur, blur(20px)); backdrop-filter: var(--blur, blur(20px));
margin-inline: -12px; margin-inline: -12px;
padding-inline: 12px; padding-inline: 12px;
mask: linear-gradient(to right, transparent, black 12px calc(100% - 12px), transparent); mask: linear-gradient(
-webkit-mask: linear-gradient(to right, transparent, black 12px calc(100% - 12px), transparent); to right,
transparent,
black 12px calc(100% - 12px),
transparent
);
-webkit-mask: linear-gradient(
to right,
transparent,
black 12px calc(100% - 12px),
transparent
);
> .title { > .title {
margin: 0; margin: 0;

View File

@ -33,7 +33,12 @@
<div class="wrmlmaau"> <div class="wrmlmaau">
<div <div
class="content" class="content"
:class="{ collapsed, isLong, showContent: note.cw && !showContent, disableAnim: disableMfm }" :class="{
collapsed,
isLong,
showContent: note.cw && !showContent,
disableAnim: disableMfm,
}"
> >
<XCwButton <XCwButton
ref="cwButton" ref="cwButton"
@ -179,7 +184,9 @@ const urls = props.note.text
let showContent = $ref(false); let showContent = $ref(false);
const mfms = props.note.text ? extractMfmWithAnimation(mfm.parse(props.note.text)) : null; const mfms = props.note.text
? extractMfmWithAnimation(mfm.parse(props.note.text))
: null;
const hasMfm = $ref(mfms.length > 0); const hasMfm = $ref(mfms.length > 0);
@ -193,7 +200,7 @@ async function toggleMfm() {
text: i18n.ts._mfm.warn, text: i18n.ts._mfm.warn,
}); });
if (canceled) return; if (canceled) return;
defaultStore.set("animatedMfmWarnShown", true); defaultStore.set("animatedMfmWarnShown", true);
} }

View File

@ -49,7 +49,7 @@
</h2> </h2>
<h3>{{ i18n.ts._tutorial.step1_1 }}</h3> <h3>{{ i18n.ts._tutorial.step1_1 }}</h3>
<div>{{ i18n.ts._tutorial.step1_2 }}</div> <div>{{ i18n.ts._tutorial.step1_2 }}</div>
<!-- TODO: move to new slide --> <!-- TODO: move to own slide -->
<!-- <FormSwitch v-model="autoplayMfm" class="_formBlock"> <!-- <FormSwitch v-model="autoplayMfm" class="_formBlock">
{{ i18n.ts._mfm.alwaysPlay }} {{ i18n.ts._mfm.alwaysPlay }}
<template #caption> <template #caption>
@ -191,7 +191,7 @@
primary primary
show-only-to-register show-only-to-register
/> />
</div> </section>
</Transition> </Transition>
</div> </div>
</div> </div>

View File

@ -14,9 +14,7 @@
@touchstart="preventDrag" @touchstart="preventDrag"
v-tooltip.noDelay="i18n.ts.goBack" v-tooltip.noDelay="i18n.ts.goBack"
> >
<i <i class="ph-caret-left ph-bold ph-lg"></i>
class="ph-caret-left ph-bold ph-lg"
></i>
</button> </button>
<div v-if="narrow" class="buttons left" @click="openAccountMenu"> <div v-if="narrow" class="buttons left" @click="openAccountMenu">
<MkAvatar <MkAvatar
@ -382,7 +380,8 @@ onUnmounted(() => {
display: none; display: none;
} }
> .button/*, @at-root .backButton*/ { /* I don't know how to get this to work */ > .button/*, @at-root .backButton*/ {
/* I don't know how to get this to work */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@ -95,7 +95,10 @@
<FormSwitch v-model="autoplayMfm" class="_formBlock"> <FormSwitch v-model="autoplayMfm" class="_formBlock">
{{ i18n.ts._mfm.alwaysPlay }} {{ i18n.ts._mfm.alwaysPlay }}
<template #caption> <template #caption>
<i class="ph-warning ph-bold ph-lg" style="color: var(--warn)"></i> <i
class="ph-warning ph-bold ph-lg"
style="color: var(--warn)"
></i>
{{ i18n.ts._mfm.warn }} {{ i18n.ts._mfm.warn }}
</template> </template>
</FormSwitch> </FormSwitch>

View File

@ -61,8 +61,11 @@
<template #caption>{{ i18n.ts.noCrawleDescription }}</template> <template #caption>{{ i18n.ts.noCrawleDescription }}</template>
</FormSwitch> </FormSwitch>
<FormSwitch v-model="preventAiLearning" @update:model-value="save()"> <FormSwitch v-model="preventAiLearning" @update:model-value="save()">
{{ i18n.ts.preventAiLearning }}<span class="_beta">{{ i18n.ts.beta }}</span> {{ i18n.ts.preventAiLearning
<template #caption>{{ i18n.ts.preventAiLearningDescription }}</template> }}<span class="_beta">{{ i18n.ts.beta }}</span>
<template #caption>{{
i18n.ts.preventAiLearningDescription
}}</template>
</FormSwitch> </FormSwitch>
<FormSwitch <FormSwitch
v-model="isExplorable" v-model="isExplorable"

View File

@ -1,14 +1,19 @@
import * as mfm from "mfm-js"; import * as mfm from "mfm-js";
const animatedMfm = ["tada", "jelly", "twitch", "shake", "spin", "jump", "bounce", "rainbow"]; const animatedMfm = [
"tada",
"jelly",
"twitch",
"shake",
"spin",
"jump",
"bounce",
"rainbow",
];
export function extractMfmWithAnimation( export function extractMfmWithAnimation(nodes: mfm.MfmNode[]): string[] {
nodes: mfm.MfmNode[],
): string[] {
const mfmNodes = mfm.extract(nodes, (node) => { const mfmNodes = mfm.extract(nodes, (node) => {
return ( return node.type === "fn" && animatedMfm.indexOf(node.props.name) > -1;
node.type === "fn" && animatedMfm.indexOf(node.props.name) > -1
);
}); });
const mfms = mfmNodes.map((x) => x.props.fn); const mfms = mfmNodes.map((x) => x.props.fn);

View File

@ -13,7 +13,7 @@
class="columns" class="columns"
:class="{ fullView, withGlobalHeader: showMenuOnTop }" :class="{ fullView, withGlobalHeader: showMenuOnTop }"
> >
<XSidebar v-if="!showMenuOnTop"/> <XSidebar v-if="!showMenuOnTop" />
<div v-else ref="widgetsLeft" class="widgets left"> <div v-else ref="widgetsLeft" class="widgets left">
<XWidgets <XWidgets
:place="'left'" :place="'left'"
@ -243,7 +243,8 @@ onMounted(() => {
background: var(--acrylicBg) !important; background: var(--acrylicBg) !important;
backdrop-filter: blur(12px); backdrop-filter: blur(12px);
} }
:deep(.tl), :deep(.notes) { :deep(.tl),
:deep(.notes) {
background: none !important; background: none !important;
} }
} }
@ -279,7 +280,9 @@ onMounted(() => {
box-sizing: content-box; box-sizing: content-box;
.banner { .banner {
pointer-events: none; pointer-events: none;
mask: radial-gradient(farthest-side at top, hsl(0, 0%, 0%) 0%, mask: radial-gradient(
farthest-side at top,
hsl(0, 0%, 0%) 0%,
hsla(0, 0%, 0%, 0.987) 0.3%, hsla(0, 0%, 0%, 0.987) 0.3%,
hsla(0, 0%, 0%, 0.951) 1.4%, hsla(0, 0%, 0%, 0.951) 1.4%,
hsla(0, 0%, 0%, 0.896) 3.2%, hsla(0, 0%, 0%, 0.896) 3.2%,
@ -294,8 +297,11 @@ onMounted(() => {
hsla(0, 0%, 0%, 0.104) 60.8%, hsla(0, 0%, 0%, 0.104) 60.8%,
hsla(0, 0%, 0%, 0.049) 72.6%, hsla(0, 0%, 0%, 0.049) 72.6%,
hsla(0, 0%, 0%, 0.013) 85.7%, hsla(0, 0%, 0%, 0.013) 85.7%,
hsla(0, 0%, 0%, 0) 100%) !important; hsla(0, 0%, 0%, 0) 100%
-webkit-mask: radial-gradient(farthest-side at top, hsl(0, 0%, 0%) 0%, ) !important;
-webkit-mask: radial-gradient(
farthest-side at top,
hsl(0, 0%, 0%) 0%,
hsla(0, 0%, 0%, 0.987) 0.3%, hsla(0, 0%, 0%, 0.987) 0.3%,
hsla(0, 0%, 0%, 0.951) 1.4%, hsla(0, 0%, 0%, 0.951) 1.4%,
hsla(0, 0%, 0%, 0.896) 3.2%, hsla(0, 0%, 0%, 0.896) 3.2%,
@ -310,7 +316,8 @@ onMounted(() => {
hsla(0, 0%, 0%, 0.104) 60.8%, hsla(0, 0%, 0%, 0.104) 60.8%,
hsla(0, 0%, 0%, 0.049) 72.6%, hsla(0, 0%, 0%, 0.049) 72.6%,
hsla(0, 0%, 0%, 0.013) 85.7%, hsla(0, 0%, 0%, 0.013) 85.7%,
hsla(0, 0%, 0%, 0) 100%) !important; hsla(0, 0%, 0%, 0) 100%
) !important;
width: 125% !important; width: 125% !important;
left: -12.5% !important; left: -12.5% !important;
height: 125% !important; height: 125% !important;