chore(client): tweak ui
This commit is contained in:
parent
4a5d5fe20c
commit
55c22eec8b
3 changed files with 72 additions and 31 deletions
|
@ -2,8 +2,8 @@
|
||||||
<svg :viewBox="`0 0 ${ viewBoxX } ${ viewBoxY }`" style="overflow:visible">
|
<svg :viewBox="`0 0 ${ viewBoxX } ${ viewBoxY }`" style="overflow:visible">
|
||||||
<defs>
|
<defs>
|
||||||
<linearGradient :id="gradientId" x1="0" x2="0" y1="1" y2="0">
|
<linearGradient :id="gradientId" x1="0" x2="0" y1="1" y2="0">
|
||||||
<stop offset="0%" stop-color="hsl(200, 80%, 70%)"></stop>
|
<stop offset="0%" :stop-color="color"></stop>
|
||||||
<stop offset="100%" stop-color="hsl(90, 80%, 70%)"></stop>
|
<stop offset="100%" :stop-color="colorAlpha"></stop>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
<mask :id="maskId" x="0" y="0" :width="viewBoxX" :height="viewBoxY">
|
<mask :id="maskId" x="0" y="0" :width="viewBoxX" :height="viewBoxY">
|
||||||
<polygon
|
<polygon
|
||||||
|
@ -11,18 +11,6 @@
|
||||||
fill="#fff"
|
fill="#fff"
|
||||||
fill-opacity="0.5"
|
fill-opacity="0.5"
|
||||||
/>
|
/>
|
||||||
<polyline
|
|
||||||
:points="polylinePoints"
|
|
||||||
fill="none"
|
|
||||||
stroke="#fff"
|
|
||||||
stroke-width="2"
|
|
||||||
/>
|
|
||||||
<circle
|
|
||||||
:cx="headX"
|
|
||||||
:cy="headY"
|
|
||||||
r="3"
|
|
||||||
fill="#fff"
|
|
||||||
/>
|
|
||||||
</mask>
|
</mask>
|
||||||
</defs>
|
</defs>
|
||||||
<rect
|
<rect
|
||||||
|
@ -30,12 +18,25 @@
|
||||||
:width="viewBoxX + 20" :height="viewBoxY + 20"
|
:width="viewBoxX + 20" :height="viewBoxY + 20"
|
||||||
:style="`stroke: none; fill: url(#${ gradientId }); mask: url(#${ maskId })`"
|
:style="`stroke: none; fill: url(#${ gradientId }); mask: url(#${ maskId })`"
|
||||||
/>
|
/>
|
||||||
|
<polyline
|
||||||
|
:points="polylinePoints"
|
||||||
|
fill="none"
|
||||||
|
:stroke="color"
|
||||||
|
stroke-width="2"
|
||||||
|
/>
|
||||||
|
<circle
|
||||||
|
:cx="headX"
|
||||||
|
:cy="headY"
|
||||||
|
r="3"
|
||||||
|
:fill="color"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onUnmounted, watch } from 'vue';
|
import { onUnmounted, watch } from 'vue';
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
import tinycolor from 'tinycolor2';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
src: number[];
|
src: number[];
|
||||||
|
@ -50,6 +51,9 @@ let polygonPoints = $ref('');
|
||||||
let headX = $ref<number | null>(null);
|
let headX = $ref<number | null>(null);
|
||||||
let headY = $ref<number | null>(null);
|
let headY = $ref<number | null>(null);
|
||||||
let clock = $ref<number | null>(null);
|
let clock = $ref<number | null>(null);
|
||||||
|
const accent = tinycolor(getComputedStyle(document.documentElement).getPropertyValue('--accent'));
|
||||||
|
const color = accent.toRgbString();
|
||||||
|
const colorAlpha = accent.clone().setAlpha(1).toRgbString();
|
||||||
|
|
||||||
function draw(): void {
|
function draw(): void {
|
||||||
const stats = props.src.slice().reverse();
|
const stats = props.src.slice().reverse();
|
||||||
|
|
|
@ -2,37 +2,69 @@
|
||||||
<div class="_formRoot">
|
<div class="_formRoot">
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<template #label>{{ $ts._exportOrImport.allNotes }}</template>
|
<template #label>{{ $ts._exportOrImport.allNotes }}</template>
|
||||||
<MkButton :class="$style.button" inline @click="exportNotes()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
<FormFolder>
|
||||||
|
<template #label>{{ $ts.export }}</template>
|
||||||
|
<template #icon><i class="fas fa-download"></i></template>
|
||||||
|
<MkButton primary :class="$style.button" inline @click="exportNotes()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
||||||
|
</FormFolder>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<template #label>{{ $ts._exportOrImport.followingList }}</template>
|
<template #label>{{ $ts._exportOrImport.followingList }}</template>
|
||||||
<FormGroup>
|
<FormFolder class="_formBlock">
|
||||||
|
<template #label>{{ $ts.export }}</template>
|
||||||
|
<template #icon><i class="fas fa-download"></i></template>
|
||||||
<FormSwitch v-model="excludeMutingUsers" class="_formBlock">
|
<FormSwitch v-model="excludeMutingUsers" class="_formBlock">
|
||||||
{{ $ts._exportOrImport.excludeMutingUsers }}
|
{{ $ts._exportOrImport.excludeMutingUsers }}
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
<FormSwitch v-model="excludeInactiveUsers" class="_formBlock">
|
<FormSwitch v-model="excludeInactiveUsers" class="_formBlock">
|
||||||
{{ $ts._exportOrImport.excludeInactiveUsers }}
|
{{ $ts._exportOrImport.excludeInactiveUsers }}
|
||||||
</FormSwitch>
|
</FormSwitch>
|
||||||
<MkButton :class="$style.button" inline @click="exportFollowing()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
<MkButton primary :class="$style.button" inline @click="exportFollowing()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
||||||
</FormGroup>
|
</FormFolder>
|
||||||
<FormGroup>
|
<FormFolder class="_formBlock">
|
||||||
<MkButton :class="$style.button" inline @click="importFollowing($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
|
<template #label>{{ $ts.import }}</template>
|
||||||
</FormGroup>
|
<template #icon><i class="fas fa-upload"></i></template>
|
||||||
|
<MkButton primary :class="$style.button" inline @click="importFollowing($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
|
||||||
|
</FormFolder>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<template #label>{{ $ts._exportOrImport.userLists }}</template>
|
<template #label>{{ $ts._exportOrImport.userLists }}</template>
|
||||||
<MkButton :class="$style.button" inline @click="exportUserLists()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
<FormFolder class="_formBlock">
|
||||||
<MkButton :class="$style.button" inline @click="importUserLists($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
|
<template #label>{{ $ts.export }}</template>
|
||||||
|
<template #icon><i class="fas fa-download"></i></template>
|
||||||
|
<MkButton primary :class="$style.button" inline @click="exportUserLists()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
||||||
|
</FormFolder>
|
||||||
|
<FormFolder class="_formBlock">
|
||||||
|
<template #label>{{ $ts.import }}</template>
|
||||||
|
<template #icon><i class="fas fa-upload"></i></template>
|
||||||
|
<MkButton primary :class="$style.button" inline @click="importUserLists($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
|
||||||
|
</FormFolder>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<template #label>{{ $ts._exportOrImport.muteList }}</template>
|
<template #label>{{ $ts._exportOrImport.muteList }}</template>
|
||||||
<MkButton :class="$style.button" inline @click="exportMuting()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
<FormFolder class="_formBlock">
|
||||||
<MkButton :class="$style.button" inline @click="importMuting($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
|
<template #label>{{ $ts.export }}</template>
|
||||||
|
<template #icon><i class="fas fa-download"></i></template>
|
||||||
|
<MkButton primary :class="$style.button" inline @click="exportMuting()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
||||||
|
</FormFolder>
|
||||||
|
<FormFolder class="_formBlock">
|
||||||
|
<template #label>{{ $ts.import }}</template>
|
||||||
|
<template #icon><i class="fas fa-upload"></i></template>
|
||||||
|
<MkButton primary :class="$style.button" inline @click="importMuting($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
|
||||||
|
</FormFolder>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<template #label>{{ $ts._exportOrImport.blockingList }}</template>
|
<template #label>{{ $ts._exportOrImport.blockingList }}</template>
|
||||||
<MkButton :class="$style.button" inline @click="exportBlocking()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
<FormFolder class="_formBlock">
|
||||||
<MkButton :class="$style.button" inline @click="importBlocking($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
|
<template #label>{{ $ts.export }}</template>
|
||||||
|
<template #icon><i class="fas fa-download"></i></template>
|
||||||
|
<MkButton primary :class="$style.button" inline @click="exportBlocking()"><i class="fas fa-download"></i> {{ $ts.export }}</MkButton>
|
||||||
|
</FormFolder>
|
||||||
|
<FormFolder class="_formBlock">
|
||||||
|
<template #label>{{ $ts.import }}</template>
|
||||||
|
<template #icon><i class="fas fa-upload"></i></template>
|
||||||
|
<MkButton primary :class="$style.button" inline @click="importBlocking($event)"><i class="fas fa-upload"></i> {{ $ts.import }}</MkButton>
|
||||||
|
</FormFolder>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -41,7 +73,7 @@
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import MkButton from '@/components/ui/button.vue';
|
import MkButton from '@/components/ui/button.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormGroup from '@/components/form/group.vue';
|
import FormFolder from '@/components/form/folder.vue';
|
||||||
import FormSwitch from '@/components/form/switch.vue';
|
import FormSwitch from '@/components/form/switch.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { selectFile } from '@/scripts/select-file';
|
import { selectFile } from '@/scripts/select-file';
|
||||||
|
|
|
@ -31,8 +31,13 @@
|
||||||
|
|
||||||
<FormSection>
|
<FormSection>
|
||||||
<FormSwitch v-model="rememberNoteVisibility" class="_formBlock" @update:modelValue="save()">{{ $ts.rememberNoteVisibility }}</FormSwitch>
|
<FormSwitch v-model="rememberNoteVisibility" class="_formBlock" @update:modelValue="save()">{{ $ts.rememberNoteVisibility }}</FormSwitch>
|
||||||
<FormGroup v-if="!rememberNoteVisibility" class="_formBlock">
|
<FormFolder v-if="!rememberNoteVisibility" class="_formBlock">
|
||||||
<template #label>{{ $ts.defaultNoteVisibility }}</template>
|
<template #label>{{ $ts.defaultNoteVisibility }}</template>
|
||||||
|
<template v-if="defaultNoteVisibility === 'public'" #suffix>{{ $ts._visibility.public }}</template>
|
||||||
|
<template v-else-if="defaultNoteVisibility === 'home'" #suffix>{{ $ts._visibility.home }}</template>
|
||||||
|
<template v-else-if="defaultNoteVisibility === 'followers'" #suffix>{{ $ts._visibility.followers }}</template>
|
||||||
|
<template v-else-if="defaultNoteVisibility === 'specified'" #suffix>{{ $ts._visibility.specified }}</template>
|
||||||
|
|
||||||
<FormSelect v-model="defaultNoteVisibility" class="_formBlock">
|
<FormSelect v-model="defaultNoteVisibility" class="_formBlock">
|
||||||
<option value="public">{{ $ts._visibility.public }}</option>
|
<option value="public">{{ $ts._visibility.public }}</option>
|
||||||
<option value="home">{{ $ts._visibility.home }}</option>
|
<option value="home">{{ $ts._visibility.home }}</option>
|
||||||
|
@ -40,7 +45,7 @@
|
||||||
<option value="specified">{{ $ts._visibility.specified }}</option>
|
<option value="specified">{{ $ts._visibility.specified }}</option>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
<FormSwitch v-model="defaultNoteLocalOnly" class="_formBlock">{{ $ts._visibility.localOnly }}</FormSwitch>
|
<FormSwitch v-model="defaultNoteLocalOnly" class="_formBlock">{{ $ts._visibility.localOnly }}</FormSwitch>
|
||||||
</FormGroup>
|
</FormFolder>
|
||||||
</FormSection>
|
</FormSection>
|
||||||
|
|
||||||
<FormSwitch v-model="keepCw" class="_formBlock" @update:modelValue="save()">{{ $ts.keepCw }}</FormSwitch>
|
<FormSwitch v-model="keepCw" class="_formBlock" @update:modelValue="save()">{{ $ts.keepCw }}</FormSwitch>
|
||||||
|
@ -52,7 +57,7 @@ import { } from 'vue';
|
||||||
import FormSwitch from '@/components/form/switch.vue';
|
import FormSwitch from '@/components/form/switch.vue';
|
||||||
import FormSelect from '@/components/form/select.vue';
|
import FormSelect from '@/components/form/select.vue';
|
||||||
import FormSection from '@/components/form/section.vue';
|
import FormSection from '@/components/form/section.vue';
|
||||||
import FormGroup from '@/components/form/group.vue';
|
import FormFolder from '@/components/form/folder.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
|
|
Loading…
Reference in a new issue