Skip to content

Commit

Permalink
save and reload state
Browse files Browse the repository at this point in the history
  • Loading branch information
ccosse committed Feb 16, 2017
1 parent bb5aeeb commit 63f51d5
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 201 deletions.
17 changes: 17 additions & 0 deletions css/activity.css
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,20 @@
.palette .colors tr:nth-last-child(1) button {
margin-bottom: 5.5px;
}
.save-load-state-button {
background-color: #4C50AF;
border: none;
color: white;
padding: 5px 5px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 18px;
border-radius:12px;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;

}
.save-load-state-button:hover {
background-color: #4CEF50;
}
5 changes: 3 additions & 2 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define([
var persistent_title_div=document.getElementById("persistent_title_div");
html="";
for(var tidx=0;tidx<app_title.length;tidx++){
var rand_color=util.mkBrightRGBA();
var rand_color=colormyworld.mkBrightRGBA();
html+="<span style='text-shadow:none;font-family:Mickey;color:"+rand_color+";'>"+app_title[tidx]+"</span>";
}
persistent_title_div.innerHTML=html;
Expand Down Expand Up @@ -60,12 +60,13 @@ define([
runButton.onclick = function () {
colormyworld.toggleRunning();
}

colormyworld.setRGBColorString('rgb(0, 0, 255)');
var colorButton = document.getElementById("color-button");
var changeColorPalette = new colorpalette.ColorPalette(colorButton);
changeColorPalette.setColor(colormyworld.getRGBColorString()); // Initial color
changeColorPalette.addEventListener('colorChange', function(e) {
console.log(e.detail.color); // New color selected
print(e.detail.color); // New color selected
colormyworld.setRGBColorString(e.detail.color);
});
/*
Expand Down
Loading

0 comments on commit 63f51d5

Please sign in to comment.