diff --git a/res/home.html b/res/home.html index ddcfb0e887..4b3b3198b7 100644 --- a/res/home.html +++ b/res/home.html @@ -1,9 +1,183 @@ - - - - Riot - Home - - -
Welcome to Riot
- - \ No newline at end of file + + diff --git a/res/home/css/welcome.css b/res/home/css/welcome.css new file mode 100644 index 0000000000..0d3c5a5ee8 --- /dev/null +++ b/res/home/css/welcome.css @@ -0,0 +1,72 @@ +.mx_HomePage_col { + display: flex; + flex-direction: row; + flex-wrap: wrap; +} + +.mx_HomePage_row { + flex: 1 1 0; + margin-right: 20px; + display: flex; + flex-direction: row; + flex-wrap: wrap; +} + +.mx_HomePage_logo { + margin-top: 20px; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 20px; + display: inline; + height: 100px; +} + +.mx_HomePage_room { + cursor: pointer; + float: left; + text-decoration: none; + text-align: center; + padding-left: 10px; + padding-right: 10px; + width: 120px; +} + +.mx_HomePage_room .mx_HomePage_icon { + border-radius: 50%; + width: 65px; + height: 65px; +} + +.mx_HomePage_room .mx_HomePage_name { + display: block; +} + +.mx_HomePage_room .mx_HomePage_desc { + display: block; + font-size: 12px; + margin-top: 8px; +} + +.mx_HomePage_comment { + display: block; + margin-left: 140px; + vertical-align: top; +} + +h3::after, h4::after { + content: ":"; +} + +.mx_HomePage_container { + display: block ! important; + margin: 20px; +} + +.mx_HomePage_container h1 { + margin: 0px; + margin-top: 35px; +} + +.mx_HomePage_container h2 { + margin-top: 5px; +} \ No newline at end of file diff --git a/res/home/images/logo.svg b/res/home/images/logo.svg new file mode 100644 index 0000000000..49f1186ffc --- /dev/null +++ b/res/home/images/logo.svg @@ -0,0 +1 @@ +New_logoI M. \ No newline at end of file diff --git a/res/home/images/matrix.svg b/res/home/images/matrix.svg new file mode 100644 index 0000000000..5c7dfbb5e3 --- /dev/null +++ b/res/home/images/matrix.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/home/rooms/bridging.png b/res/home/rooms/bridging.png new file mode 100644 index 0000000000..6b3a55e7bb Binary files /dev/null and b/res/home/rooms/bridging.png differ diff --git a/res/home/rooms/dendrite-dev.png b/res/home/rooms/dendrite-dev.png new file mode 100644 index 0000000000..1d96bd84a7 Binary files /dev/null and b/res/home/rooms/dendrite-dev.png differ diff --git a/res/home/rooms/dendrite.png b/res/home/rooms/dendrite.png new file mode 100644 index 0000000000..1d96bd84a7 Binary files /dev/null and b/res/home/rooms/dendrite.png differ diff --git a/res/home/rooms/e2e.png b/res/home/rooms/e2e.png new file mode 100644 index 0000000000..a2bda4bc68 Binary files /dev/null and b/res/home/rooms/e2e.png differ diff --git a/res/home/rooms/homeowners.png b/res/home/rooms/homeowners.png new file mode 100644 index 0000000000..ed45f11ceb Binary files /dev/null and b/res/home/rooms/homeowners.png differ diff --git a/res/home/rooms/identity.jpg b/res/home/rooms/identity.jpg new file mode 100644 index 0000000000..f2e1505634 Binary files /dev/null and b/res/home/rooms/identity.jpg differ diff --git a/res/home/rooms/identity.png b/res/home/rooms/identity.png new file mode 100644 index 0000000000..de1ea60d54 Binary files /dev/null and b/res/home/rooms/identity.png differ diff --git a/res/home/rooms/irc.png b/res/home/rooms/irc.png new file mode 100644 index 0000000000..5f611d12a4 Binary files /dev/null and b/res/home/rooms/irc.png differ diff --git a/res/home/rooms/matrix-dev.png b/res/home/rooms/matrix-dev.png new file mode 100644 index 0000000000..fa54f00cb2 Binary files /dev/null and b/res/home/rooms/matrix-dev.png differ diff --git a/res/home/rooms/matrix.png b/res/home/rooms/matrix.png new file mode 100644 index 0000000000..fa54f00cb2 Binary files /dev/null and b/res/home/rooms/matrix.png differ diff --git a/res/home/rooms/riot-android.png b/res/home/rooms/riot-android.png new file mode 100644 index 0000000000..fa2bec8e3e Binary files /dev/null and b/res/home/rooms/riot-android.png differ diff --git a/res/home/rooms/riot-bot.png b/res/home/rooms/riot-bot.png new file mode 100644 index 0000000000..9efd4a3c21 Binary files /dev/null and b/res/home/rooms/riot-bot.png differ diff --git a/res/home/rooms/riot-dev.png b/res/home/rooms/riot-dev.png new file mode 100644 index 0000000000..ff8b21ad1a Binary files /dev/null and b/res/home/rooms/riot-dev.png differ diff --git a/res/home/rooms/riot-ios.png b/res/home/rooms/riot-ios.png new file mode 100644 index 0000000000..83306f7cb8 Binary files /dev/null and b/res/home/rooms/riot-ios.png differ diff --git a/res/home/rooms/riot-translations.png b/res/home/rooms/riot-translations.png new file mode 100644 index 0000000000..ee0f855895 Binary files /dev/null and b/res/home/rooms/riot-translations.png differ diff --git a/res/home/rooms/riot.png b/res/home/rooms/riot.png new file mode 100644 index 0000000000..4daa2e4ef7 Binary files /dev/null and b/res/home/rooms/riot.png differ diff --git a/res/home/rooms/synapse.png b/res/home/rooms/synapse.png new file mode 100644 index 0000000000..ee0f855895 Binary files /dev/null and b/res/home/rooms/synapse.png differ diff --git a/res/home/rooms/vr.png b/res/home/rooms/vr.png new file mode 100644 index 0000000000..98b77802df Binary files /dev/null and b/res/home/rooms/vr.png differ diff --git a/res/home/rooms/webrtc.png b/res/home/rooms/webrtc.png new file mode 100644 index 0000000000..98b790f9ae Binary files /dev/null and b/res/home/rooms/webrtc.png differ diff --git a/scripts/copy-res.js b/scripts/copy-res.js index 45aecebefb..d6835a237f 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -26,6 +26,7 @@ const INCLUDE_LANGS = [ const COPY_LIST = [ ["res/manifest.json", "webapp"], ["res/home.html", "webapp"], + ["res/home/**", "webapp/home"], ["res/{media,vector-icons}/**", "webapp"], ["res/flags/*", "webapp/flags/"], ["src/skins/vector/{fonts,img}/**", "webapp"], diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index dfcca0e8ad..810a0a44fa 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -20,6 +20,8 @@ limitations under the License. import React from 'react'; import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; import sdk from 'matrix-react-sdk'; +import GeminiScrollbar from 'react-gemini-scrollbar'; +import request from 'browser-request'; module.exports = React.createClass({ displayName: 'HomePage', @@ -34,17 +36,46 @@ module.exports = React.createClass({ homePageUrl: React.PropTypes.string, }, - render: function() { + getInitialState: function() { + return { + page: "" + }; + }, + + componentWillMount: function() { + // we use request() to inline the homepage into the react component + // so that it can inherit CSS and theming easily rather than mess around + // with iframes and trying to synchronise document.stylesheets. + let src = this.props.homePageUrl || '/home.html'; if (this.props.teamToken && this.props.teamServerUrl) { src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`; } + request( + { method: "GET", url: src }, + (err, response, body) => { + if (err || response.status < 200 || response.status >= 300) { + console.log(error); + this.setState({ page: "Couldn't load home page" }); + } + + // We parse the JSON ourselves rather than use the JSON + // parameter, since this throws a parse error on empty + // which breaks if there's no config.json and we're + // loading from the filesystem (see above). + this.setState({ page: body }); + } + ); + }, + + render: function() { return ( -
-