Przeglądaj źródła

move the changed indicator on top of the editor textarea

so that you can actually see it.
Lucas Stadler 10 lat temu
rodzic
commit
f207d0a79b
2 zmienionych plików z 8 dodań i 0 usunięć
  1. 2 0
      glsl/files.js
  2. 6 0
      glsl/raymarching.js

+ 2 - 0
glsl/files.js

103
  }
103
  }
104
104
105
  var nameEl = document.createElement("input");
105
  var nameEl = document.createElement("input");
106
  nameEl.id = "editor-name";
106
  nameEl.value = files.current;
107
  nameEl.value = files.current;
107
  nameEl.maxlength = 20;
108
  nameEl.maxlength = 20;
108
  nameEl.placeholder = "Name of the shader";
109
  nameEl.placeholder = "Name of the shader";
145
  });
146
  });
146
147
147
  var changeEl = document.createElement("span");
148
  var changeEl = document.createElement("span");
149
  changeEl.id = "editor-changed";
148
  
150
  
149
  editorEl.addEventListener("keydown", function(ev) {
151
  editorEl.addEventListener("keydown", function(ev) {
150
    if (ev.ctrlKey && ev.keyCode == 83) { // Ctrl-s
152
    if (ev.ctrlKey && ev.keyCode == 83) { // Ctrl-s

+ 6 - 0
glsl/raymarching.js

111
  border: none;
111
  border: none;
112
  background-color: rgba(255, 255, 255, 0.8);
112
  background-color: rgba(255, 255, 255, 0.8);
113
}
113
}
114
115
#editor-changed {
116
  position: absolute;
117
  right: 0;
118
  top: 1.5em;
119
}
114
  `
120
  `
115
  document.head.appendChild(styleEl);
121
  document.head.appendChild(styleEl);
116
  
122