Skip to content

Commit

Permalink
feat(client): Use tabler icons (for v12)
Browse files Browse the repository at this point in the history
Co-authored-by: syuilo <[email protected]>
Co-authored-by: tamaina <[email protected]>
  • Loading branch information
3 people committed Feb 11, 2023
1 parent d06b317 commit f66d358
Show file tree
Hide file tree
Showing 286 changed files with 2,038 additions and 1,886 deletions.
6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ gulp.task('copy:client:fonts', () =>
gulp.src('./packages/client/node_modules/three/examples/fonts/**/*').pipe(gulp.dest('./built/_client_dist_/fonts/'))
);

gulp.task('copy:client:fontawesome', () =>
gulp.src('./packages/client/node_modules/@fortawesome/fontawesome-free/**/*').pipe(gulp.dest('./built/_client_dist_/fontawesome/'))
gulp.task('copy:client:tabler-icons', () =>
gulp.src('./packages/client/node_modules/@tabler/icons/iconfont/**/*').pipe(gulp.dest('./built/_client_dist_/tabler-icons/'))
);

gulp.task('copy:client:locales', cb => {
Expand Down Expand Up @@ -53,7 +53,7 @@ gulp.task('build:backend:style', () => {
});

gulp.task('build', gulp.parallel(
'copy:client:locales', 'copy:backend:views', 'build:backend:script', 'build:backend:style', 'copy:client:fonts', 'copy:client:fontawesome'
'copy:client:locales', 'copy:backend:views', 'build:backend:script', 'build:backend:style', 'copy:client:fonts', 'copy:client:tabler-icons'
));

gulp.task('default', gulp.task('build'));
Expand Down
5 changes: 0 additions & 5 deletions packages/backend/assets/notification-badges/LICENSE

This file was deleted.

Binary file removed packages/backend/assets/notification-badges/at.png
Binary file not shown.
Binary file removed packages/backend/assets/notification-badges/check.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed packages/backend/assets/notification-badges/plus.png
Binary file not shown.
Binary file removed packages/backend/assets/notification-badges/poll-h.png
Binary file not shown.
Binary file not shown.
Binary file removed packages/backend/assets/notification-badges/reply.png
Binary file not shown.
Binary file removed packages/backend/assets/notification-badges/retweet.png
Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions packages/backend/assets/tabler-badges/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Tabler Icons
https://github.com/tabler/tabler-icons/blob/master/LICENSE
====
MIT License

Copyright (c) 2020-2022 Paweł Kuna

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Binary file added packages/backend/assets/tabler-badges/antenna.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 packages/backend/assets/tabler-badges/at.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.
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 packages/backend/assets/tabler-badges/plus.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 packages/backend/assets/tabler-badges/quote.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 packages/backend/assets/tabler-badges/repeat.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 packages/backend/assets/tabler-badges/users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/backend/src/server/web/views/base.pug
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ html
link(rel='prefetch' href='https://xn--931a.moe/assets/info.jpg')
link(rel='prefetch' href='https://xn--931a.moe/assets/not-found.jpg')
link(rel='prefetch' href='https://xn--931a.moe/assets/error.jpg')
link(rel='stylesheet' href='/assets/fontawesome/css/all.css')
link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.css')
link(rel='modulepreload' href=`/assets/${clientEntry.file}`)

each href in clientEntry.css
Expand Down
11 changes: 6 additions & 5 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
},
"dependencies": {
"@discordapp/twemoji": "14.0.2",
"@fortawesome/fontawesome-free": "6.1.2",
"@rollup/plugin-alias": "3.1.9",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-alias": "4.0.2",
"@rollup/plugin-json": "6.0.0",
"@rollup/pluginutils": "5.0.2",
"@syuilo/aiscript": "0.11.1",
"@vitejs/plugin-vue": "3.1.0",
"@vue/compiler-sfc": "3.2.39",
"@tabler/icons": "^1.117.0",
"@vitejs/plugin-vue": "4.0.0",
"@vue/compiler-sfc": "3.2.45",
"autobind-decorator": "2.4.0",
"autosize": "5.0.1",
"blurhash": "1.1.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export async function openAccountMenu(opts: {
avatar: $i,
}, null, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, {
type: 'parent',
icon: 'fas fa-plus',
icon: 'ti ti-plus',
text: i18n.ts.addAccount,
children: [{
text: i18n.ts.existingAccount,
Expand All @@ -218,7 +218,7 @@ export async function openAccountMenu(opts: {
}],
}, {
type: 'link',
icon: 'fas fa-users',
icon: 'ti ti-users',
text: i18n.ts.manageAccounts,
to: '/settings/accounts',
}]], ev.currentTarget ?? ev.target, {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/MkAbuseReportWindow.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<XWindow ref="uiWindow" :initial-width="400" :initial-height="500" :can-resize="true" @closed="emit('closed')">
<template #header>
<i class="fas fa-exclamation-circle" style="margin-right: 0.5em;"></i>
<i class="ti ti-exclamation-circle" style="margin-right: 0.5em;"></i>
<I18n :src="i18n.ts.reportAbuseOf" tag="span">
<template #name>
<b><MkAcct :user="user"/></b>
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/MkButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function onMousedown(evt: MouseEvent): void {
padding: 8px 16px;
text-align: center;
font-weight: normal;
font-size: 1em;
font-size: 90%;
box-shadow: none;
text-decoration: none;
background: var(--buttonBg);
Expand Down
13 changes: 7 additions & 6 deletions packages/client/src/components/MkChannelFollowButton.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<template>
<button class="hdcaacmi _button"
<button
class="hdcaacmi _button"
:class="{ wait, active: isFollowing, full }"
:disabled="wait"
@click="onClick"
>
<template v-if="!wait">
<template v-if="isFollowing">
<span v-if="full">{{ i18n.ts.unfollow }}</span><i class="fas fa-minus"></i>
<span v-if="full">{{ i18n.ts.unfollow }}</span><i class="ti ti-minus"></i>
</template>
<template v-else>
<span v-if="full">{{ i18n.ts.follow }}</span><i class="fas fa-plus"></i>
<span v-if="full">{{ i18n.ts.follow }}</span><i class="ti ti-plus"></i>
</template>
</template>
<template v-else>
<span v-if="full">{{ i18n.ts.processing }}</span><i class="fas fa-spinner fa-pulse fa-fw"></i>
<span v-if="full">{{ i18n.ts.processing }}</span><MkLoading :em="true"/>
</template>
</button>
</template>
Expand All @@ -39,12 +40,12 @@ async function onClick() {
try {
if (isFollowing.value) {
await os.api('channels/unfollow', {
channelId: props.channel.id
channelId: props.channel.id,
});
isFollowing.value = false;
} else {
await os.api('channels/follow', {
channelId: props.channel.id
channelId: props.channel.id,
});
isFollowing.value = true;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/components/MkChannelPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<MkA :to="`/channels/${channel.id}`" class="eftoefju _panel" tabindex="-1">
<div class="banner" :style="bannerStyle">
<div class="fade"></div>
<div class="name"><i class="fas fa-satellite-dish"></i> {{ channel.name }}</div>
<div class="name"><i class="ti ti-device-tv"></i> {{ channel.name }}</div>
<div class="status">
<div>
<i class="fas fa-users fa-fw"></i>
<i class="ti ti-users ti-fw"></i>
<I18n :src="i18n.ts._channel.usersCount" tag="span" style="margin-left: 4px;">
<template #n>
<b>{{ channel.usersCount }}</b>
</template>
</I18n>
</div>
<div>
<i class="fas fa-pencil-alt fa-fw"></i>
<i class="ti ti-pencil ti-fw"></i>
<I18n :src="i18n.ts._channel.notesCount" tag="span" style="margin-left: 4px;">
<template #n>
<b>{{ channel.notesCount }}</b>
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/components/MkContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<div class="sub">
<slot name="func"></slot>
<button v-if="foldable" class="_button" @click="() => showBody = !showBody">
<template v-if="showBody"><i class="fas fa-angle-up"></i></template>
<template v-else><i class="fas fa-angle-down"></i></template>
<template v-if="showBody"><i class="ti ti-chevron-up"></i></template>
<template v-else><i class="ti ti-chevron-down"></i></template>
</button>
</div>
</header>
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/components/MkDateSeparatedList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ export default defineComponent({
}, [
h('span', [
h('i', {
class: 'fas fa-angle-up icon',
class: 'ti ti-chevron-up icon',
}),
getDateText(item.createdAt),
]),
h('span', [
getDateText(props.items[i + 1].createdAt),
h('i', {
class: 'fas fa-angle-down icon',
class: 'ti ti-chevron-down icon',
}),
]),
]));
Expand Down
16 changes: 8 additions & 8 deletions packages/client/src/components/MkDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<i :class="icon"></i>
</div>
<div v-else-if="!input && !select" class="icon" :class="type">
<i v-if="type === 'success'" class="fas fa-check"></i>
<i v-else-if="type === 'error'" class="fas fa-times-circle"></i>
<i v-else-if="type === 'warning'" class="fas fa-exclamation-triangle"></i>
<i v-else-if="type === 'info'" class="fas fa-info-circle"></i>
<i v-else-if="type === 'question'" class="fas fa-question-circle"></i>
<i v-else-if="type === 'waiting'" class="fas fa-spinner fa-pulse"></i>
<i v-if="type === 'success'" class="ti ti-check"></i>
<i v-else-if="type === 'error'" class="ti ti-circle-x"></i>
<i v-else-if="type === 'warning'" class="ti ti-alert-triangle"></i>
<i v-else-if="type === 'info'" class="ti ti-info-circle"></i>
<i v-else-if="type === 'question'" class="ti ti-question-circle"></i>
<MkLoading v-else-if="type === 'waiting'" :em="true"/>
</div>
<header v-if="title"><Mfm :text="title"/></header>
<div v-if="text" class="body"><Mfm :text="text"/></div>
<MkInput v-if="input" v-model="inputValue" autofocus :type="input.type || 'text'" :placeholder="input.placeholder || undefined" @keydown="onInputKeydown">
<template v-if="input.type === 'password'" #prefix><i class="fas fa-lock"></i></template>
<template v-if="input.type === 'password'" #prefix><i class="ti ti-lock"></i></template>
</MkInput>
<MkSelect v-if="select" v-model="selectedValue" autofocus>
<template v-if="select.items">
Expand Down Expand Up @@ -155,7 +155,7 @@ onBeforeUnmount(() => {
border-radius: var(--radius);
> .icon {
font-size: 32px;
font-size: 24px;
&.info {
color: #55c4dd;
Expand Down
12 changes: 6 additions & 6 deletions packages/client/src/components/MkDrive.file.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,30 @@ const title = computed(() => `${props.file.name}\n${props.file.type} ${bytes(pro
function getMenu() {
return [{
text: i18n.ts.rename,
icon: 'fas fa-i-cursor',
icon: 'ti ti-forms',
action: rename,
}, {
text: props.file.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive,
icon: props.file.isSensitive ? 'fas fa-eye' : 'fas fa-eye-slash',
icon: props.file.isSensitive ? 'ti ti-eye' : 'ti ti-eye-off',
action: toggleSensitive,
}, {
text: i18n.ts.describeFile,
icon: 'fas fa-i-cursor',
icon: 'ti ti-forms',
action: describe,
}, null, {
text: i18n.ts.copyUrl,
icon: 'fas fa-link',
icon: 'ti ti-link',
action: copyUrl,
}, {
type: 'a',
href: props.file.url,
target: '_blank',
text: i18n.ts.download,
icon: 'fas fa-download',
icon: 'ti ti-download',
download: props.file.name,
}, null, {
text: i18n.ts.delete,
icon: 'fas fa-trash-alt',
icon: 'ti ti-trash',
danger: true,
action: deleteFile,
}];
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/components/MkDrive.folder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
@dragend="onDragend"
>
<p class="name">
<template v-if="hover"><i class="fas fa-folder-open fa-fw"></i></template>
<template v-if="!hover"><i class="fas fa-folder fa-fw"></i></template>
<template v-if="hover"><i class="ti ti-folder ti-fw"></i></template>
<template v-if="!hover"><i class="ti ti-folder ti-fw"></i></template>
{{ folder.name }}
</p>
<p v-if="defaultStore.state.uploadFolder == folder.id" class="upload">
Expand Down Expand Up @@ -229,7 +229,7 @@ function setAsUploadFolder() {
function onContextmenu(ev: MouseEvent) {
os.contextMenu([{
text: i18n.ts.openInWindow,
icon: 'fas fa-window-restore',
icon: 'ti ti-app-window',
action: () => {
os.popup(defineAsyncComponent(() => import('@/components/MkDriveWindow.vue')), {
initialFolder: props.folder,
Expand All @@ -238,11 +238,11 @@ function onContextmenu(ev: MouseEvent) {
},
}, null, {
text: i18n.ts.rename,
icon: 'fas fa-i-cursor',
icon: 'ti ti-forms',
action: rename,
}, null, {
text: i18n.ts.delete,
icon: 'fas fa-trash-alt',
icon: 'ti ti-trash',
danger: true,
action: deleteFolder,
}], ev);
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/MkDrive.navFolder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@dragleave="onDragleave"
@drop.stop="onDrop"
>
<i v-if="folder == null" class="fas fa-cloud"></i>
<i v-if="folder == null" class="ti ti-cloud"></i>
<span>{{ folder == null ? i18n.ts.drive : folder.name }}</span>
</div>
</template>
Expand Down
16 changes: 8 additions & 8 deletions packages/client/src/components/MkDrive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@removeFolder="removeFolder"
/>
<template v-for="f in hierarchyFolders">
<span class="separator"><i class="fas fa-angle-right"></i></span>
<span class="separator"><i class="ti ti-chevron-right"></i></span>
<XNavFolder
:folder="f"
:parent-folder="folder"
Expand All @@ -21,10 +21,10 @@
@removeFolder="removeFolder"
/>
</template>
<span v-if="folder != null" class="separator"><i class="fas fa-angle-right"></i></span>
<span v-if="folder != null" class="separator"><i class="ti ti-chevron-right"></i></span>
<span v-if="folder != null" class="folder current">{{ folder.name }}</span>
</div>
<button class="menu _button" @click="showMenu"><i class="fas fa-ellipsis-h"></i></button>
<button class="menu _button" @click="showMenu"><i class="ti ti-dots"></i></button>
</nav>
<div
ref="main" class="main"
Expand Down Expand Up @@ -573,26 +573,26 @@ function getMenu() {
type: 'label',
}, {
text: i18n.ts.upload,
icon: 'fas fa-upload',
icon: 'ti ti-upload',
action: () => { selectLocalFile(); },
}, {
text: i18n.ts.fromUrl,
icon: 'fas fa-link',
icon: 'ti ti-link',
action: () => { urlUpload(); },
}, null, {
text: folder.value ? folder.value.name : i18n.ts.drive,
type: 'label',
}, folder.value ? {
text: i18n.ts.renameFolder,
icon: 'fas fa-i-cursor',
icon: 'ti ti-forms',
action: () => { renameFolder(folder.value); },
} : undefined, folder.value ? {
text: i18n.ts.deleteFolder,
icon: 'fas fa-trash-alt',
icon: 'ti ti-trash',
action: () => { deleteFolder(folder.value as Misskey.entities.DriveFolder); },
} : undefined, {
text: i18n.ts.createFolder,
icon: 'fas fa-folder-plus',
icon: 'ti ti-folder-plus',
action: () => { createFolder(); },
}];
}
Expand Down
18 changes: 9 additions & 9 deletions packages/client/src/components/MkDriveFileThumbnail.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<template>
<div ref="thumbnail" class="zdjebgpv">
<ImgWithBlurhash v-if="isThumbnailAvailable" :hash="file.blurhash" :src="file.thumbnailUrl" :alt="file.name" :title="file.name" :cover="fit !== 'contain'"/>
<i v-else-if="is === 'image'" class="fas fa-file-image icon"></i>
<i v-else-if="is === 'video'" class="fas fa-file-video icon"></i>
<i v-else-if="is === 'audio' || is === 'midi'" class="fas fa-music icon"></i>
<i v-else-if="is === 'csv'" class="fas fa-file-csv icon"></i>
<i v-else-if="is === 'pdf'" class="fas fa-file-pdf icon"></i>
<i v-else-if="is === 'textfile'" class="fas fa-file-alt icon"></i>
<i v-else-if="is === 'archive'" class="fas fa-file-archive icon"></i>
<i v-else class="fas fa-file icon"></i>
<i v-else-if="is === 'image'" class="ti ti-photo icon"></i>
<i v-else-if="is === 'video'" class="ti ti-video icon"></i>
<i v-else-if="is === 'audio' || is === 'midi'" class="ti ti-file-music icon"></i>
<i v-else-if="is === 'csv'" class="ti ti-file-text icon"></i>
<i v-else-if="is === 'pdf'" class="ti ti-file-text icon"></i>
<i v-else-if="is === 'textfile'" class="ti ti-file-text icon"></i>
<i v-else-if="is === 'archive'" class="ti ti-file-zip icon"></i>
<i v-else class="ti ti-file icon"></i>

<i v-if="isThumbnailAvailable && is === 'video'" class="fas fa-film icon-sub"></i>
<i v-if="isThumbnailAvailable && is === 'video'" class="ti ti-video icon-sub"></i>
</div>
</template>

Expand Down
Loading

0 comments on commit f66d358

Please sign in to comment.