diff --git a/httpdocs/theme/react/app-opendesktop-home/app.js b/httpdocs/theme/react/app-opendesktop-home/app.js
index e41f86558..673a1278d 100644
--- a/httpdocs/theme/react/app-opendesktop-home/app.js
+++ b/httpdocs/theme/react/app-opendesktop-home/app.js
@@ -1,246 +1,247 @@
class App extends React.Component {
constructor(props){
super(props);
this.state = {
loading:true
};
this.initHomePage = this.initHomePage.bind(this);
this.updateDimensions = this.updateDimensions.bind(this);
this.convertDataObject = this.convertDataObject.bind(this);
}
componentWillMount() {
this.updateDimensions();
}
componentWillUnmount(){
window.removeEventListener("resize", this.updateDimensions);
window.removeEventListener("orientationchange",this.updateDimensions);
}
componentDidMount() {
this.initHomePage();
}
initHomePage(){
window.addEventListener("resize", this.updateDimensions);
window.addEventListener("orientationchange",this.updateDimensions);
let env = "live";
if (location.hostname.endsWith('cc')) {
env = "test";
} else if (location.hostname.endsWith('localhost')) {
env = "test";
}
this.setState({env:env},function(){
this.convertDataObject();
});
}
updateDimensions(){
const width = window.innerWidth;
let device;
if (width >= 910){
device = "large";
} else if (width < 910 && width >= 610){
device = "mid";
} else if (width < 610){
device = "tablet";
}
this.setState({device:device});
}
convertDataObject() {
let productGroupsArray = [];
for (var i in window.data) {
if (i !== "comments"){
const productGroup = {
title:i,
products:JSON.parse(window.data[i])
}
productGroupsArray.push(productGroup);
}
}
this.setState({productGroupsArray:productGroupsArray,loading:false});
}
render(){
let productCarouselsContainer;
if (this.state.loading === false){
productCarouselsContainer = this.state.productGroupsArray.map((pgc,index) => (
));
}
return (
{productCarouselsContainer}
)
}
}
class ProductCarousel extends React.Component {
constructor(props){
super(props);
this.state = {
showRightArrow:true,
showLeftArrow:false
};
this.updateDimensions = this.updateDimensions.bind(this);
this.animateProductCarousel = this.animateProductCarousel.bind(this);
}
componentWillMount() {
window.addEventListener("resize", this.updateDimensions);
}
componentDidMount() {
this.updateDimensions();
}
updateDimensions(){
const containerWidth = $('#featured-product').find('.container').width();
+ console.log(containerWidth);
const sliderWidth = containerWidth * 3;
const itemWidth = containerWidth / 5;
this.setState({
sliderPosition:0,
containerWidth:containerWidth,
sliderWidth:sliderWidth,
itemWidth:itemWidth
});
}
animateProductCarousel(dir){
let newSliderPosition = this.state.sliderPosition;
if (dir === 'left'){
newSliderPosition = this.state.sliderPosition - this.state.containerWidth;
} else {
newSliderPosition = this.state.sliderPosition + this.state.containerWidth;
}
this.setState({sliderPosition:newSliderPosition},function(){
let showLeftArrow = true,
showRightArrow = true;
const endPoint = this.state.sliderWidth - this.state.containerWidth;
if (this.state.sliderPosition <= 0){
showLeftArrow = false;
}
if (this.state.sliderPosition >= endPoint){
showRightArrow = false;
}
this.setState({
showLeftArrow:showLeftArrow,
showRightArrow:showRightArrow
});
});
}
render(){
let carouselItemsDisplay;
if (this.props.products && this.props.products.length > 0){
carouselItemsDisplay = this.props.products.map((product,index) => (
));
}
let rightArrowDisplay, leftArrowDisplay;
if (this.state.showLeftArrow){
leftArrowDisplay = (
);
}
if (this.state.showRightArrow){
rightArrowDisplay = (
);
}
return (
{leftArrowDisplay}
{rightArrowDisplay}
)
}
}
class ProductCarouselItem extends React.Component {
constructor(props){
super(props);
this.state = {};
}
render(){
let imageBaseUrl;
if (this.props.env === 'live') {
imageBaseUrl = 'cn.opendesktop.org';
} else {
imageBaseUrl = 'cn.pling.it';
}
return (
)
}
}
ReactDOM.render(
,
document.getElementById('main-content')
);
diff --git a/httpdocs/theme/react/assets/css/homepage.css b/httpdocs/theme/react/assets/css/homepage.css
index f800d17fa..50069299d 100644
--- a/httpdocs/theme/react/assets/css/homepage.css
+++ b/httpdocs/theme/react/assets/css/homepage.css
@@ -1 +1 @@
-#opendesktop-homepage .container{width:100% !important;max-width:100% !important;padding:0}#featured-product{width:100%}#featured-product .container{width:100%}.product-carousel{padding-bottom:10px;border-bottom:1px solid #ccc}.product-carousel .product-carousel-header{height:auto;overflow:auto}.product-carousel .product-carousel-header h2{font-size:25px !important;float:left;display:block;width:auto;padding-right:20px;position:relative;width:auto !important;margin-bottom:20px}.product-carousel .product-carousel-header h2 a{color:#007aa6}.product-carousel .product-carousel-header h2 i{display:inline-block;position:absolute;top:13px;right:0}.product-carousel .product-carousel-wrapper{width:100%;height:120px;position:relative}.product-carousel .product-carousel-wrapper .product-carousel-left{position:absolute;top:0;left:0;height:100%}.product-carousel .product-carousel-wrapper .product-carousel-right{right:0;position:absolute;top:0;width:10px;height:100%}.product-carousel .product-carousel-wrapper .carousel-arrow{position:absolute;top:50%;width:50px;height:50px;margin-top:-35px;border-radius:100%;border:1px solid #ccc;background-color:white;z-index:10;margin-left:-25px;cursor:pointer;opacity:0;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.product-carousel .product-carousel-wrapper .carousel-arrow i{position:absolute;top:50%;left:50%;margin-left:-12px;margin-top:-12px}.product-carousel .product-carousel-wrapper .carousel-arrow:active{background-color:#e6e6e6}.product-carousel .product-carousel-wrapper:hover .carousel-arrow{opacity:1}.product-carousel .product-carousel-container{width:100%;overflow:hidden;position:relative;height:120px}.product-carousel .product-carousel-container .product-carousel-slider{position:absolute;top:0;left:0;height:120px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.product-carousel .product-carousel-container .product-carousel-item{float:left;height:120px}.product-carousel .product-carousel-container .product-carousel-item figure{margin:0;width:100%;float:left;margin-bottom:10px}.product-carousel .product-carousel-container .product-carousel-item figure img{height:48px;width:48px;float:left}.product-carousel .product-carousel-container .product-carousel-item .product-info span{display:block;float:left;width:100%;height:22px;line-height:22px}.product-carousel .product-carousel-container .product-carousel-item .product-info span.product-info-title{color:#007aa6;text-overflow:ellipsis;word-break:break-word;display:block;overflow:hidden;white-space:nowrap;padding-right:20px;font-size:16px}.product-carousel .product-carousel-container .product-carousel-item .product-info span.product-info-user{color:#666;font-size:15px}
\ No newline at end of file
+#opendesktop-homepage .container{width:100% !important;max-width:100% !important;padding:0;height:100px}#featured-product{width:100%}#featured-product .container{width:100%}.product-carousel{padding-bottom:10px;border-bottom:1px solid #ccc}.product-carousel .product-carousel-header{height:auto;overflow:auto}.product-carousel .product-carousel-header h2{font-size:25px !important;float:left;display:block;width:auto;padding-right:20px;position:relative;width:auto !important;margin-bottom:20px}.product-carousel .product-carousel-header h2 a{color:#007aa6}.product-carousel .product-carousel-header h2 i{display:inline-block;position:absolute;top:13px;right:0}.product-carousel .product-carousel-wrapper{width:100%;height:120px;position:relative}.product-carousel .product-carousel-wrapper .product-carousel-left{position:absolute;top:0;left:0;height:100%}.product-carousel .product-carousel-wrapper .product-carousel-right{right:0;position:absolute;top:0;width:10px;height:100%}.product-carousel .product-carousel-wrapper .carousel-arrow{position:absolute;top:50%;width:50px;height:50px;margin-top:-35px;border-radius:100%;border:1px solid #ccc;background-color:white;z-index:10;margin-left:-25px;cursor:pointer;opacity:0;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.product-carousel .product-carousel-wrapper .carousel-arrow i{position:absolute;top:50%;left:50%;margin-left:-12px;margin-top:-12px}.product-carousel .product-carousel-wrapper .carousel-arrow:active{background-color:#e6e6e6}.product-carousel .product-carousel-wrapper:hover .carousel-arrow{opacity:1}.product-carousel .product-carousel-container{width:100%;overflow:hidden;position:relative;height:120px}.product-carousel .product-carousel-container .product-carousel-slider{position:absolute;top:0;left:0;height:120px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.product-carousel .product-carousel-container .product-carousel-item{float:left;height:120px}.product-carousel .product-carousel-container .product-carousel-item figure{margin:0;width:100%;float:left;margin-bottom:10px}.product-carousel .product-carousel-container .product-carousel-item figure img{height:48px;width:48px;float:left}.product-carousel .product-carousel-container .product-carousel-item .product-info span{display:block;float:left;width:100%;height:22px;line-height:22px}.product-carousel .product-carousel-container .product-carousel-item .product-info span.product-info-title{color:#007aa6;text-overflow:ellipsis;word-break:break-word;display:block;overflow:hidden;white-space:nowrap;padding-right:20px;font-size:16px}.product-carousel .product-carousel-container .product-carousel-item .product-info span.product-info-user{color:#666;font-size:15px}
\ No newline at end of file
diff --git a/httpdocs/theme/react/assets/css/homepage.css.map b/httpdocs/theme/react/assets/css/homepage.css.map
index b86a5db17..b21600e8b 100644
--- a/httpdocs/theme/react/assets/css/homepage.css.map
+++ b/httpdocs/theme/react/assets/css/homepage.css.map
@@ -1 +1 @@
-{"version":3,"sources":["homepage.less","/Users/davidnelband/Sites/git/ocs-webserver/httpdocs/theme/react/assets/less/elements.less"],"names":[],"mappings":"AAEA,qBACE,YACI,UAAA,YACA,cAAA,YACA,UAIN,kBACE,WADF,iBAEE,YACE,WAIJ,kBACE,mBAAA,CACA,6BAFF,iBAIE,0BACE,WAAA,CACA,cANJ,iBAIE,yBAIE,IACE,cAAA,YACA,UAAA,CACA,aAAA,CACA,UAAA,CACA,kBAAA,CACA,iBAAA,CACA,UAAA,YACA,mBAhBN,iBAIE,yBAIE,GAUE,GACE,cAnBR,iBAIE,yBAIE,GAcE,GACE,oBAAA,CACA,iBAAA,CACA,QAAA,CACA,QA1BR,iBA+BE,2BACE,UAAA,CACA,YAAA,CACA,kBAlCJ,iBA+BE,0BAKE,wBACE,iBAAA,CACA,KAAA,CACA,MAAA,CACA,YAxCN,iBA+BE,0BAYE,yBACE,OAAA,CACA,iBAAA,CACA,KAAA,CACA,UAAA,CACA,YAhDN,iBA+BE,0BAoBE,iBACE,iBAAA,CACA,OAAA,CACA,UAAA,CACA,WAAA,CACA,gBAAA,CACA,kBAAA,CACA,qBAAA,CACA,sBAAA,CACA,UAAA,CACA,iBAAA,CACA,cAAA,CACA,SAAA,CCuBF,mCAAA,CACA,gCAAA,CACA,8BAAA,CACA,4BDzFJ,iBA+BE,0BAoBE,gBAeE,GACE,iBAAA,CACA,OAAA,CACA,QAAA,CACA,iBAAA,CACA,iBAGF,iBA3CJ,0BAoBE,gBAuBG,QACC,yBAIJ,iBAhDF,0BAgDG,MACC,iBACE,UAjFR,iBAsFE,6BACE,UAAA,CACA,eAAA,CACA,iBAAA,CACA,aA1FJ,iBAsFE,4BAME,0BACE,iBAAA,CACA,KAAA,CACA,MAAA,CACA,YAAA,CCVF,mCAAA,CACA,gCAAA,CACA,8BAAA,CACA,4BDzFJ,iBAsFE,4BAcE,wBACE,UAAA,CACA,aAtGN,iBAsFE,4BAcE,uBAIE,QACE,QAAA,CACA,UAAA,CACA,UAAA,CACA,mBA5GR,iBAsFE,4BAcE,uBAIE,OAME,KACE,WAAA,CACA,UAAA,CACA,WAjHV,iBAsFE,4BAcE,uBAiBE,cACE,MACE,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,iBAEA,iBAvCR,4BAcE,uBAiBE,cACE,KAOG,oBACC,aAAA,CACA,sBAAA,CACA,qBAAA,CACA,aAAA,CACA,eAAA,CACA,kBAAA,CACA,kBAAA,CACA,eAGF,iBAlDR,4BAcE,uBAiBE,cACE,KAkBG,mBACC,UAAA,CACA"}
\ No newline at end of file
+{"version":3,"sources":["homepage.less","/Users/davidnelband/Sites/git/ocs-webserver/httpdocs/theme/react/assets/less/elements.less"],"names":[],"mappings":"AAEA,qBACE,YACI,UAAA,YACA,cAAA,YACA,SAAA,CACA,aAIN,kBACE,WADF,iBAEE,YACE,WAIJ,kBACE,mBAAA,CACA,6BAFF,iBAIE,0BACE,WAAA,CACA,cANJ,iBAIE,yBAIE,IACE,cAAA,YACA,UAAA,CACA,aAAA,CACA,UAAA,CACA,kBAAA,CACA,iBAAA,CACA,UAAA,YACA,mBAhBN,iBAIE,yBAIE,GAUE,GACE,cAnBR,iBAIE,yBAIE,GAcE,GACE,oBAAA,CACA,iBAAA,CACA,QAAA,CACA,QA1BR,iBA+BE,2BACE,UAAA,CACA,YAAA,CACA,kBAlCJ,iBA+BE,0BAKE,wBACE,iBAAA,CACA,KAAA,CACA,MAAA,CACA,YAxCN,iBA+BE,0BAYE,yBACE,OAAA,CACA,iBAAA,CACA,KAAA,CACA,UAAA,CACA,YAhDN,iBA+BE,0BAoBE,iBACE,iBAAA,CACA,OAAA,CACA,UAAA,CACA,WAAA,CACA,gBAAA,CACA,kBAAA,CACA,qBAAA,CACA,sBAAA,CACA,UAAA,CACA,iBAAA,CACA,cAAA,CACA,SAAA,CCsBF,mCAAA,CACA,gCAAA,CACA,8BAAA,CACA,4BDxFJ,iBA+BE,0BAoBE,gBAeE,GACE,iBAAA,CACA,OAAA,CACA,QAAA,CACA,iBAAA,CACA,iBAGF,iBA3CJ,0BAoBE,gBAuBG,QACC,yBAIJ,iBAhDF,0BAgDG,MACC,iBACE,UAjFR,iBAsFE,6BACE,UAAA,CACA,eAAA,CACA,iBAAA,CACA,aA1FJ,iBAsFE,4BAME,0BACE,iBAAA,CACA,KAAA,CACA,MAAA,CACA,YAAA,CCXF,mCAAA,CACA,gCAAA,CACA,8BAAA,CACA,4BDxFJ,iBAsFE,4BAcE,wBACE,UAAA,CACA,aAtGN,iBAsFE,4BAcE,uBAIE,QACE,QAAA,CACA,UAAA,CACA,UAAA,CACA,mBA5GR,iBAsFE,4BAcE,uBAIE,OAME,KACE,WAAA,CACA,UAAA,CACA,WAjHV,iBAsFE,4BAcE,uBAiBE,cACE,MACE,aAAA,CACA,UAAA,CACA,UAAA,CACA,WAAA,CACA,iBAEA,iBAvCR,4BAcE,uBAiBE,cACE,KAOG,oBACC,aAAA,CACA,sBAAA,CACA,qBAAA,CACA,aAAA,CACA,eAAA,CACA,kBAAA,CACA,kBAAA,CACA,eAGF,iBAlDR,4BAcE,uBAiBE,cACE,KAkBG,mBACC,UAAA,CACA"}
\ No newline at end of file
diff --git a/httpdocs/theme/react/assets/less/homepage.less b/httpdocs/theme/react/assets/less/homepage.less
index d97b530f1..0173ad712 100644
--- a/httpdocs/theme/react/assets/less/homepage.less
+++ b/httpdocs/theme/react/assets/less/homepage.less
@@ -1,164 +1,165 @@
out: ../css/homepage.css, sourcemap: true, compress: true
@import "elements.less";
#opendesktop-homepage {
.container {
width: 100% !important;
max-width: 100% !important;
padding: 0;
+ height: 100px;
}
}
#featured-product {
width: 100%;
.container {
width: 100%;
}
}
.product-carousel {
padding-bottom: 10px;
border-bottom: 1px solid #ccc;
.product-carousel-header {
height: auto;
overflow: auto;
h2 {
font-size: 25px !important;
float: left;
display: block;
width: auto;
padding-right: 20px;
position: relative;
width: auto !important;
margin-bottom: 20px;
a {
color: #007aa6;
}
i {
display: inline-block;
position: absolute;
top: 13px;
right: 0;
}
}
}
.product-carousel-wrapper {
width: 100%;
height: 120px;
position: relative;
.product-carousel-left {
position: absolute;
top: 0;
left: 0;
height: 100%;
}
.product-carousel-right {
right:0;
position: absolute;
top: 0;
width: 10px;
height: 100%;
}
.carousel-arrow {
position: absolute;
top: 50%;
width: 50px;
height: 50px;
margin-top: -35px;
border-radius: 100%;
border:1px solid #ccc;
background-color: white;
z-index: 10;
margin-left: -25px;
cursor: pointer;
opacity: 0;
.transition();
i {
position: absolute;
top: 50%;
left: 50%;
margin-left: -12px;
margin-top: -12px;
}
&:active {
background-color: darken(white,10%);
}
}
&:hover {
.carousel-arrow {
opacity: 1;
}
}
}
.product-carousel-container {
width: 100%;
overflow: hidden;
position: relative;
height: 120px;
.product-carousel-slider {
position: absolute;
top: 0;
left: 0;
height: 120px;
.transition();
}
.product-carousel-item {
float: left;
height: 120px;
figure {
margin: 0;
width: 100%;
float: left;
margin-bottom: 10px;
img {
height: 48px;
width: 48px;
float: left;
}
}
.product-info {
span {
display: block;
float: left;
width: 100%;
height: 22px;
line-height: 22px;
&.product-info-title {
color: #007aa6;
text-overflow: ellipsis;
word-break: break-word;
display: block;
overflow: hidden;
white-space: nowrap;
padding-right: 20px;
font-size: 16px;
}
&.product-info-user {
color: #666;
font-size: 15px;
}
}
}
}
}
}
diff --git a/httpdocs/theme/react/opendesktop-home.js b/httpdocs/theme/react/opendesktop-home.js
index a92621391..ecf4cda21 100644
--- a/httpdocs/theme/react/opendesktop-home.js
+++ b/httpdocs/theme/react/opendesktop-home.js
@@ -1,286 +1,287 @@
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
loading: true
};
this.initHomePage = this.initHomePage.bind(this);
this.updateDimensions = this.updateDimensions.bind(this);
this.convertDataObject = this.convertDataObject.bind(this);
}
componentWillMount() {
this.updateDimensions();
}
componentWillUnmount() {
window.removeEventListener("resize", this.updateDimensions);
window.removeEventListener("orientationchange", this.updateDimensions);
}
componentDidMount() {
this.initHomePage();
}
initHomePage() {
window.addEventListener("resize", this.updateDimensions);
window.addEventListener("orientationchange", this.updateDimensions);
let env = "live";
if (location.hostname.endsWith('cc')) {
env = "test";
} else if (location.hostname.endsWith('localhost')) {
env = "test";
}
this.setState({ env: env }, function () {
this.convertDataObject();
});
}
updateDimensions() {
const width = window.innerWidth;
let device;
if (width >= 910) {
device = "large";
} else if (width < 910 && width >= 610) {
device = "mid";
} else if (width < 610) {
device = "tablet";
}
this.setState({ device: device });
}
convertDataObject() {
let productGroupsArray = [];
for (var i in window.data) {
if (i !== "comments") {
const productGroup = {
title: i,
products: JSON.parse(window.data[i])
};
productGroupsArray.push(productGroup);
}
}
this.setState({ productGroupsArray: productGroupsArray, loading: false });
}
render() {
let productCarouselsContainer;
if (this.state.loading === false) {
productCarouselsContainer = this.state.productGroupsArray.map((pgc, index) => React.createElement(
"div",
{ key: index, className: "section" },
React.createElement(
"div",
{ className: "container" },
React.createElement(ProductCarousel, {
products: pgc.products,
device: this.state.device,
title: pgc.title,
link: '/',
env: this.state.env
})
)
));
}
return React.createElement(
"main",
{ id: "opendesktop-homepage" },
React.createElement(
"div",
{ id: "featured-product" },
React.createElement("div", { className: "container" })
),
productCarouselsContainer
);
}
}
class ProductCarousel extends React.Component {
constructor(props) {
super(props);
this.state = {
showRightArrow: true,
showLeftArrow: false
};
this.updateDimensions = this.updateDimensions.bind(this);
this.animateProductCarousel = this.animateProductCarousel.bind(this);
}
componentWillMount() {
window.addEventListener("resize", this.updateDimensions);
}
componentDidMount() {
this.updateDimensions();
}
updateDimensions() {
const containerWidth = $('#featured-product').find('.container').width();
+ console.log(containerWidth);
const sliderWidth = containerWidth * 3;
const itemWidth = containerWidth / 5;
this.setState({
sliderPosition: 0,
containerWidth: containerWidth,
sliderWidth: sliderWidth,
itemWidth: itemWidth
});
}
animateProductCarousel(dir) {
let newSliderPosition = this.state.sliderPosition;
if (dir === 'left') {
newSliderPosition = this.state.sliderPosition - this.state.containerWidth;
} else {
newSliderPosition = this.state.sliderPosition + this.state.containerWidth;
}
this.setState({ sliderPosition: newSliderPosition }, function () {
let showLeftArrow = true,
showRightArrow = true;
const endPoint = this.state.sliderWidth - this.state.containerWidth;
if (this.state.sliderPosition <= 0) {
showLeftArrow = false;
}
if (this.state.sliderPosition >= endPoint) {
showRightArrow = false;
}
this.setState({
showLeftArrow: showLeftArrow,
showRightArrow: showRightArrow
});
});
}
render() {
let carouselItemsDisplay;
if (this.props.products && this.props.products.length > 0) {
carouselItemsDisplay = this.props.products.map((product, index) => React.createElement(ProductCarouselItem, {
key: index,
product: product,
itemWidth: this.state.itemWidth,
env: this.props.env
}));
}
let rightArrowDisplay, leftArrowDisplay;
if (this.state.showLeftArrow) {
leftArrowDisplay = React.createElement(
"div",
{ className: "product-carousel-left" },
React.createElement(
"a",
{ onClick: () => this.animateProductCarousel('left'), className: "carousel-arrow arrow-left" },
React.createElement(
"i",
{ className: "material-icons" },
"chevron_left"
)
)
);
}
if (this.state.showRightArrow) {
rightArrowDisplay = React.createElement(
"div",
{ className: "product-carousel-right" },
React.createElement(
"a",
{ onClick: () => this.animateProductCarousel('right'), className: "carousel-arrow arrow-right" },
React.createElement(
"i",
{ className: "material-icons" },
"chevron_right"
)
)
);
}
return React.createElement(
"div",
{ className: "product-carousel" },
React.createElement(
"div",
{ className: "product-carousel-header" },
React.createElement(
"h2",
null,
React.createElement(
"a",
{ href: this.props.link },
this.props.title,
React.createElement(
"i",
{ className: "material-icons" },
"chevron_right"
)
)
)
),
React.createElement(
"div",
{ className: "product-carousel-wrapper" },
leftArrowDisplay,
React.createElement(
"div",
{ className: "product-carousel-container" },
React.createElement(
"div",
{ className: "product-carousel-slider", style: { "width": this.state.sliderWidth, "left": "-" + this.state.sliderPosition + "px" } },
carouselItemsDisplay
)
),
rightArrowDisplay
)
);
}
}
class ProductCarouselItem extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
let imageBaseUrl;
if (this.props.env === 'live') {
imageBaseUrl = 'cn.opendesktop.org';
} else {
imageBaseUrl = 'cn.pling.it';
}
return React.createElement(
"div",
{ className: "product-carousel-item", style: { "width": this.props.itemWidth } },
React.createElement(
"a",
{ href: "/p/" + this.props.product.project_id },
React.createElement(
"figure",
null,
React.createElement("img", { className: "very-rounded-corners", src: 'https://' + imageBaseUrl + '/cache/200x171/img/' + this.props.product.image_small })
),
React.createElement(
"div",
{ className: "product-info" },
React.createElement(
"span",
{ className: "product-info-title" },
this.props.product.title
),
React.createElement(
"span",
{ className: "product-info-user" },
this.props.product.username
)
)
)
);
}
}
ReactDOM.render(React.createElement(App, null), document.getElementById('main-content'));