Guest User

Untitled

a guest
Jun 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 KB | None | 0 0
  1. <?php include('includes/header.php'); ?>
  2. <?php include('includes/menu.php'); ?>
  3. <?php include('includes/functions.php'); ?>
  4. <?php
  5. // Initialization information
  6. $dir = 'images/portfolio';
  7. $DS = '/';
  8. $head = $content = '';
  9.  
  10. //print_r(index($dir));
  11. $categories = index($dir);
  12.  
  13. foreach ($categories as $category=>$projects) {
  14.  
  15. // generate categories
  16. $name = str_replace('_',' ',$category);
  17.  
  18. if ($head != '')
  19. $head .= ' | ';
  20.  
  21. $head .= "<a href='#$category'>$name</a>\n";
  22.  
  23. $content .= "<li class='category' id='$category'>
  24. <ul class='projects'>\n";
  25.  
  26. $projectSwitch = '';
  27.  
  28. foreach ($projects as $project=>$images) {
  29.  
  30. $name = str_replace('_',' ',$project);
  31.  
  32. // generate projects
  33. $content .= "<li class='project' id='$category$project'>
  34. <div class='display'>\n";
  35.  
  36. $projectSwitch .= "<li><a href='#$category$project'><img src='images/portfolio/$category/$project/thumb.jpg' alt='$name' /></a></li>\n";
  37.  
  38. $i = 0;
  39. $jumper = '';
  40.  
  41. foreach ($images as $image=>$name) {
  42. $i++;
  43. // generate images
  44. $content .= "<img id='$category$project$i' src='images/portfolio/$category/$project/$image' alt='$name' />\n";
  45. $jumper .= "<li><a href='#$category$project$i' title='$name'>$i</a></li>\n";
  46.  
  47.  
  48. }
  49.  
  50. $content .= "</div>
  51. <div class='pictures'>
  52. <span id='pictureName'></span>
  53. <ul class='pictureJump'>
  54. $jumper
  55. </ul>
  56. </div>
  57. </li>\n";
  58.  
  59. }
  60.  
  61. $content .= "</ul>
  62. <ul class='projectSwitch'>
  63. $projectSwitch
  64. </ul>
  65. </li>\n";
  66.  
  67. }
  68.  
  69. ?>
  70. <script type="text/javascript">
  71. $(document).ready(function () {
  72. $('.category:first').siblings().hide();
  73. $('.category').each(function() {
  74. $(' .project:first',this).siblings().hide();
  75. $(' .project', this).each(function() {
  76. $(' .display img:first', this).siblings().hide();
  77. });
  78. });
  79. //$('.project:first, .display img:first').siblings().hide();
  80. $('#content a, h2 a').click(function () {
  81. $($(this).attr('href')).fadeIn(300).siblings().hide();
  82. return false;
  83. });
  84. $('.pictureJump a').click(function () {
  85. jthis = $(this);
  86. $(this).parent('.pictures').find('.pictureName').html(jthis.attr('title'));
  87. });
  88. });
  89. </script>
  90. <style type="text/css">
  91. * {margin:0;padding:0;}
  92. #content {
  93. overflow: hidden;
  94. height: 600px;
  95. width:580px;
  96. margin-top:10px;
  97. }
  98. .category {
  99. }
  100. .projects {
  101. overflow: hidden;
  102. height:550px;
  103. }
  104. .projectSwitch {
  105. height:150px;
  106. }
  107. .projectSwitch li {
  108. display: inline;
  109. }
  110. .projectSwitch a img {
  111. height:50px;
  112. width:50px;
  113. }
  114. .project {
  115. width:100%;
  116. }
  117. .display {
  118. height:500px;
  119. overflow:auto;
  120. text-align:center;
  121. }
  122. .display img {
  123. }
  124. .pictures {
  125. height:30px;
  126. }
  127. .pictureName {
  128. background: red;
  129. }
  130. .pictureJump {
  131. overflow:auto;
  132. height:34px;
  133. padding:0;margin:0;
  134. }
  135. .pictureJump li {
  136. list-style:none;
  137. padding:0;margin:0;
  138. float:right;
  139. }
  140. .pictureJump a {
  141. font-size:110%;
  142. padding:5px;
  143. display:block;
  144. float:right;
  145. }
  146.  
  147. </style>
  148. <h1>PORTFOLIO</h1>
  149. <h2><?php echo $head ?></h2>
  150. <ul id="content">
  151. <?php echo $content; ?>
  152. <!--<li class="category" id="cat1">
  153. <ul class="projects">
  154. <li id="cat1proj1" class="project">
  155. <div class="display">
  156. <img id="cat1proj1pic1" src="" alt="" />
  157. </div>
  158. <div class="pictures">
  159. <span class="pictureName">Test</span>
  160. <ul class="pictureJump">
  161. <li><a href="#cat1proj1pic1">picture 1</a></li>
  162. </ul>
  163. </div>
  164. </li></ul>
  165. <ul class="projectswitch">
  166. <li><a href="#cat1proj1"><img src="" alt="project" /></a></li>
  167. </ul>
  168. </li>-->
  169. </ul>
  170. <?php include('includes/footer.php'); ?>
Add Comment
Please, Sign In to add comment