Skip to content

Commit

Permalink
Add back to wled button
Browse files Browse the repository at this point in the history
  • Loading branch information
mvaneijgen committed Jan 24, 2024
1 parent 858662d commit bdfb3cd
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 4 deletions.
21 changes: 20 additions & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ input[type=checkbox] {
transform: translateY(6px);
}

.btn,
button {
width: 100%;
padding: 10px;
Expand All @@ -581,15 +582,24 @@ button {
transition-duration: 300ms;
transition-timing-function: ease;
}
.btn:hover,
button:hover {
background-color: #0ba;
color: #0c162d;
}

.btn {
background-color: #0ba;
color: #0c162d;
}
.btn:hover {
background-color: #f53;
color: #fff;
}

.btn-alt {
background-color: #ccc;
color: #0c162d;
padding: 10px;
}

button[disabled] {
Expand Down Expand Up @@ -618,4 +628,13 @@ pre {
font-size: 0.8rem;
max-width: 100%;
width: 240px;
}

.back-to-wled {
position: absolute;
top: 0;
left: 0;
width: auto;
text-decoration: none;
font-size: 14px;
}/*# sourceMappingURL=style.css.map */
2 changes: 1 addition & 1 deletion assets/css/style.css.map

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

22 changes: 21 additions & 1 deletion assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ input[type="checkbox"] {
transform: translateY(6px);
}

.btn,
button {
width: 100%;
padding: 10px;
Expand All @@ -414,10 +415,20 @@ button {
}
}

.btn {
background-color: $brand-one;
color: $brand-dark;

&:hover {
background-color: $brand-two;
color: $brand-light;
}
}

.btn-alt {
background-color: #ccc;
color: $brand-dark;
padding: 10px;

}

button[disabled] {
Expand Down Expand Up @@ -447,4 +458,13 @@ pre {
font-size: 0.8rem;
max-width: 100%;
width: 240px;
}

.back-to-wled {
position: absolute;
top: 0;
left: 0;
width: auto;
text-decoration: none;
font-size: 14px;
}
4 changes: 4 additions & 0 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const App = {
version: "1.2",
// WLED JSON
url: "",
wledUrl: "",
size: 10,
x: 16,
y: 16,
Expand Down Expand Up @@ -170,6 +171,9 @@ const App = {
})
.then((data) => {
console.log(data);
const url = new URL(this.url);
const domain = `${url.protocol}//${url.hostname}`;
this.wledUrl = domain;
this.x = data.info.leds.matrix.w;
this.y = data.info.leds.matrix.h;
localStorage.x = this.x;
Expand Down
26 changes: 25 additions & 1 deletion dist/drawsomething.html
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@
transform: translateY(6px);
}

.btn,
button {
width: 100%;
padding: 10px;
Expand All @@ -586,15 +587,24 @@
transition-duration: 300ms;
transition-timing-function: ease;
}
.btn:hover,
button:hover {
background-color: #0ba;
color: #0c162d;
}

.btn {
background-color: #0ba;
color: #0c162d;
}
.btn:hover {
background-color: #f53;
color: #fff;
}

.btn-alt {
background-color: #ccc;
color: #0c162d;
padding: 10px;
}

button[disabled] {
Expand Down Expand Up @@ -623,6 +633,15 @@
font-size: 0.8rem;
max-width: 100%;
width: 240px;
}

.back-to-wled {
position: absolute;
top: 0;
left: 0;
width: auto;
text-decoration: none;
font-size: 14px;
}/*# sourceMappingURL=style.css.map */</style>
<!-- HTML Meta Tags -->
<title>WLED Draw Something</title>
Expand Down Expand Up @@ -660,6 +679,7 @@ <h1>{{ title }}</h1>
<h3>Version {{version}}</h3>
<p v-if="demo" class="description">Demo mode is activated. For the best use of this tool install it in to your WLED controller, see <a href="https://github.com/mvaneijgen/wled-draw-something#use-the-tool">install guide on Github!</a></p>
</div>
<a class="btn btn-two back-to-wled" v-if="wledUrl" :href="wledUrl">⬅ Go back to WLED</a>
<!-- 🎛️ Controls -->
<div class="controls">
<div class="alloy-input-group">
Expand Down Expand Up @@ -780,6 +800,7 @@ <h3>We could not fetch your settings at <i>{{url}}</i></h3>
version: "1.2",
// WLED JSON
url: "",
wledUrl: "",
size: 10,
x: 16,
y: 16,
Expand Down Expand Up @@ -941,6 +962,9 @@ <h3>We could not fetch your settings at <i>{{url}}</i></h3>
})
.then((data) => {
console.log(data);
const url = new URL(this.url);
const domain = `${url.protocol}//${url.hostname}`;
this.wledUrl = domain;
this.x = data.info.leds.matrix.w;
this.y = data.info.leds.matrix.h;
localStorage.x = this.x;
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ <h1>{{ title }}</h1>
<h3>Version {{version}}</h3>
<p v-if="demo" class="description">Demo mode is activated. For the best use of this tool install it in to your WLED controller, see <a href="https://github.com/mvaneijgen/wled-draw-something#use-the-tool">install guide on Github!</a></p>
</div>
<a class="btn btn-two back-to-wled" v-if="wledUrl" :href="wledUrl">⬅ Go back to WLED</a>
<!-- 🎛️ Controls -->
<div class="controls">
<div class="alloy-input-group">
Expand Down

0 comments on commit bdfb3cd

Please sign in to comment.