瀏覽代碼

Put app title in top bar. Added a little random color effect to the 'Paint' title.

dev-tmpl
Bryan Miller 6 年之前
父節點
當前提交
5284af0dd5
共有 3 個檔案被更改,包括 21 行新增1 行删除
  1. +4
    -0
      app/css/nespaint.css
  2. +13
    -0
      app/js/main.js
  3. +4
    -1
      index.html

+ 4
- 0
app/css/nespaint.css 查看文件

@@ -16,6 +16,10 @@ body{
}


span.color-NES-06{
color:#A80020;
}

/* NOTE: Modal styles were borrowed from
* https://www.w3schools.com/howto/howto_css_modals.asp
* and modified.

+ 13
- 0
app/js/main.js 查看文件

@@ -19,7 +19,20 @@ function handle_emitted(){
console.log("EMITTED EVENT!");
}

function TitlePainter(pal){
var elist = document.querySelectorAll(".color-NES-random");
if (elist){
elist.forEach(function(el){
var ca = Math.floor(Math.random() * 11) + 1;
var cb = Math.floor(Math.random() * 3);
var index = (cb*16)+ca;
el.style.color = pal[index];
});
}
}

function initialize(DOC){
TitlePainter(NESPalette.SystemColor);
EmitterElements.initialize();
//EventWindow.enable_emitter_attributes();
GlobalEvents.listen("emitted-event", handle_emitted);

+ 4
- 1
index.html 查看文件

@@ -20,7 +20,10 @@

<div class="header">
<div class="home-menu pure-menu pure-menu-horizontal">
<a class="pure-menu-heading" href="">Your Site</a>
<a class="pure-menu-heading" href="">
<span class="color-NES-06">NES </span>
<span class="color-NES-random">P</span><span class="color-NES-random">a</span><span class="color-NES-random">i</span><span class="color-NES-random">n</span><span class="color-NES-random">t</span>
</a>
<ul class="pure-menu-list">
<li class="pure-menu-item pure-menu-selected">
<button emit="modal-open" emit-args='{"id":"Welcome"}' class="pure-button">

Loading…
取消
儲存