Skip to content

Commit

Permalink
Improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrillberg committed Jul 7, 2024
1 parent bea8613 commit 86ee4d7
Show file tree
Hide file tree
Showing 17 changed files with 3,615 additions and 2,615 deletions.
106 changes: 99 additions & 7 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,65 @@
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)

import '@mdi/font/css/materialdesignicons.css';
import { createApp } from 'vue';
import VueCookies from 'vue3-cookies';

import * as Sentry from '@sentry/vue';

import { createVuetify } from 'vuetify';
/* eslint-disable import/no-unresolved */
import * as components from 'vuetify/components';
import * as directives from 'vuetify/directives';
import { aliases, mdi } from 'vuetify/iconsets/mdi';
import '../styles/site.scss';
import { aliases, mdi } from 'vuetify/iconsets/mdi-svg';
// import {
// VApp,
// VContainer,
// VLayout,
// VMain,
// VProgressCircular,
// VDialog,
// VBtn,
// VCard,
// VCardTitle,
// VCardText,
// VRow,
// VCol,
// VCardActions,
// VTooltip,
// VSheet,
// VToolbar,
// VTable,
// VTextField,
// VRadio,
// VRadioGroup,
// VForm,
// } from 'vuetify/components';
import * as components from 'vuetify/components'

Check failure on line 48 in app/javascript/packs/application.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Missing semicolon
/* eslint-enable import/no-unresolved */
import {
mdiAccount,
mdiAccountGroup,
mdiAccountPlus,
mdiBookOpenVariant,
mdiCircle,
mdiCircleMedium,
mdiClose,
mdiContentDuplicate,
mdiCrown,
mdiEmailOutline,
mdiFlag,
mdiFullscreen,
mdiHelpCircleOutline,
mdiHome,
mdiIncognito,
mdiInformation,
mdiLogout,
mdiScriptTextOutline,
mdiStar,
mdiThemeLightDark,
mdiTimerSand,
mdiTrophy,
} from '@mdi/js';
import '../styles/site.scss';

