catalog.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 id='filters'>
  37. <form action='/catalog/' method='get'>
  38. <div class='filter'>
  39. <span>Element:</span>
  40. <br/>
  41. <?php
  42. $fire_selected = "";
  43. $water_selected = "";
  44. $wind_selected = "";
  45. $light_selected = "";
  46. $dark_selected = "";
  47. switch (strtoupper($page->filters["element"])){
  48. case "FIRE":
  49. $fire_selected = "selected='selected'";
  50. break;
  51. case "WATER":
  52. $water_selected = "selected='selected'";
  53. break;
  54. case "WIND":
  55. $wind_selected = "selected='selected'";
  56. break;
  57. case "LIGHT":
  58. $light_selected = "selected='selected'";
  59. break;
  60. case "DARK":
  61. $dark_selected = "selected='selected'";
  62. break;
  63. }
  64. ?>
  65. <select name='element' id='filter_type'>
  66. <option value=''>All</option>
  67. <option value='Fire' <?=$fire_selected?>>Fire</option>
  68. <option value='Water' <?=$water_selected?>>Water</option>
  69. <option value='Wind' <?=$wind_selected?>>Wind</option>
  70. <option value='Light' <?=$light_selected?>>Light</option>
  71. <option value='Dark' <?=$dark_selected?>>Dark</option>
  72. </select>
  73. <div class='filter'>
  74. <span>Name:</span>
  75. <br/>
  76. <input type='text' name='name' id='filter_name' value='<?=$page->filters["name"]?>'/>
  77. </div>
  78. <div class='filter' id='filter_stars'>
  79. <span>Min. stars:</span>
  80. <input type='number' name='min_stars' id='filter_stars_min' min='1' max='5' value='<?=$page->filters["min_stars"]?>'/>
  81. <br/>
  82. <span>Max. stars:</span>
  83. <input type='number' name='max_stars' id='filter_stars_max' min='1' max='5' value='<?=$page->filters["max_stars"]?>'/>
  84. </div>
  85. <div id='filter_apply'>
  86. <input type='submit' value='Apply'/>
  87. </div>
  88. </form>
  89. </section> <!-- #filters -->
  90. <section id='catalog'>
  91. <article>
  92. <?php
  93. foreach ($page->monsters as $mon){
  94. ?>
  95. <?php
  96. if (strlen($mon->awakens_to) == 0){
  97. // No to, no from, silver monster.
  98. $star_src = $path["img"]["layout"] . "icon/star_silver.png";
  99. $mon_title = $mon->element . " " . $mon->name;
  100. }
  101. else{
  102. // Awakeable.
  103. $star_src = $path["img"]["layout"] . "icon/star.png";
  104. $mon_title = $mon->element . " " . $mon->name;
  105. }
  106. ?>
  107. <div class='monster'>
  108. <a href='/monster_info/<?=$mon->id?>'>
  109. <span class='stars'>
  110. <?php
  111. for ($i = 0; $i < $mon->natural_stars; $i ++){
  112. ?>
  113. <img class='star' src='<?=$star_src?>'/>
  114. <?php
  115. }
  116. ?>
  117. </span>
  118. <img title='<?=$mon_title?>' class='monster border_<?=$mon->element?>' src='<?=$mon->get_image()?>'/>
  119. </a>
  120. </div>
  121. <?php
  122. }
  123. ?>
  124. </article>
  125. </section> <!-- #catalog -->
  126. <?php
  127. include __DIR__ . "/inc/footer.php";
  128. ?>
  129. </body>
  130. </html>