Permalink
Browse files

Generate Lessons and Jobs by JS and Blood Type influence

  • Loading branch information...
myubi committed Aug 9, 2016
1 parent 16b577d commit aa72ce70ea1ab96798a6fb936bcccfd295a7fc17
Showing with 508 additions and 497 deletions.
  1. +4 −2 assets/css/style.css
  2. +63 −1 assets/js/initialize.js
  3. +417 −399 assets/js/main.js
  4. +24 −95 index.html
View
@@ -49,6 +49,7 @@ body {
display: inline-block;
background-color: #a85050;
background-image: url('../img/background-pattern.png');
text-align: left;
}
.button:before {
@@ -65,7 +66,9 @@ body {
.button span {
display: inline-block;
vertical-align: middle;
margin-left: 32px;
margin-left: 40px;
font-size: 14px;
line-height: 0;
}
.hidden {
@@ -97,7 +100,6 @@ text-align: center;
meter {
width: 150px;
height: 15px;
-webkit-appearance: none; /* Reset appearance */
border: 1px solid #ccc;
border-radius: 3px;
}
View
@@ -23,14 +23,36 @@ var attributes = {
"temperament": 0
};
var jobs = {
"housework": 0,
"babysitter": 4,
"farm": 10,
"church": 1,
"inn": 8,
"restaurant": 8
};
var lessons = {
"dance": 50,
"fencing": 40,
"fighting": 30,
"magic": 60,
"painting": 40,
"poetry": 40,
"protocol": 40,
"science": 30,
"strategy": 50,
"theology": 40
};
var attributesDiv = document.getElementById('attributes');
for (var attribute in attributes){
var attributeDiv = document.createElement('div');
attributesDiv.appendChild(attributeDiv);
var spanTitle = document.createElement('span');
spanTitle.className = 'attrName';
spanTitle.innerHTML = attribute;
spanTitle.innerHTML = attribute.charAt(0).toUpperCase() + attribute.slice(1);;
attributeDiv.appendChild(spanTitle);
var spanNumber = document.createElement('span');
spanNumber.className = 'attrValue';
@@ -44,3 +66,43 @@ for (var attribute in attributes){
meter.max = 1000;
attributeDiv.appendChild(meter);
}
var jobsDiv = document.getElementById('jobs');
for (var job in jobs){
var jobDiv = document.createElement('div');
jobDiv.id = job;
jobDiv.className = "button";
jobDiv.setAttribute("onclick", "jobClick('" + job + "')");
jobsDiv.appendChild(jobDiv);
var jobIcon = document.createElement('img');
jobIcon.src = "assets/img/jobs/" + job + ".png";
jobDiv.appendChild(jobIcon);
var jobTitle = document.createElement('span');
jobTitle.innerHTML = job.charAt(0).toUpperCase() + job.slice(1);
jobDiv.appendChild(jobTitle);
var jobPrice = document.createElement('span');
jobPrice.id = job + "Price";
jobPrice.innerHTML = jobs[job] + " G";
jobDiv.appendChild(jobPrice);
}
var lessonsDiv = document.getElementById('lessons');
for (var lesson in lessons){
var lessonDiv = document.createElement('div');
lessonDiv.id = lesson;
lessonDiv.className = "button";
lessonDiv.setAttribute("onclick", "lessonClick('" + lesson + "')");
lessonsDiv.appendChild(lessonDiv);
var lessonIcon = document.createElement('img');
lessonIcon.src = "assets/img/lessons/" + lesson + ".png";
lessonDiv.appendChild(lessonIcon);
var lessonTitle = document.createElement('span');
lessonTitle.innerHTML = lesson.charAt(0).toUpperCase() + lesson.slice(1);
lessonDiv.appendChild(lessonTitle);
var lessonPrice = document.createElement('span');
lessonPrice.id = lesson + "Cost";
lessonPrice.innerHTML = lessons[lesson] + " G";
lessonDiv.appendChild(lessonPrice);
}
Oops, something went wrong.

0 comments on commit aa72ce7

Please sign in to comment.