use octicons instead of bootstrap's

This commit is contained in:
Gamebrary 2020-10-08 13:55:26 -04:00
parent 5c74dd52c2
commit 4144708738
24 changed files with 110 additions and 63 deletions

View file

@ -2,10 +2,11 @@
<b-button <b-button
v-b-modal="modalId" v-b-modal="modalId"
:title="$t('board.addList.title')" :title="$t('board.addList.title')"
size="sm"
v-b-tooltip.hover.left v-b-tooltip.hover.left
ref="addList" ref="addList"
> >
<b-icon-plus /> <icon name="plus" white />
<b-modal <b-modal
:id="modalId" :id="modalId"

View file

@ -6,7 +6,7 @@
v-b-tooltip.hover v-b-tooltip.hover
@click="addGame" @click="addGame"
> >
<b-icon-plus /> <icon name="plus" white />
</b-button> </b-button>
<b-button <b-button
@ -16,7 +16,7 @@
:title="$t('board.gameModal.removeFromList')" :title="$t('board.gameModal.removeFromList')"
@click="removeGame" @click="removeGame"
> >
<b-icon-trash /> <icon name="trash" white />
</b-button> </b-button>
</template> </template>

View file

@ -5,7 +5,7 @@
v-b-tooltip.hover v-b-tooltip.hover
title="Game notes" title="Game notes"
> >
<b-icon-file-earmark-text /> <icon name="note" white />
<b-modal <b-modal
id="notes" id="notes"

View file

@ -5,7 +5,7 @@
variant="info" variant="info"
title="Set game progress" title="Set game progress"
> >
<b-icon-clock-history /> <icon name="clock" white />
<b-modal <b-modal
id="progress" id="progress"

View file

@ -5,7 +5,7 @@
v-b-tooltip.hover v-b-tooltip.hover
title="Apply tags" title="Apply tags"
> >
<b-icon-tag /> <icon name="tag" white />
<b-popover <b-popover
target="tags-popover" target="tags-popover"
@ -46,7 +46,7 @@
size="sm" size="sm"
@click="removeTag(name)" @click="removeTag(name)"
> >
<b-icon-trash /> <icon name="dash" />
</b-button> </b-button>
<b-button <b-button
@ -55,7 +55,7 @@
size="sm" size="sm"
@click="addTag(name)" @click="addTag(name)"
> >
<b-icon-plus font-scale="1" /> <icon name="plus" />
</b-button> </b-button>
</b-list-group-item> </b-list-group-item>

View file

@ -2,10 +2,9 @@
<b-card no-body class="clickable mb-2" @click="openDetails"> <b-card no-body class="clickable mb-2" @click="openDetails">
<b-row no-gutters v-if="game && game.name"> <b-row no-gutters v-if="game && game.name">
<b-col cols="3"> <b-col cols="3">
<b-icon-check-circle <icon name="check-circle"
white
class="position-absolute rounded bg-success p-1 m-1" class="position-absolute rounded bg-success p-1 m-1"
variant="white"
font-scale="1.5"
v-if="showCompletedBadge" v-if="showCompletedBadge"
/> />
@ -27,7 +26,7 @@
{{ game.name }} {{ game.name }}
<b-badge variant="warning" v-if="gameNotes"> <b-badge variant="warning" v-if="gameNotes">
<b-icon-file-earmark-text /> <icon name="note" />
</b-badge> </b-badge>
</b-card-title> </b-card-title>

View file

@ -5,10 +5,10 @@
v-if="game && game.name" v-if="game && game.name"
> >
<b-col cols="4"> <b-col cols="4">
<b-icon-check-circle <icon
name="verified"
white
class="position-absolute rounded bg-success p-1 m-1" class="position-absolute rounded bg-success p-1 m-1"
variant="white"
font-scale="1.5"
v-if="showCompletedBadge" v-if="showCompletedBadge"
/> />
@ -29,7 +29,7 @@
{{ game.name }} {{ game.name }}
<b-badge variant="warning" v-if="gameNotes"> <b-badge variant="warning" v-if="gameNotes">
<b-icon-file-earmark-text /> <icon name="note" />
</b-badge> </b-badge>
</b-card-title> </b-card-title>

View file

@ -8,10 +8,10 @@
> >
<b-card-body body-class="p-2" v-if="game && game.name"> <b-card-body body-class="p-2" v-if="game && game.name">
<b-card-title class="mb-0" title-tag="h6"> <b-card-title class="mb-0" title-tag="h6">
<b-icon-check-circle <icon
name="verified"
class="rounded bg-success p-1" class="rounded bg-success p-1"
variant="white" white
font-scale="1.5"
v-if="showCompletedBadge" v-if="showCompletedBadge"
/> />
@ -61,7 +61,7 @@
</template> </template>
<b-badge variant="warning" v-if="gameNotes"> <b-badge variant="warning" v-if="gameNotes">
<b-icon-file-earmark-text /> <icon name="note" />
</b-badge> </b-badge>
</b-card-body> </b-card-body>
</b-card> </b-card>

