Skip to content

Commit

Permalink
Add demo logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mvaneijgen committed Jan 23, 2024
1 parent 17fa3e8 commit 678815f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const App = {
loading: true,
options: false,
ignore: false,
demo: false,
};
},
computed: {
Expand Down Expand Up @@ -243,6 +244,7 @@ const App = {
this.url = `http://${host}/json`;
if (host === 'mvaneijgen.nl') {
this.ignoreNotice();
this.demo = true;
}
//--------------------------------//
// 💾 Get everything from local storage
Expand Down
7 changes: 5 additions & 2 deletions dist/drawsomething.html
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ <h3>Version {{version}}</h3>
</div>
<div class="alloy-input-group" v-if="options">
<label for="url">API url</label>
<input type="text" id="url" v-model="url">
<p v-if="demo">You can't use the API on the demo page</p>
<input type="text" id="url" v-model="url" :disabled="demo ? '' : disabled">
</div>
<div class="alloy-input-flex" v-if="options">
<div class="alloy-input-group">
Expand Down Expand Up @@ -737,7 +738,7 @@ <h3>We could not fetch your settings at <i>{{url}}</i></h3>
return {
// App info
title: "Draw something",
version: "Beta 1.2",
version: "Alpha 1.2",
// WLED JSON
url: "",
size: 10,
Expand Down Expand Up @@ -766,6 +767,7 @@ <h3>We could not fetch your settings at <i>{{url}}</i></h3>
loading: true,
options: false,
ignore: false,
demo: false,
};
},
computed: {
Expand Down Expand Up @@ -974,6 +976,7 @@ <h3>We could not fetch your settings at <i>{{url}}</i></h3>
this.url = `http://${host}/json`;
if (host === 'mvaneijgen.nl') {
this.ignoreNotice();
this.demo = true;
}
//--------------------------------//
// 💾 Get everything from local storage
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ <h3>Version {{version}}</h3>
</div>
<div class="alloy-input-group" v-if="options">
<label for="url">API url</label>
<input type="text" id="url" v-model="url">
<p v-if="demo">You can't use the API on the demo page</p>
<input type="text" id="url" v-model="url" :disabled="demo ? '' : disabled">
</div>
<div class="alloy-input-flex" v-if="options">
<div class="alloy-input-group">
Expand Down

0 comments on commit 678815f

Please sign in to comment.