diff --git a/index.php b/index.php
index ebe3f3c..0cc9c77 100644
--- a/index.php
+++ b/index.php
@@ -32,7 +32,17 @@ function getRandomFromArray($ar) {
return $ar[$num];
}
+//CATEGORIE
+$path2 = 'images/' . $name[0];
+$results = scandir($path2);
+foreach ($results as $result) {
+ if ($result === '.' or $result === '..') continue;
+
+ if (is_dir($path2 . '/' . $result)) {
+ //code to use if directory
+ }
+}
// Obtain list of images from directory
$imgList = getImagesFromDir($root . $path);
@@ -123,7 +133,7 @@ function getRandomFromArray($ar) {
}
#container2{
background-repeat:no-repeat;
- background-size:contain;
+ /*background-size:contain;*/
position: relative;
max-width: 70%;
max-height: 70%;
@@ -147,6 +157,7 @@ function getRandomFromArray($ar) {
display: flex;
align-items: center;
justify-content: center;
+ text-align: center;
}
body{
margin: 0px;
@@ -157,6 +168,9 @@ function getRandomFromArray($ar) {
#menu span:hover, a.list:hover {
opacity: 0.5;
}
+ #menu span.active{
+ text-decoration: underline;
+ }
@media screen and (max-width: 2560px){
#portfolioBox{
margin-top:3px;
@@ -170,8 +184,42 @@ function getRandomFromArray($ar) {
var img = JSON.parse('');
//On click change img
+
+ function changeImg(number){
+ if (!number){var number = Math.floor(Math.random()*img.length);
+ }
+ var imgURL = img[number];
+ var path = "";
+ //var imgURL = img[Math.floor(Math.random()*img.length)];
+ var hidden = ''+ pad(parseInt(num)+1) +'
'
+ var x = ''+ pad(parseInt(num)+1) +'
'
//$(x).append('#categories');
$('#portfolioBox').append(x);
}
$('.list').on('click',function(){
- $('#container2').css('background-image','url('+ $(this).attr('link') +')');
+ $('.list').css('text-decoration','none');
+
+ changeImg($(this).attr('number'));
+ //$('#container2').css('background-image','url('+ $(this).attr('link') +')');
+ $(this).css('text-decoration','underline');
});
//Menu
$('#portfolio').on('click',function(){
- $('#portfolioBox').show();
+ if ($(this).hasClass('active')){$('#portfolioBox').hide(); $(this).removeClass('active')}
+ else {$('#portfolioBox').show()};
$('#contactBox').hide();
$('#infoBox').hide();
$('#container2').removeClass('white');
$('#container2').addClass('click');
+ $('#menu span.active').removeClass('active');
+ $('#portfolio').addClass('active');
});
$('#info').on('click',function(){
@@ -203,7 +258,9 @@ function pad(n) {
$('#contactBox').hide();
$('#infoBox').show();
$('#container2').addClass('white');
- $('#container2').removeClass('click');
+ $('#container2').removeClass('click');
+ $('#menu span.active').removeClass('active');
+ $('#info').addClass('active');
});
$('#contact').on('click',function(){
@@ -212,6 +269,8 @@ function pad(n) {
$('#infoBox').hide();
$('#container2').addClass('white');
$('#container2').removeClass('click');
+ $('#menu span.active').removeClass('active');
+ $('#contact').addClass('active');
});
$('#logo').on('click',function(){
@@ -220,6 +279,9 @@ function pad(n) {
$('#infoBox').hide();
$('#container2').removeClass('white');
$('#container2').addClass('click');
+ $('#menu span.active').removeClass('active');
+ //$('#container2').css('background-image','url('+img[Math.floor(Math.random()*img.length)]+')');
+ changeImg();
});
@@ -243,7 +305,6 @@ function pad(n) {
});
-