View file

@ -3,9 +3,10 @@
<b-row no-gutters v-if="game && game.name"> <b-row no-gutters v-if="game && game.name">
<b-card-body body-class="pt-0 pb-1 px-2"> <b-card-body body-class="pt-0 pb-1 px-2">
<small> <small>
<b-icon-check-circle <icon
name="verified"
class="rounded bg-success p-1" class="rounded bg-success p-1"
variant="white" white
font-scale="1.5" font-scale="1.5"
v-if="showCompletedBadge" v-if="showCompletedBadge"
/> />
@ -13,7 +14,7 @@
{{ game.name }} {{ game.name }}
<b-badge variant="warning" v-if="gameNotes"> <b-badge variant="warning" v-if="gameNotes">
<b-icon-file-earmark-text /> <icon name="note" />
</b-badge> </b-badge>
</small> </small>

43
src/components/Icon.vue Normal file
View file

@ -0,0 +1,43 @@
<template lang="html">
<img
:src="`static/octicons/${name}.svg`"
:class="{ white, animated, small }"
/>
</template>
<script>
export default {
props: {
name: {
type: String,
default: 'sun',
},
white: Boolean,
animated: Boolean,
small: Boolean,
},
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
@keyframes spin {
from { transform:rotate(0deg); }
to { transform:rotate(360deg); }
}
img {
&.white {
filter: invert(1);
}
&.small {
width: 16px;
height: 16px;
}
&.animated {
animation: spin 500ms linear infinite;
transform:rotate(360deg);
}
}
</style>

View file

@ -1,6 +1,6 @@
<template lang="html"> <template lang="html">
<b-dropdown-item-button @click="$bvModal.show(`game-modal-${list.name}`)"> <b-dropdown-item-button @click="$bvModal.show(`game-modal-${list.name}`)">
<b-icon-plus class="mr-1" /> <icon name="plus" />
{{ $t('board.addGame.title') }} {{ $t('board.addGame.title') }}
<b-modal <b-modal
@ -20,8 +20,11 @@
<b-input-group-append> <b-input-group-append>
<b-button variant="primary" @click="search"> <b-button variant="primary" @click="search">
<b-spinner v-if="loading" small /> <icon
<b-icon-search v-else /> :name="loading ? 'sync' : 'search'"
:animated="loading"
white
/>
</b-button> </b-button>
</b-input-group-append> </b-input-group-append>
</b-input-group> </b-input-group>

View file

@ -1,6 +1,6 @@
<template lang="html"> <template lang="html">
<b-dropdown-item-button v-b-modal="modalId"> <b-dropdown-item-button v-b-modal="modalId">
<b-icon-grid1x2 class="mr-1" /> <icon name="versions" />
{{ $t('board.list.view') }} {{ $t('board.list.view') }}
<b-modal <b-modal

View file

@ -9,14 +9,14 @@
:header-bg-variant="showDuplicateWarning ? 'warning' : null" :header-bg-variant="showDuplicateWarning ? 'warning' : null"
> >
<h6 class="m-0" v-b-modal="`rename-list-${listIndex}`"> <h6 class="m-0" v-b-modal="`rename-list-${listIndex}`">
<b-badge v-if="autoSortEnabled">
<b-icon-sort-up />
</b-badge>
<b-badge v-if="showGameCount"> <b-badge v-if="showGameCount">
{{ list.games.length }} {{ list.games.length }}
</b-badge> </b-badge>
<b-badge v-if="autoSortEnabled">
<icon small white name="list-ordered" />
</b-badge>
{{ showDuplicateWarning ? 'Game already in list' : list.name }} {{ showDuplicateWarning ? 'Game already in list' : list.name }}
</h6> </h6>

View file

@ -1,6 +1,6 @@
<template lang="html"> <template lang="html">
<b-dropdown-item-button v-b-modal="modalId"> <b-dropdown-item-button v-b-modal="modalId">
<b-icon-toggles class="mr-1" /> <icon name="tools" />
{{ $t('board.list.settings') }} {{ $t('board.list.settings') }}
<b-modal <b-modal

View file

@ -1,5 +1,5 @@
<template lang="html"> <template lang="html">
<b-dropdown size="sm" class="m-1" right> <b-dropdown size="sm" class="m-1" right variant="transparent">
<add-game-modal :list="list" /> <add-game-modal :list="list" />
<b-dd-divider /> <b-dd-divider />
<sort-list :list="list" :list-index="listIndex" /> <sort-list :list="list" :list-index="listIndex" />
@ -13,18 +13,20 @@
v-b-tooltip.hover v-b-tooltip.hover
:title="$t('board.list.moveLeft')" :title="$t('board.list.moveLeft')"
:disabled="isFirst" :disabled="isFirst"
variant="light"
@click="moveList(listIndex, listIndex - 1)" @click="moveList(listIndex, listIndex - 1)"
> >
<b-icon-arrow-left-short /> <icon name="triangle-left" />
</b-button> </b-button>
<b-button <b-button
v-b-tooltip.hover v-b-tooltip.hover
:title="$t('board.list.moveRight')" :title="$t('board.list.moveRight')"
:disabled="isLast" :disabled="isLast"
variant="light"
@click="moveList(listIndex, listIndex + 1)" @click="moveList(listIndex, listIndex + 1)"
> >
<b-icon-arrow-right-short /> <icon name="triangle-right" />
</b-button> </b-button>
</b-button-group> </b-button-group>
</b-dropdown-item> </b-dropdown-item>
@ -34,7 +36,7 @@
variant="outline-danger" variant="outline-danger"
@click="promptDeleteList" @click="promptDeleteList"
> >
<b-icon-trash class="mr-1" /> <icon name="trash" />
{{ $t('board.list.delete') }} {{ $t('board.list.delete') }}
</b-dropdown-item> </b-dropdown-item>
</b-dropdown> </b-dropdown>

View file

@ -1,6 +1,6 @@
<template lang="html"> <template lang="html">
<b-dropdown-item-button v-b-modal="modalId"> <b-dropdown-item-button v-b-modal="modalId">
<b-icon-pencil class="mr-1" /> <icon name="pencil" />
{{ $t('board.list.renameList') }} {{ $t('board.list.renameList') }}
<b-modal <b-modal

View file

@ -1,6 +1,6 @@
<template lang="html"> <template lang="html">
<b-dropdown-item-button v-b-modal="modalId"> <b-dropdown-item-button v-b-modal="modalId">
<b-icon-sort-up class="mr-1" /> <icon name="list-ordered" />
{{ $t('board.list.sortList') }} {{ $t('board.list.sortList') }}
<b-modal <b-modal

View file

@ -11,10 +11,10 @@
right right
no-caret no-caret
boundary="viewport" boundary="viewport"
variant="link" variant="transparent"
> >
<template v-slot:button-content> <template v-slot:button-content>
<b-icon-arrow-left-right /> <icon name="arrow-switch" />
</template> </template>
<b-dropdown-item <b-dropdown-item
@ -34,37 +34,38 @@
right right
no-caret no-caret
boundary="viewport" boundary="viewport"
variant="link" variant="transparent"
> >
<template v-slot:button-content> <template v-slot:button-content>
<b-icon-gear /> <icon name="gear" />
</template> </template>
<b-dropdown-item title="Tags" :to="{ name: 'tags' }"> <b-dropdown-item title="Tags" :to="{ name: 'tags' }">
<b-icon-tags /> <icon name="tag" />
{{ $t('settings.tags') }} {{ $t('settings.tags') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item title="Wallpapers" :to="{ name: 'wallpapers' }"> <b-dropdown-item title="Wallpapers" :to="{ name: 'wallpapers' }">
<b-icon-file-richtext /> <icon name="image" />
{{ $t('settings.wallpapers') }} {{ $t('settings.wallpapers') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item title="Language" :to="{ name: 'language' }"> <b-dropdown-item title="Language" :to="{ name: 'language' }">
<b-icon-chat-left-text /> <icon name="globe" />
{{ $t('settings.language') }} {{ $t('settings.language') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item title="Themes" :to="{ name: 'themes' }"> <b-dropdown-item title="Themes" :to="{ name: 'themes' }">
<b-icon-droplet /> <icon name="sun" />
{{ $t('settings.themes') }} {{ $t('settings.themes') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item title="Releases" :to="{ name: 'releases' }"> <b-dropdown-item title="Releases" :to="{ name: 'releases' }">
<b-icon-mailbox /> <icon name="megaphone" />
{{ $t('settings.releases') }} {{ $t('settings.releases') }}
</b-dropdown-item> </b-dropdown-item>
<b-dropdown-item title="About" :to="{ name: 'about' }"> <b-dropdown-item title="About" :to="{ name: 'about' }">
<b-icon-question /> <icon name="info" />
{{ $t('settings.about') }} {{ $t('settings.about') }}
</b-dropdown-item> </b-dropdown-item>
</b-dropdown> </b-dropdown>

View file

@ -4,9 +4,10 @@
v-b-tooltip.hover.left v-b-tooltip.hover.left
title="Board settings" title="Board settings"
class="mt-3" class="mt-3"
size="sm"
ref="addList" ref="addList"
> >
<b-icon-gear-fill /> <icon name="gear" white />
<b-modal <b-modal
id="board-settings" id="board-settings"

View file

@ -103,9 +103,9 @@
"addGames": "Add games to {listName}", "addGames": "Add games to {listName}",
"view": "List view", "view": "List view",
"moveList": "Move list", "moveList": "Move list",
"renameList": "Rename list", "renameList": "Rename",
"renameListPlaceholder": "Enter your name", "renameListPlaceholder": "Enter your name",
"sortList": "Auto sort list", "sortList": "Sort",
"sortWarning": "Auto sorting list will affect how drag and drop works", "sortWarning": "Auto sorting list will affect how drag and drop works",
"coversSizeTitle": "Covers across", "coversSizeTitle": "Covers across",
"showReleaseDates": "Show release date for unreleased games", "showReleaseDates": "Show release date for unreleased games",

View file

@ -1,9 +1,10 @@
import Vue from 'vue'; import Vue from 'vue';
import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue'; import { BootstrapVue } from 'bootstrap-vue';
import 'bootstrap-vue/dist/bootstrap-vue.css'; import 'bootstrap-vue/dist/bootstrap-vue.css';
import VueAxios from 'vue-axios'; import VueAxios from 'vue-axios';
import VueFire from 'vuefire'; import VueFire from 'vuefire';
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
import Icon from '@/components/Icon';
import axios from 'axios'; import axios from 'axios';
import VueAnalytics from 'vue-analytics'; import VueAnalytics from 'vue-analytics';
import Raven from 'raven-js'; import Raven from 'raven-js';
@ -25,12 +26,11 @@ Object.defineProperties(Vue.prototype, {
}); });
Vue.use(BootstrapVue, bootstrapSettings); Vue.use(BootstrapVue, bootstrapSettings);
Vue.use(BootstrapVueIcons);
Vue.use(VueAnalytics, { id: 'UA-120053966-1', router }); Vue.use(VueAnalytics, { id: 'UA-120053966-1', router });
Vue.use(VueAxios, axios); Vue.use(VueAxios, axios);
Vue.use(VueFire); Vue.use(VueFire);
Vue.use(VueI18n); Vue.use(VueI18n);
Vue.component('icon', Icon);
if (process.env.NODE_ENV !== 'development') { if (process.env.NODE_ENV !== 'development') {
Raven Raven
@ -53,10 +53,6 @@ const vuexStorage = localStorage && localStorage.vuex
? JSON.parse(localStorage.vuex) ? JSON.parse(localStorage.vuex)
: {}; : {};
if (vuexStorage.settings && vuexStorage.settings.theme && vuexStorage.settings.theme.cssCdn) {
document.querySelector('link[rel="stylesheet"').href = vuexStorage.settings.theme.cssCdn;
}
if (vuexStorage && vuexStorage.user && window.FS && window.location.origin.indexOf('localhost') === -1) { if (vuexStorage && vuexStorage.user && window.FS && window.location.origin.indexOf('localhost') === -1) {
const { displayName, email, dateJoined } = vuexStorage.user; const { displayName, email, dateJoined } = vuexStorage.user;

View file

@ -2,8 +2,8 @@
<b-overlay show no-center no-wrap> <b-overlay show no-center no-wrap>
<template v-slot:overlay> <template v-slot:overlay>
<div class="text-center p-4"> <div class="text-center p-4">
<b-icon-arrow-clockwise font-scale="3" animation="spin" /> <icon name="sync" animated />
<p id="cancel-label">Please wait...</p> <p>Please wait...</p>
</div> </div>
</template> </template>
</b-overlay> </b-overlay>

View file

@ -94,14 +94,14 @@
variant="primary" variant="primary"
@click="editTag(name)" @click="editTag(name)"
> >
<b-icon-pencil /> <icon name="pencil" white />
</b-button> </b-button>
<b-button <b-button
variant="danger" variant="danger"
@click="deleteTag(name)" @click="deleteTag(name)"
> >
<b-icon-trash /> <icon name="trash" white />
</b-button> </b-button>
</div> </div>
</b-list-group-item> </b-list-group-item>

View file

@ -70,7 +70,7 @@
size="sm" size="sm"
@click="confirmDeleteWallpaper(wallpaper)" @click="confirmDeleteWallpaper(wallpaper)"
> >
<b-icon-trash /> <icon name="trash" white />
</b-button> </b-button>
</b-card> </b-card>
</b-col> </b-col>