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 = ''; + $('#hidden').html(hidden); + image = document.getElementById('imagetogetsize'); + //$('#imagetogetsize').load(function(){console.log('cia')}); + $('#imagetogetsize').on('load',function(){ + var width = image.naturalWidth; + var height = image.naturalHeight; + + var box = $('#container2'); + var boxwidth = box.width(); + var boxheight = box.height(); + console.log(width,height,boxwidth,boxheight); + if (width < boxwidth && height < boxheight){ + box.css('background-size','auto'); + } else { + box.css('background-size','contain'); + } + box.css('background-image','url('+ path +imgURL+')'); + }); + + return number; + } + changeImg(); $('#container2').on('click',function(){ - $(this).css('background-image','url('+img[Math.floor(Math.random()*img.length)]+')'); + //$(this).css('background-image','url('+img[Math.floor(Math.random()*img.length)]+')'); + var listNum = changeImg(); + $('a.list').css('text-decoration','none'); + $('a.list').eq(listNum).css('text-decoration','underline'); + }); //Make image List @@ -180,22 +228,29 @@ function pad(n) { } for (var num in img){ - var x = ''+ 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) { }); - @@ -260,7 +321,24 @@ function pad(n) { -
+
+ + + diff --git a/indexbg.php b/indexbg.php new file mode 100644 index 0000000..fcbc9d8 --- /dev/null +++ b/indexbg.php @@ -0,0 +1,540 @@ + + + + + +PierPaolo Moro + + + + + +
+
+
+ +
+
+
+ + + + +
+
+ + + + + + + + diff --git a/indexsub.php b/indexsub.php new file mode 100644 index 0000000..ab949d4 --- /dev/null +++ b/indexsub.php @@ -0,0 +1,359 @@ + + + + + +PierPaolo Moro + + + + + + + + + + +
+
+ + + + diff --git a/raptune-test.php b/raptune-test.php new file mode 100644 index 0000000..5cc3b59 --- /dev/null +++ b/raptune-test.php @@ -0,0 +1,45 @@ +call('Login', $rap_credentials); +$rap_auth_ticket = $soap_Client->getHeaders(); + +//get complete price sheet, and save as a file (call this both for Round and Pear): +$paramsB["shape"] = "Round"; +$soap_Client->setHeaders($rap_auth_ticket); +$result = $soap_Client->call('GetPriceSheet', $paramsB); + +$file=fopen("round_prices.csv","w+") or exit("Unable to open file!"); + + + +$curLine = ""; +$curLine .= $result['GetPriceSheetResult']['!Date']; +$curLine .= "," . $result['GetPriceSheetResult']['!Shape']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['LowSize']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['LowSize']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['Color']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['Clarity']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['Price']; + +fwrite($file, $curLine.PHP_EOL); + + +fclose($file); + +?> \ No newline at end of file diff --git a/raptune.php b/raptune.php new file mode 100644 index 0000000..744de98 --- /dev/null +++ b/raptune.php @@ -0,0 +1,119 @@ +call('Login', $rap_credentials); +$rap_auth_ticket = $soap_Client->getHeaders(); + +//get complete price sheet, and save as a file (call this both for Round and Pear): +$paramsB["shape"] = "Round"; +$soap_Client->setHeaders($rap_auth_ticket); +$result = $soap_Client->call('GetPriceSheet', $paramsB); + +$file=fopen("c:\\temp\\round_prices.csv","w+") or exit("Unable to open file!"); + +for ($i=0; $i { + + +$curLine .= $result['GetPriceSheetResult']['!Date']; +$curLine .= "," . $result['GetPriceSheetResult']['!Shape']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['LowSize']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['LowSize']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['Color']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['Clarity']; +$curLine .= "," . $result['GetPriceSheetResult']['Prices']['diffgram']['NewDataSet']['Table'][$i]['Price']; + +fwrite($file, $curLine.PHP_EOL); +} + +fclose($file); + +?> + + +
+ + + +
+
+
+ + + + + +
> + + + +

+ + + + +
+ '' ) ); + ?> +
+ + + +
+ + + + + +
+ + +
+
+ + + +
+ + \ No newline at end of file diff --git a/round_prices.csv b/round_prices.csv new file mode 100644 index 0000000..e1c4a9f --- /dev/null +++ b/round_prices.csv @@ -0,0 +1 @@ +2018-01-19T00:00:00,Round,,,,,