catalog.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <!DOCTYPE html>
  2. <html lang='en'>
  3. <head>
  4. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  5. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  6. <title><?=$page->title?></title>
  7. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  8. <!-- CSS files -->
  9. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
  10. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>catalog.css'/>
  11. <!-- Script files -->
  12. <script src="<?=$path["js"]?>ui.js"></script>
  13. <!-- Meta tags -->
  14. <link rel='canonical' href='<?=$page->canonical?>'/>
  15. <link rel='author' href='<?=$page->author?>'/>
  16. <link rel='publisher' href='<?=$page->author?>'/>
  17. <meta name='description' content='<?=$page->description?>'/>
  18. <meta property='og:title' content='<?=$page->title?>'/>
  19. <meta property='og:url' content='<?=$page->canonical?>'/>
  20. <meta property='og:description' content='<?=$page->description?>'/>
  21. <meta property='og:image' content='<?=$page->icon?>'/>
  22. <meta property='og:site_name' content='<?=$page->name?>'/>
  23. <meta property='og:type' content='website'/>
  24. <meta property='og:locale' content='en'/>
  25. <meta name='twitter:card' content='summary'/>
  26. <meta name='twitter:title' content='<?=$page->title?>'/>
  27. <meta name='twitter:description' content='<?=$page->description?>'/>
  28. <meta name='twitter:image' content='<?=$page->icon?>'/>
  29. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  30. <meta name='robots' content='index follow'/>
  31. </head>
  32. <body>
  33. <?php
  34. include __DIR__ . "/inc/header.php";
  35. ?>
  36. <section class='filters'>
  37. <h2>
  38. Catalog filters
  39. </h2>
  40. <form action='/catalog/' method='get'>
  41. <table>
  42. <tr>
  43. <td class='filter'>
  44. <span>Element:</span>
  45. <?php
  46. $fire_selected = "";
  47. $water_selected = "";
  48. $wind_selected = "";
  49. $light_selected = "";
  50. $dark_selected = "";
  51. switch (strtoupper($page->filters["element"])){
  52. case "FIRE":
  53. $fire_selected = "selected='selected'";
  54. break;
  55. case "WATER":
  56. $water_selected = "selected='selected'";
  57. break;
  58. case "WIND":
  59. $wind_selected = "selected='selected'";
  60. break;
  61. case "LIGHT":
  62. $light_selected = "selected='selected'";
  63. break;
  64. case "DARK":
  65. $dark_selected = "selected='selected'";
  66. break;
  67. }
  68. ?>
  69. <select name='element' id='filter_type'>
  70. <option value=''>All</option>
  71. <option value='Fire' <?=$fire_selected?>>Fire</option>
  72. <option value='Water' <?=$water_selected?>>Water</option>
  73. <option value='Wind' <?=$wind_selected?>>Wind</option>
  74. <option value='Light' <?=$light_selected?>>Light</option>
  75. <option value='Dark' <?=$dark_selected?>>Dark</option>
  76. </select>
  77. </td>
  78. <td class='filter'>
  79. <span>Name:</span>
  80. <input type='text' name='name' id='filter_name' value='<?=$page->filters["name"]?>'/>
  81. </td>
  82. <td class='filter' id='filter_stars'>
  83. <span>Min. stars:</span>
  84. <input type='number' name='min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["min_stars"]?>'/>
  85. <br/>
  86. <span>Max. stars:</span>
  87. <input type='number' name='max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["max_stars"]?>'/>
  88. </td>
  89. </tr>
  90. </table>
  91. <div id='filter_apply'>
  92. <input type='submit' value='Apply'/>
  93. </div>
  94. </form>
  95. </section> <!-- #filters -->
  96. <section class='list'>
  97. <h2>
  98. Catalog
  99. </h2>
  100. <article>
  101. <?php
  102. $element = "";
  103. foreach ($page->monsters as $mon){
  104. if ($mon->element != $element){
  105. if ($element != ""){
  106. ?>
  107. </article>
  108. <article>
  109. <?php
  110. }
  111. $element = $mon->element;
  112. }
  113. if ($mon->awakens_from == "" && $mon->awakens_to == ""){
  114. // No to, no from, silver monster.
  115. $star_class ="star_silver";
  116. $mon_title = $mon->element . " " . $mon->name;
  117. }
  118. elseif ($mon->awakens_from =! "" && $mon->awakens_to == ""){
  119. // Already awakened
  120. if ($mon->base_stars - $mon->natural_stars == 1){
  121. // Normal awaken.
  122. $star_class ="star_purple";
  123. }
  124. else{
  125. // Second awaken.
  126. $star_class ="star_red";
  127. }
  128. $mon_title = $mon->name;
  129. }
  130. elseif ($mon->awakens_to =! ""){
  131. // Awakeable.
  132. $star_class ="star_gold";
  133. $mon_title = $mon->element . " " . $mon->name;
  134. }
  135. ?>
  136. <div class='monster'>
  137. <a href='/catalog/<?=$mon->id?>'>
  138. <div class='monster_panel'>
  139. <span class='stars'>
  140. <?php
  141. for ($i = 0; $i < $mon->natural_stars; $i ++){
  142. ?>
  143. <img class='star <?=$star_class?>' src='<?=$path["img"]["layout"] . "icon/star.png"?>'/>
  144. <?php
  145. }
  146. ?>
  147. </span>
  148. <img title='<?=$mon_title?>' class='monster border_<?=$mon->element?>' src='<?=$mon->get_image()?>'/>
  149. </div>
  150. </a>
  151. </div>
  152. <?php
  153. }
  154. ?>
  155. </article>
  156. </section> <!-- #catalog -->
  157. <?php
  158. include __DIR__ . "/inc/footer.php";
  159. ?>
  160. </body>
  161. </html>