Skip to content

Commit

Permalink
Always show welcome message, button resumes AudioContext
Browse files Browse the repository at this point in the history
  • Loading branch information
ajm13 committed Jan 28, 2019
1 parent cf56c90 commit 83df5b2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 43 deletions.
7 changes: 1 addition & 6 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const state = saved || {
autoQ: true,
scale: 1,
showFPS: false,
showDonate: true,
showWelcome: true
showDonate: true
}
}

Expand All @@ -47,10 +46,6 @@ const mutations = {

stopShowingDonate(state) {
state.settings.showDonate = false
},

stopShowingWelcome(state) {
state.settings.showWelcome = false
}
}

Expand Down
66 changes: 29 additions & 37 deletions src/views/Visualizer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,50 @@
<div class="vis">
<div class="vis__container" ref="container"></div>
<template v-if="visualizer">
<div class="vis__controls" :class="{ hidden: !showControls }" @mousemove="detectedActive"
@click="detectedActive">
<div
class="vis__controls"
:class="{ hidden: !showControls }"
@mousemove="detectedActive"
@click="detectedActive"
>
<nav-bar/>
<vis-settings ref="visSettings" :visualizer="visualizer" />
<audio-controls :audio="audio" :microphone="microphone" :playlist="playlist" />
<vis-settings ref="visSettings" :visualizer="visualizer"/>
<audio-controls :audio="audio" :microphone="microphone" :playlist="playlist"/>
</div>
<audio-dropzone :playlist="playlist" />
<audio-dropzone :playlist="playlist"/>
<div v-if="settings.showFPS" class="vis__fps">{{ visualizer.fps }}</div>
</template>
<modal :show="settings.showWelcome && showWelcome">
<modal :show="showWelcome">
<div class="vis__welcome">
<h2>Welcome to
<rave/>
</h2>
<p>Drag and drop audio files or toggle microphone to begin. To use with Spotify
or YouTube, see
<p>
Drag and drop audio files or toggle microphone to begin.
To use with Spotify or YouTube, see
<router-link to="setup">setup</router-link>
</p>
<p>
<strong>Tip:</strong> If
<rave/> is slow or choppy,
<template v-if="!chromeOrFirefox">try
<rave/>&nbsp;is slow or choppy,
<template v-if="!chromeOrFirefox">
try
<a href="https://www.google.com/chrome/" target="_blank">Google Chrome</a>
or
<a href="https://www.mozilla.org/en-US/firefox/" target="_blank">Mozilla Firefox</a>, or
</template>try turning down quality in the settings panel</p>
<p>Best viewed in fullscreen</p>
<div class="flex">
<label class="btn block">
<input v-model="noMoreWelcome" type="checkbox"> don't show again
</label>
<button @click="hideWelcome">dismiss</button>
<a
href="https://www.mozilla.org/en-US/firefox/"
target="_blank"
>Mozilla Firefox</a>, or
</template>try turning down quality in the settings panel
</p>
<p class="center">Best viewed in fullscreen</p>
<div class="flex center">
<button @click="hideWelcome">enter raVe</button>
</div>
</div>
</modal>
<modal :show="!settings.showStart && showStart && !showWelcome">
<div class="vis-start">
<button @click="startVis">click to start</button>
</div>
</modal>
<modal :show="settings.showDonate && showDonate && !showWelcome">
<donate-form class="vis__donate" />
<donate-form class="vis__donate"/>
<div class="flex">
<label class="btn block" v-if="donateNumShow > 1">
<input v-model="noMoreDonate" type="checkbox"> don't show again
Expand Down Expand Up @@ -93,9 +95,6 @@ export default {
donateNumShow: 0,
showWelcome: true,
noMoreWelcome: false,
showStart: true,
userActive: true,
userActiveTO: 0,
Expand All @@ -113,7 +112,7 @@ export default {
},
methods: {
...mapMutations(['stopShowingDonate', 'stopShowingWelcome']),
...mapMutations(['stopShowingDonate']),
autoQuality() {
const fps = this.visualizer.tick - this.autoQLastTick
Expand All @@ -131,22 +130,16 @@ export default {
}
},
startVis() {
hideWelcome() {
if (this.acx.resume) this.acx.resume()
this.showStart = false
this.showWelcome = false
},
hideDonate() {
this.showDonate = false
if (this.noMoreDonate) this.stopShowingDonate()
},
hideWelcome() {
this.showWelcome = false
if (this.noMoreWelcome) this.stopShowingWelcome()
this.startVis()
},
displayDonate() {
this.showDonate = true
this.donateNumShow++
Expand Down Expand Up @@ -175,7 +168,6 @@ export default {
},
created() {
this.showWelcome = this.settings.showWelcome
this.showDonateTO = setTimeout(this.displayDonate, 6e4 * 20) // first at 20 min
this.showDonateIV = setInterval(this.displayDonate, 6e4 * 60) // then every 60 min
Expand Down

0 comments on commit 83df5b2

Please sign in to comment.