Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM Screen #179

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8acd302
Setup dm screen route with splitpanes
Lakeyzer Jul 7, 2023
e3e2928
Panes added for media and sharing
Lakeyzer Jul 7, 2023
37d09e4
Resources Pane added with compendium and notes
Lakeyzer Jul 8, 2023
0844528
Renamed Slide to Drawer
Lakeyzer Jul 8, 2023
fd174f1
Notes added in resources panel
Lakeyzer Jul 8, 2023
10d6dec
Update notes
Lakeyzer Jul 8, 2023
b3a4fff
No horizontal scroll on Panes
Lakeyzer Jul 8, 2023
cef8af1
Share panel only available when live
Lakeyzer Jul 8, 2023
27d82db
Allow user to set share
Lakeyzer Jul 9, 2023
8db95e6
Show weather effects on live initiative when not running an encounter
Lakeyzer Jul 10, 2023
9183048
Set background images and videos for a campaign
Lakeyzer Jul 10, 2023
9c86365
Remove zoom from quake effect
Lakeyzer Jul 10, 2023
d934246
Validate background inputs
Lakeyzer Jul 10, 2023
5a05880
Validate share inputs
Lakeyzer Jul 10, 2023
67b1e30
Share a video, image or message
Lakeyzer Jul 10, 2023
0efadad
Setup responsiveness for DM Screen
Lakeyzer Jul 12, 2023
2149003
Improved responsiveness
Lakeyzer Jul 14, 2023
727816e
Finish merge
Lakeyzer Oct 13, 2023
b043c2e
Resolve final merging issue
Lakeyzer Oct 13, 2023
81daab2
Setup SoundBoard
Lakeyzer Oct 13, 2023
766671f
Update rain ambiance
Lakeyzer Oct 20, 2023
98383aa
Soundboard improvements
Lakeyzer Oct 20, 2023
1745c4e
More soundboard links added with icons
Lakeyzer Oct 27, 2023
baa5c2d
Missing icons for soundboard added
Lakeyzer Nov 3, 2023
13ef414
Manage custom soundboard
Lakeyzer Nov 3, 2023
33235f1
Search soundboard
Lakeyzer Nov 3, 2023
2b900a8
Share panel buttons in footer
Lakeyzer Nov 3, 2023
d6c7d09
Merge branch 'develop' into feature/dm_screen
Lakeyzer Nov 3, 2023
3d7737e
SonarCloud bug fixed
Lakeyzer Nov 3, 2023
143d52b
Regex bugs fixed
Lakeyzer Nov 3, 2023
6f2eab6
Code smells resolved
Lakeyzer Nov 3, 2023
ab0508f
Fix embed url regex
Lakeyzer Nov 10, 2023
fb2b977
Added Cheat Sheet
Lakeyzer Nov 10, 2023
f51d205
slides is now drawers
Lakeyzer Nov 10, 2023
16b0eb1
Add tools page for DM Screen
Lakeyzer Nov 10, 2023
8dd1d30
Added Rules to compendium
Lakeyzer Nov 12, 2023
ff1afb2
Update xml sitemap
Lakeyzer Nov 13, 2023
d10c877
Update dm screen layout
Lakeyzer Nov 17, 2023
fbf7346
Added content for DM Screen page in Tools
Lakeyzer Nov 17, 2023
7519d7a
Merge branch 'develop' into feature/dm_screen
Lakeyzer Nov 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"morgan": "^1.10.0",
"quasar": "^1.0.0",
"sanitize-html": "^2.7.0",
"splitpanes": "^2.4.1",
"vee-validate": "^3.4.14",
"vue": "^2.7.14",
"vue-analytics": "^5.22.1",
Expand Down
2 changes: 1 addition & 1 deletion public/sitemap.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion quasar.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module.exports = function (/* ctx */) {
start_url: ".",
description:
"Harmless Key is the initiative tracker for D&D 5e. We keep track of everything in encounters so even during combat you can give your players the attention they deserve.",
orientation: "portrait",
orientation: "any",
theme_color: "#191a1c",
background_color: "#191a1c",
display: "standalone",
Expand Down
21 changes: 5 additions & 16 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,8 @@
enter-active-class="animated animate__slideInRight"
leave-active-class="animated animate__slideOutRight"
>
<div v-if="slide.show == true" class="slide">
<a @click="hideSlide()" v-shortkey="['esc']" @shortkey="hideSlide()" class="hide">
<i aria-hidden="true" class="far fa-chevron-double-right" />
<hk-show-keybind class="neutral-2 ml-2 d-none d-sm-inline" :binds="['esc']" />
<q-tooltip anchor="bottom middle" self="center middle"> Hide [esc] </q-tooltip>
</a>
<div class="content" :class="slide.classes">
<Slide />
</div>
<div v-if="drawer.show == true" class="drawer-wrapper">
<Drawer />
</div>
</transition>

Expand Down Expand Up @@ -68,7 +61,7 @@
import { db } from "./firebase";
import Header from "./components/Header.vue";
import Sidebar from "./components/Sidebar.vue";
import Slide from "./components/Slide.vue";
import Drawer from "./components/Drawer.vue";
import CookieConsent from "./components/CookieConsent.vue";
import { mapActions, mapGetters } from "vuex";
import HkRolls from "./components/hk-components/hk-rolls";
Expand All @@ -84,7 +77,7 @@ export default {
components: {
navMain: Header,
Sidebar,
Slide,
Drawer,
CookieConsent,
HkRolls,
Home,
Expand Down Expand Up @@ -238,7 +231,7 @@ export default {
},
computed: {
...mapGetters({
slide: "getSlide",
drawer: "getDrawer",
storeBroadcast: "broadcast",
}),
...mapGetters(["initialized", "theme", "user", "action_rolls"]),
Expand Down Expand Up @@ -313,7 +306,6 @@ export default {
},
methods: {
...mapActions([
"setSlide",
"setSideSmallScreen",
"setLive",
"initialize",
Expand All @@ -325,9 +317,6 @@ export default {
this.small_screen = size.width < 576;
this.width = size.width;
},
hideSlide() {
this.setSlide(false);
},
closeAnnouncement() {
const max_age = 24 * 60 * 60; // 24 hours in seconds

Expand Down
Binary file added src/assets/_img/soundboard/battle.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/battlefield.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/campfire.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/cave.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/combat_1.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/combat_2.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/eerie_ambience.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/eerie_music.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/forest_by_day.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/forest_by_night.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/magical.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/mysterious.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/rain.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/snow.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/suspense.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/tavern.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/tavern_music.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/thunder.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/town_by_day.webp
Binary file not shown.
Binary file added src/assets/_img/soundboard/town_by_night.webp
Binary file not shown.
Binary file added src/assets/_img/tools/dm-screen/dm-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/boot/hk-components.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import HkInput from "../components/hk-components/hk-input";
import HkSelect from "../components/hk-components/hk-select";
import HkIcon from "../components/hk-components/hk-icon";
import HkTable from "../components/hk-components/hk-table";
import HkCard from "../components/hk-components/hk-card";
import HkCardDeck from "../components/hk-components/hk-card-deck";
Expand All @@ -20,8 +23,12 @@ import HkLinkCharacter from "../components/hk-components/hk-link-character";
import HkActionRollForm from "../components/hk-components/hk-action-rolls/hk-action-roll-form";
import HkActionRollsTable from "../components/hk-components/hk-action-rolls/hk-action-rolls-table";
import HkActionRollScaling from "../components/hk-components/hk-action-rolls/hk-action-roll-scaling";
import HkPane from "../components/hk-components/hk-pane";

export default async ({ Vue }) => {
Vue.component("hk-input", HkInput);
Vue.component("hk-select", HkSelect);
Vue.component("hk-icon", HkIcon);
Vue.component("hk-table", HkTable);
Vue.component("hk-card", HkCard);
Vue.component("hk-card-deck", HkCardDeck);
Expand All @@ -44,4 +51,5 @@ export default async ({ Vue }) => {
Vue.component("hk-action-roll-form", HkActionRollForm);
Vue.component("hk-action-rolls-table", HkActionRollsTable);
Vue.component("hk-action-roll-scaling", HkActionRollScaling);
Vue.component("hk-pane", HkPane);
};
4 changes: 4 additions & 0 deletions src/boot/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import numeral from "vue-numeral-filter";
import "animate.css";
import Croppa from "vue-croppa";
import { Cookies } from "quasar";
import { Splitpanes, Pane } from "splitpanes";

export default async ({ router, Vue }) => {
Vue.config.productionTip = false;
Expand All @@ -14,6 +15,9 @@ export default async ({ router, Vue }) => {
Vue.use(numeral, { locale: "en" });
Vue.use(Croppa);

Vue.component("Splitpanes", Splitpanes);
Vue.component("Pane", Pane);

require("../functions.js");

Vue.use(
Expand Down
8 changes: 4 additions & 4 deletions src/components/ContentSideRight.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<button
class="btn btn-block bg-green"
@click="
setSlide({
setDrawer({
show: true,
type: 'slides/CharacterSync',
type: 'drawers/CharacterSync',
})
"
>
Expand Down Expand Up @@ -62,7 +62,7 @@
Share initiative
<i class="fas fa-external-link blue-light" aria-hidden="true" />
</a>
<a class="btn btn-sm bg-neutral-5" @click="setSlide({ show: true, type: 'PlayerLink' })">
<a class="btn btn-sm bg-neutral-5" @click="setDrawer({ show: true, type: 'PlayerLink' })">
<i aria-hidden="true" class="fas fa-qrcode" />
</a>
</div>
Expand Down Expand Up @@ -228,7 +228,7 @@ export default {
},
},
methods: {
...mapActions(["setSlide"]),
...mapActions(["setDrawer"]),
setWidth(size) {
this.width = size.width;
},
Expand Down
70 changes: 70 additions & 0 deletions src/components/Drawer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<template>
<div class="drawer">
<a @click="hideDrawer()" v-shortkey="['esc']" @shortkey="hideDrawer()" class="hide">
<i aria-hidden="true" class="far fa-chevron-double-right" />
<span class="neutral-2 ml-2 d-none d-sm-inline">[esc]</span>
<q-tooltip anchor="bottom middle" self="center middle"> Hide [esc] </q-tooltip>
</a>
<q-scroll-area :dark="$store.getters.theme === 'dark'" :thumb-style="{ width: '5px' }">
<div class="drawer__content" :class="drawer.classes">
<component
v-if="component"
v-bind="drawer.data"
:is="component"
:data="drawer.data"
:type="drawer.type"
/>
</div>
</q-scroll-area>
</div>
</template>

<script>
import { mapActions } from "vuex";

export default {
name: "Drawer",
data() {
return {
drawer: this.$store.getters.getDrawer,
component: null,
};
},
computed: {
loader() {
if (!this.drawer.type) {
return null;
}
return () => import(`./${this.drawer.type}.vue`);
},
},
mounted() {
this.loader()
.then(() => {
this.component = () => this.loader();
})
.catch(() => {
this.component = () => import("./drawers/Error.vue");
});
},
methods: {
...mapActions(["setDrawer"]),
hideDrawer() {
this.setDrawer(false);
},
},
};
</script>

<style lang="scss" scoped>
.q-scrollarea {
height: 100%;
position: relative;

&::v-deep {
.q-scrollarea__content {
width: 100%;
}
}
}
</style>
24 changes: 12 additions & 12 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
</router-link>
</div>

<MusicPlayer />

<!-- ENVIRONMENT LABEL -->
<q-chip v-if="environment !== 'live'" color="red" icon="far fa-rocket" class="white">
<span class="ml-1">{{ environment.capitalize() }}</span>
Expand Down Expand Up @@ -67,7 +69,7 @@
class="icon d-none d-md-block"
aria-label="Keybindings"
:tabindex="tabindex"
@click="setSlide({ show: true, type: 'slides/Keybindings', data: { sm: true } })"
@click="setDrawer({ show: true, type: 'drawers/Keybindings', data: { sm: true } })"
>
<i aria-hidden="true" class="fas fa-keyboard" />
<q-tooltip anchor="bottom middle" self="top middle" :offset="[0, 10]">
Expand All @@ -78,7 +80,7 @@
class="icon"
aria-label="Compendium"
:tabindex="tabindex"
@click="setSlide({ show: true, type: 'slides/Compendium' })"
@click="setDrawer({ show: true, type: 'drawers/Compendium' })"
>
<i aria-hidden="true" class="fas fa-book-spells"></i>
<q-tooltip anchor="bottom middle" self="top middle" :offset="[0, 10]">
Expand All @@ -90,7 +92,7 @@
aria-label="Live initiative link"
class="icon"
:tabindex="tabindex"
@click="setSlide({ show: true, type: 'PlayerLink' })"
@click="setDrawer({ show: true, type: 'PlayerLink' })"
>
<i aria-hidden="true" class="fas fa-share-alt"></i>
<q-tooltip anchor="bottom middle" self="top middle" :offset="[0, 10]">
Expand All @@ -102,8 +104,8 @@
aria-label="Dice roller"
v-shortkey="['r']"
:tabindex="tabindex"
@shortkey="setSlide({ show: true, type: 'slides/roll/index' })"
@click="setSlide({ show: true, type: 'slides/roll/index' })"
@shortkey="setDrawer({ show: true, type: 'drawers/roll/index' })"
@click="setDrawer({ show: true, type: 'drawers/roll/index' })"
>
<q-tooltip anchor="bottom middle" self="top middle" :offset="[0, 10]">
Dice roller
Expand Down Expand Up @@ -176,10 +178,14 @@
</template>

<script>
import MusicPlayer from "./MusicPlayer";
import { mapActions, mapGetters } from "vuex";

export default {
name: "Header",
components: {
MusicPlayer,
},
props: {
maintenance: {
type: [Boolean, String],
Expand All @@ -198,13 +204,7 @@ export default {
},
},
methods: {
...mapActions(["setSlide", "setSideSmallScreen", "setTheme", "sign_out"]),
showSlide(type) {
this.setSlide({
show: true,
type,
});
},
...mapActions(["setDrawer", "setSideSmallScreen", "setTheme", "sign_out"]),
signOut() {
if (this.$route.path !== "/") this.$router.replace("/");
this.sign_out();
Expand Down
48 changes: 48 additions & 0 deletions src/components/MusicPlayer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<template>
<div>
<iframe
v-if="music"
ref="music"
:src="`${music_url}?autoplay=1&mute=0&playsinline=1&controls=0`"
title="Music player"
class="music-player"
allow="autoplay"
/>
<iframe
v-for="sound in ambience"
:key="sound.url"
:src="`${ambience_url(sound.url)}?autoplay=1&mute=0&playsinline=1&controls=0`"
title="Music player"
class="music-player"
allow="autoplay"
/>
</div>
</template>

<script>
import { generateYoutubeEmbedUrl, urlType } from "src/utils/generalFunctions";
import { mapGetters } from "vuex";

export default {
name: "MusicPlayer",
computed: {
...mapGetters(["music", "ambience"]),
music_url() {
return urlType(this.music?.url) === "youtube"
? generateYoutubeEmbedUrl(this.music?.url)
: this.music?.url;
},
},
methods: {
ambience_url(url) {
return urlType(url) === "youtube" ? generateYoutubeEmbedUrl(url) : url;
},
},
};
</script>

<style lang="scss" scoped>
iframe {
display: none;
}
</style>
Loading
Loading