artifacts.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. /**
  3. * Artifacts view.
  4. *
  5. * Contains the view layout and ome code to present the data.
  6. *
  7. * @category View
  8. * @property_read Artifacts_Page $page The page model.
  9. */
  10. ?>
  11. <!DOCTYPE html>
  12. <html lang='en'>
  13. <head>
  14. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  15. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  16. <title><?=$page->title?></title>
  17. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  18. <!-- CSS files -->
  19. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  20. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>artifacts.css'/>
  21. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>filters.css'/>
  22. <!-- Meta tags -->
  23. <link rel='canonical' href='<?=$page->canonical?>'/>
  24. <link rel='author' href='<?=$page->author?>'/>
  25. <link rel='publisher' href='<?=$page->author?>'/>
  26. <meta name='description' content='<?=$page->description?>'/>
  27. <meta property='og:title' content='<?=$page->title?>'/>
  28. <meta property='og:url' content='<?=$page->canonical?>'/>
  29. <meta property='og:description' content='<?=$page->description?>'/>
  30. <meta property='og:image' content='<?=$page->icon?>'/>
  31. <meta property='og:site_name' content='<?=$page->name?>'/>
  32. <meta property='og:type' content='website'/>
  33. <meta property='og:locale' content='en'/>
  34. <meta name='twitter:card' content='summary'/>
  35. <meta name='twitter:title' content='<?=$page->title?>'/>
  36. <meta name='twitter:description' content='<?=$page->description?>'/>
  37. <meta name='twitter:image' content='<?=$page->icon?>'/>
  38. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  39. <meta name='robots' content='index follow'/>
  40. <script>
  41. /**
  42. * Shows or hiddes the filters panel.
  43. */
  44. function toggleFilters(){
  45. var content = document.getElementById('filters_content');
  46. var slid = document.getElementById('filters_slid');
  47. if (content.style.maxHeight != '55em'){
  48. content.style.maxHeight = '55em';
  49. slid.style.transform = 'rotate(90deg)';
  50. }
  51. else{
  52. content.style.maxHeight = '0px';
  53. slid.style.transform = 'rotate(0deg)';
  54. }
  55. };
  56. </script>
  57. </head>
  58. <body>
  59. <?php
  60. include __DIR__ . "/inc/header.php";
  61. ?>
  62. <section class='filters'>
  63. <h2 id='filters_title' onClick='toggleFilters();'>
  64. <img id='filters_slid' id='filters_slid' alt=' ' src='<?=URL::IMG["ICON"]?>slid.png'/>
  65. Artifact filters
  66. </h2>
  67. <article id='filters_content'>
  68. <?php
  69. $filters = $page->filters;
  70. $custom_filters = $page->custom_filters;
  71. include __DIR__ . "/inc/filter_artifacts.php";
  72. ?>
  73. </article>
  74. </section> <!-- #filters -->
  75. <?php
  76. $prev_group = "";
  77. $group = "";
  78. $group_title = "";
  79. $group_image = "";
  80. foreach ($page->artifacts as $artifact){
  81. $group = $artifact->type . "-" . $artifact->element . "-" . $artifact->archetype;
  82. if ($prev_group != $group){
  83. switch ($artifact->type){
  84. case ARTIFACT_TYPE::ELEMENT:
  85. switch ($artifact->element){
  86. case ELEMENT_ID::WATER:
  87. $group_title = "Water";
  88. $group_image = URL::IMG["ARTIFACT"] . "element_water.png";
  89. break;
  90. case ELEMENT_ID::FIRE:
  91. $group_title = "Fire";
  92. $group_image = URL::IMG["ARTIFACT"] . "element_fire.png";
  93. break;
  94. case ELEMENT_ID::WIND:
  95. $group_title = "Wind";
  96. $group_image = URL::IMG["ARTIFACT"] . "element_wind.png";
  97. break;
  98. case ELEMENT_ID::LIGHT:
  99. $group_title = "Light";
  100. $group_image = URL::IMG["ARTIFACT"] . "element_light.png";
  101. break;
  102. case ELEMENT_ID::DARK:
  103. $group_title = "Dark";
  104. $group_image = URL::IMG["ARTIFACT"] . "element_dark.png";
  105. break;
  106. }
  107. break;
  108. case ARTIFACT_TYPE::ARCHETYPE:
  109. switch ($artifact->archetype){
  110. case ARCHETYPE_ID::ATTACK:
  111. $group_title = "Attack";
  112. $group_image = URL::IMG["ARTIFACT"] . "type_attack.png";
  113. break;
  114. case ARCHETYPE_ID::DEFENSE:
  115. $group_title = "Defense";
  116. $group_image = URL::IMG["ARTIFACT"] . "type_defense.png";
  117. break;
  118. case ARCHETYPE_ID::SUPPORT:
  119. $group_title = "Support";
  120. $group_image = URL::IMG["ARTIFACT"] . "type_support.png";
  121. break;
  122. case ARCHETYPE_ID::HP:
  123. $group_title = "HP";
  124. $group_image = URL::IMG["ARTIFACT"] . "type_hp.png";
  125. break;
  126. }
  127. }
  128. if ($prev_group == ""){
  129. ?>
  130. <section class='list'>
  131. <?php
  132. }
  133. else{
  134. ?>
  135. </article>
  136. </section>
  137. <section class='list'>
  138. <?php
  139. }
  140. $prev_group = $group;
  141. ?>
  142. <h2>
  143. <img class='group_image_<?=$group?>' alt='<?=$group_title?>' src='<?=$group_image?>'>
  144. <span>
  145. <?=$group_title?>
  146. </span>
  147. </h2>
  148. <article>
  149. <?php
  150. }
  151. ?>
  152. <?=HTML::artifact_table($artifact, $artifact->assigned_to)?>
  153. <?php
  154. }
  155. ?>
  156. </article> <!-- Close last group -->
  157. </section>
  158. <?php
  159. include __DIR__ . "/inc/footer.php";
  160. ?>
  161. </body>
  162. </html>