Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic start of palette builder web, move a file arounf [ci skip]
- Loading branch information
1 parent
a4b7ba1
commit cf8932f
Showing
8 changed files
with
19,697 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,3 +229,6 @@ $RECYCLE.BIN/ | |
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
#React.JS | ||
.module-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<title>Material Design in XAML Toolkit Palette Builder</title> | ||
<script src="MaterialDesignPalette.js"></script> | ||
<link rel="stylesheet" href="styles/style.css" /> | ||
<script src="scripts/Swatches.js"></script> | ||
<script src="scripts/react.js"></script> | ||
<body> | ||
hello world (new linux VM test) | ||
<script> | ||
alert(swatches[3].colors[2].foregroundName); | ||
</script> | ||
<h1>Material Design in XAML Toolkit Palette Builder</h1> | ||
<script> | ||
//alert(swatches[3].colors[2].foregroundName); | ||
</script> | ||
<div id="swatches" /> | ||
</body> | ||
</head>wd | ||
<script src="scripts/PaletteBuilder.js"></script> | ||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var Color = React.createClass({ | ||
render: function() { | ||
|
||
var style = { | ||
background:this.props.backgroundColour, | ||
color:this.props.foregroundColour | ||
}; | ||
|
||
return ( | ||
<div style={style}>{this.props.backgroundName}</div> | ||
); | ||
} | ||
}); | ||
|
||
var Swatch = React.createClass({ | ||
render: function() { | ||
var colorNodes = this.props.colors.map(function (colorItem) { | ||
return ( | ||
<Color backgroundName={colorItem.backgroundName} backgroundColour={colorItem.backgroundColour} foregroundName={colorItem.foregroundName} foregroundColour={colorItem.foregroundColour} /> | ||
); | ||
}); | ||
return ( | ||
<div className="swatch"> | ||
{this.props.name} | ||
{colorNodes} | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
var SwatchesBox = React.createClass({ | ||
render: function() { | ||
var swatchNodes = this.props.swatches.map(function(swatch) { | ||
return ( | ||
<Swatch name={swatch.name} colors={swatch.colors} /> | ||
); | ||
}); | ||
|
||
return ( | ||
<div> | ||
{swatchNodes} | ||
</div> | ||
); | ||
} | ||
}); | ||
|
||
React.render( | ||
<SwatchesBox swatches={swatches} />, | ||
document.getElementById('swatches') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var Color = React.createClass({displayName: "Color", | ||
render: function() { | ||
|
||
var style = { | ||
background:this.props.backgroundColour, | ||
color:this.props.foregroundColour | ||
}; | ||
|
||
return ( | ||
React.createElement("div", {style: style}, this.props.backgroundName) | ||
); | ||
} | ||
}); | ||
|
||
var Swatch = React.createClass({displayName: "Swatch", | ||
render: function() { | ||
var colorNodes = this.props.colors.map(function (colorItem) { | ||
return ( | ||
React.createElement(Color, {backgroundName: colorItem.backgroundName, backgroundColour: colorItem.backgroundColour, foregroundName: colorItem.foregroundName, foregroundColour: colorItem.foregroundColour}) | ||
); | ||
}); | ||
return ( | ||
React.createElement("div", {className: "swatch"}, | ||
this.props.name, | ||
colorNodes | ||
) | ||
); | ||
} | ||
}); | ||
|
||
var SwatchesBox = React.createClass({displayName: "SwatchesBox", | ||
render: function() { | ||
var swatchNodes = this.props.swatches.map(function(swatch) { | ||
return ( | ||
React.createElement(Swatch, {name: swatch.name, colors: swatch.colors}) | ||
); | ||
}); | ||
|
||
return ( | ||
React.createElement("div", null, | ||
swatchNodes | ||
) | ||
); | ||
} | ||
}); | ||
|
||
React.render( | ||
React.createElement(SwatchesBox, {swatches: swatches}), | ||
document.getElementById('swatches') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.