diff --git a/assets/style.css b/assets/style.css index 889d08f..1751d63 100644 --- a/assets/style.css +++ b/assets/style.css @@ -9,33 +9,36 @@ body { body>div { postion:relative; background: rgba(163,128,95,0.9); -/* align: center; - text-align: center;*/ border-radius: 20px; - padding: 5px; + padding: 5px 10px 5px 10px; width: } h1 { - align: center; + text-align: center; margin-top: 10px; } #game { width:auto; - margin: 20px auto; + margin: 0px 20px 0px 0px; border: #692200 4px solid ; + border-radius: 4px; + float:left; } #output { position:relative; - left: 20px; - width: 350px; } #ui { - position: relative; - right: 200px; - width: 350px; - bottom: 20px; + right: 30px; +} + +#load { + margin: 0px auto; +} + +#clear { + clear: both; } \ No newline at end of file diff --git a/index.html b/index.html index e4e6588..4a83c10 100644 --- a/index.html +++ b/index.html @@ -8,12 +8,15 @@

JSDSH - Javascript Dungeonslayers Helper

-
- -
+
- +
+ +
+ + +
diff --git a/src/base_ui.js b/src/base_ui.js index 53a1e1c..faf8e1f 100644 --- a/src/base_ui.js +++ b/src/base_ui.js @@ -1,3 +1,13 @@ $(document).ready( function() { - $('#load').click(function() { $.getScript("/assets/adv01/adv_01.js"); $('#load').hide();}); + $('#game').hide(); + $('#ui').hide(); + $('#output').hide(); + + $('#load').click(function() { + $.getScript("/assets/adv01/adv_01.js"); + $('#load').hide(); + $('#game').show(); + $('#ui').show(); + $('#output').show(); + }); }); diff --git a/src/jsds.js b/src/jsds.js index a667db8..6d0245e 100644 --- a/src/jsds.js +++ b/src/jsds.js @@ -70,6 +70,10 @@ // Helper-Funcs + var clearoutput = function() { + $('#output').empty(); + }; + var clearui = function() { $('#output').empty(); $('#ui').empty(); @@ -129,7 +133,7 @@ }, attack: function(enem) { - clearui(); + clearoutput(); var output=$('#output'); output.html(this.info.cname+" greift "+enem.info.cname+" an!
"); var attack_val = dice(this.battle[this.att]); @@ -189,7 +193,7 @@ }, sel_att: function() { - var outstr=""; + var outstr="

"; outstr += "Angriffstyp?
"; outstr += ""; outstr += ""; outstr += ""; + outstr += "

"; $('#ui').html(outstr); $('#att').bind("change", function() {cur_sel.att=this.value;}); @@ -231,12 +236,13 @@ this.battle.shoot_chant = this.battle.chant + this.extern.chant - this.extern.armor; }, printoutput: function() { - outstr = ""; + outstr = "

"; outstr += this.info.cname + " (gespielt von "+this.info.pname +")
"; outstr += "Greift derzeit durch " + this.att + " mit einer Stärke von " + this.battle[this.att] + " an.
"; outstr += "Verteidigungsstärke: " + this.battle.defense + "
"; outstr += "Kraftpunkte: " + this.life; + outstr += "

"; $('#output').html(outstr); } }); @@ -255,13 +261,14 @@ this.enem = true; }, printoutput: function() { - clearui(); - outstr = ""; + clearoutput(); + outstr = "

"; outstr += "Ein "+ this.info.race + "
"; outstr += "Greift derzeit durch " + this.att + " mit einer Stärke von " + this.battle[this.att] + " an.
"; outstr += "Verteidigungsstärke: " + this.battle.defense + "
"; outstr += "Kraftpunkte: " + this.life; + outstr += "

"; $('#output').html(outstr); } });