catalog.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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' id='filter_stars'>
  79. <span>Stars:</span>
  80. <input type='number' name='min_stars' id='filter_stars_min' min='1' max='5' value='<?=$page->filters["min_stars"]?>'/>
  81. -
  82. <input type='number' name='max_stars' id='filter_stars_max' min='1' max='5' value='<?=$page->filters["max_stars"]?>'/>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td class='filter' colspan='2'>
  87. <span>Name:</span>
  88. <input type='text' name='name' id='filter_name' value='<?=$page->filters["name"]?>'/>
  89. </td>
  90. </tr>
  91. </table>
  92. <div id='filter_apply'>
  93. <input type='submit' value='Apply'/>
  94. </div>
  95. </form>
  96. </section> <!-- #filters -->
  97. <section class='list'>
  98. <h2>
  99. Catalog
  100. </h2>
  101. <article>
  102. <?php
  103. $element = "";
  104. foreach ($page->monsters as $mon){
  105. if ($mon->element != $element){
  106. if ($element != ""){
  107. ?>
  108. </article>
  109. <article>
  110. <?php
  111. }
  112. $element = $mon->element;
  113. }
  114. if ($mon->awakens_from == "" && $mon->awakens_to == ""){
  115. // No to, no from, silver monster.
  116. $star_class ="star_silver";
  117. $mon_title = $mon->element . " " . $mon->name;
  118. }
  119. elseif ($mon->awakens_from =! "" && $mon->awakens_to == ""){
  120. // Already awakened
  121. if ($mon->base_stars - $mon->natural_stars == 1){
  122. // Normal awaken.
  123. $star_class ="star_purple";
  124. }
  125. else{
  126. // Second awaken.
  127. $star_class ="star_red";
  128. }
  129. $mon_title = $mon->name;
  130. }
  131. elseif ($mon->awakens_to =! ""){
  132. // Awakeable.
  133. $star_class ="star_gold";
  134. $mon_title = $mon->element . " " . $mon->name;
  135. }
  136. ?>
  137. <div class='monster'>
  138. <a href='/catalog/<?=$mon->id?>'>
  139. <div class='monster_panel'>
  140. <span class='stars'>
  141. <?php
  142. for ($i = 0; $i < $mon->natural_stars; $i ++){
  143. ?>
  144. <img class='star <?=$star_class?>' src='<?=$path["img"]["layout"] . "icon/star.png"?>'/>
  145. <?php
  146. }
  147. ?>
  148. </span>
  149. <img title='<?=$mon_title?>' class='monster border_<?=$mon->element?>' src='<?=$mon->get_image()?>'/>
  150. </div>
  151. </a>
  152. </div>
  153. <?php
  154. }
  155. ?>
  156. </article>
  157. </section> <!-- #catalog -->
  158. <?php
  159. include __DIR__ . "/inc/footer.php";
  160. ?>
  161. </body>
  162. </html>