import { VueMasonryPlugin } from 'vue-masonry';
import { nationColors } from '../../../nationColors';
import App from '../src/App.vue';
Expand Down Expand Up @@ -54,10 +100,56 @@ const lightTheme = {

const vuetify = createVuetify({
components,
directives,
// components: {
// VApp,
// VLayout,
// VMain,
// VContainer,
// VProgressCircular,
// VDialog,
// VBtn,
// VCard,
// VCardTitle,
// VCardText,
// VRow,
// VCol,
// VCardActions,
// VTooltip,
// VSheet,
// VToolbar,
// VTable,
// VTextField,
// VRadio,
// VRadioGroup,
// VForm,
// },
icons: {
defaultSet: 'mdi',
aliases,
aliases: {
...aliases,
account: mdiAccount,
accountGroup: mdiAccountGroup,
accountPlus: mdiAccountPlus,
bookOpenVariant: mdiBookOpenVariant,
close: mdiClose,
circle: mdiCircle,
circleMedium: mdiCircleMedium,
contentDuplicate: mdiContentDuplicate,
crown: mdiCrown,
emailOutline: mdiEmailOutline,
flag: mdiFlag,
fullscreen: mdiFullscreen,
helpCircleOutline: mdiHelpCircleOutline,
home: mdiHome,
incognito: mdiIncognito,
information: mdiInformation,
logout: mdiLogout,
scriptTextOutline: mdiScriptTextOutline,
star: mdiStar,
themeLightDark: mdiThemeLightDark,
timerSand: mdiTimerSand,
trophy: mdiTrophy,
},
sets: {
mdi,
},
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion app/javascript/src/components/BondPurchase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<template #append>
<v-btn
icon="mdi-close"
icon="$close"
@click="dialog = false"
/>
</template>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/src/components/CurrentGames.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<v-icon
v-if="users.includes(player.name)"
color="success"
icon="mdi-circle"
icon="$circle"
size="small"
/>
{{ player.name }}
Expand Down
37 changes: 19 additions & 18 deletions app/javascript/src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<v-btn
v-if="$route.path !== '/'"
to="/"
prepend-icon="mdi-home"
prepend-icon="$home"
stacked
>
Home
Expand All @@ -31,7 +31,7 @@
<!-- User is registered and signed in -->
<v-btn
v-if="profile.email"
prepend-icon="mdi-account"
:prepend-icon="mdiAccount"
class="text-none"
stacked
v-bind="props"
Expand All @@ -41,8 +41,8 @@
<!-- User is anonymous (not registered) and signed in -->
<v-btn
v-if="profile.anonymityConfirmedAt && !profile.email"
prepend-icon="mdi-incognito"
class="text-none"
prepend-icon="$incognito"
class="text-none incognito"
stacked
v-bind="props"
>
Expand All @@ -51,8 +51,8 @@
<!-- User is not signed in -->
<v-btn
v-if="!profile.anonymityConfirmedAt && !profile.email"
icon="mdi-incognito"
class="text-none"
icon="$incognito"
class="text-none incognito"
stacked
v-bind="props"
/>
Expand All @@ -61,53 +61,54 @@
<!-- User is registered and signed in -->
<v-list-item
v-if="profile.email"
prepend-icon="mdi-account"
prepend-icon="$account"
title="Profile"
:to="'/users/' + profile.id"
/>
<v-list-item
v-if="profile.email"
prepend-icon="mdi-logout"
prepend-icon="$logout"
title="Sign out"
@click="signOut"
/>
<!-- User is anonymous (not registered) and signed in -->
<v-list-item
v-if="profile.anonymityConfirmedAt && !profile.email"
prepend-icon="mdi-account-plus"
prepend-icon="$accountPlus"
title="Register"
@click="register"
/>
<v-list-item
v-if="profile.anonymityConfirmedAt && !profile.email"
prepend-icon="mdi-logout"
prepend-icon="$logout"
title="Permanently sign out"
@click="signOut"
/>
<!-- User is not signed in -->
<v-list-item
v-if="!profile.anonymityConfirmedAt && !profile.email"
prepend-icon="mdi-account"
prepend-icon="$account"
title="Sign In"
@click="signIn"
/>
<v-list-item
v-if="!profile.anonymityConfirmedAt && !profile.email"
prepend-icon="mdi-account-plus"
prepend-icon="$accountPlus"
title="Register"
@click="register"
/>
<v-list-item
v-if="!profile.anonymityConfirmedAt && !profile.email && Object.keys(profile).length > 0"
prepend-icon="mdi-incognito"
prepend-icon="$incognito"
class="incognito"
@click="setAnonymous"
>
Play anonymously as {{ profile.username }}
</v-list-item>
</v-list>
</v-menu>
<v-btn
icon="mdi-theme-light-dark"
icon="$themeLightDark"
@click="toggleTheme"
/>
</v-app-bar>
Expand All @@ -119,7 +120,7 @@
>
<template #prepend>
<v-icon color="primary-darken-1">
mdi-crown
$crown
</v-icon>
</template>
</v-list-item>
Expand All @@ -130,7 +131,7 @@
>
<template #prepend>
<v-icon color="primary-darken-1">
mdi-content-duplicate
$contentDuplicate
</v-icon>
</template>
</v-list-item>
Expand All @@ -140,7 +141,7 @@
>
<template #prepend>
<v-icon color="primary-darken-1">
mdi-information
$information
</v-icon>
</template>
</v-list-item>
Expand All @@ -150,7 +151,7 @@
>
<template #prepend>
<v-icon color="primary-darken-1">
mdi-trophy
$trophy
</v-icon>
</template>
</v-list-item>
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/src/components/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
v-if="onlineUsers.includes(player.name)"
color="blue"
>
mdi-circle-medium
$circleMedium
</v-icon>
</template>
{{ player.name }}
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/src/components/YourGames.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#prepend
>
<v-btn
icon="mdi-star"
icon="$star"
color="yellow"
/>
</template>
Expand All @@ -52,7 +52,7 @@
<v-icon
v-if="users.includes(player.name)"
color="success"
icon="mdi-circle"
icon="$circle"
size="small"
/>
{{ player.name }}
Expand All @@ -67,7 +67,7 @@
/>
</v-col>
<v-divider class="my-2" />
<span><v-icon icon="mdi-timer-sand" />Time Commitment: {{ timeCommitment(game.timeCommitment) }}</span>
<span><v-icon icon="$timerSand" />Time Commitment: {{ timeCommitment(game.timeCommitment) }}</span>
</v-row>
</v-card-text>
</v-card>
Expand Down
Loading

0 comments on commit 86ee4d7

Please sign in to comment.