Skip to content
Snippets Groups Projects
Commit 5564f943 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

test

parent 12d53871
No related branches found
No related tags found
No related merge requests found
......@@ -39,22 +39,25 @@ public function getType(){
public function getId(){
return $this->id;
}
public function getTexture(){
$texture = array();
public function getRepresentation(){
$return["texture"] = array();
if(file_exists("data/images/textures/block/".$this->id.".png")){
$texture[0] = "data/images/textures/block/".$this->id.".png";
$return["type"] = "block";
$return["texture"][0] = "data/images/textures/block/".$this->id.".png";
if(file_exists("data/images/textures/block/".$this->id."_top.png")){
$texture[1] = "data/images/textures/block/".$this->id."_top.png";
$return["texture"][1] = "data/images/textures/block/".$this->id."_top.png";
}
}elseif(file_exists("data/images/textures/item/".$this->id.".png")){
$texture[0] = "data/images/textures/item/".$this->id.".png";
$return["type"] = "item";
$return["texture"][0] = "data/images/textures/item/".$this->id.".png";
}else{
$texture[0] = "data/images/textures/missing.png";
$return["type"] = "unknown";
$return["texture"][0] = "data/images/textures/missing.png";
}
if(!isset($texture[1])){
$texture[1] = $texture[0];
if(!isset($return["texture"][1])){
$return["texture"][1] = $return["texture"][0];
}
return $texture;
return $return["texture"];
}
}
\ No newline at end of file
......@@ -86,11 +86,11 @@ .object {
transform-origin: bottom center;
}
.block > div:nth-child(5) {
-webkit-transform: rotateY(272deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
-moz-transform: rotateY(272deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
-ms-transform: rotateY(272deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
-o-transform: rotateY(272deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
transform: rotateY(272deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
-webkit-transform: rotateY(270deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
-moz-transform: rotateY(270deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
-ms-transform: rotateY(270deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
-o-transform: rotateY(270deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
transform: rotateY(270deg) rotateZ(90deg) rotateX(0) translate3d(-30px, 30px, -1px);
-webkit-transform-origin: center left;
-moz-transform-origin: center left;
-ms-transform-origin: center left;
......
......@@ -59,19 +59,20 @@
<?php
$shops = Shop::getShops();
foreach($shops as $shop){
$texture = $shop['item']->getTexture();
$representation = $shop['item']->getRepresentation();
if($representation["type"] == "item"){
echo ('<div class="col-sm">
<div class="card" style="width: 18rem;">
<div class="card-body">
<div class="card-top">
<div class="object">
<div class="block grass">
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$texture[1].'\');"><!--top --></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$texture[1].'\');"><!--bottom--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$texture[0].'\');"><!--left--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$texture[0].'\');"><!--right--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$texture[0].'\');"><!--back--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$texture[0].'\');"><!--front--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$representation["texture"][1].'\');"><!--top --></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$representation["texture"][1].'\');"><!--bottom--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$representation["texture"][0].'\');"><!--left--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$representation["texture"][0].'\');"><!--right--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$representation["texture"][0].'\');"><!--back--></div>
<div style="background: url(\''.getWebsiteSetting("websiteUrl").$representation["texture"][0].'\');"><!--front--></div>
</div>
</div>
</div>
......@@ -84,8 +85,27 @@
</div>
</div>
</div>');
}else{
echo ('<div class="col-sm">
<div class="card" style="width: 18rem;">
<div class="card-body">
<div class="card-top">
<img src="'.getWebsiteSetting("websiteUrl").$representation["texture"][0].'" alt="'.$shop['item']->getLabel().'">
</div>
<h5 class="card-title">'.$shop['item']->getLabel().'</h5>
<p class="card-text">Test content</p>
<div class="mc-button normal">
<div class="title">Se téléporter</div>
</div>
</div>
</div>
</div>');
}
}
?>
<!-- exemple -->
<div class="col-sm">
<div class="card" style="width: 18rem;">
<div class="card-body">
......@@ -110,6 +130,26 @@
</div>
</div>
</div>
<!-- exemple -->
<!-- exemple -->
<div class="col-sm">
<div class="card" style="width: 18rem;">
<div class="card-body">
<div class="card-top">
<img src="<?=getWebsiteSetting("websiteUrl")?>data/images/textures/item/copper_ingot.png" alt="Item">
</div>
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<div class="mc-button normal">
<div class="title">Se téléporter</div>
</div>
</div>
</div>
</div>
<!-- exemple -->
</div>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment