From 378520d50a33be6bd99c849d884d909611d441d4 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Thu, 23 May 2019 11:26:54 +1000 Subject: [PATCH] Changed the color scheme --- public/news/2019-05-22-01.md | 1 + public/styles/shared.css | 20 ++++++++++++++++---- src/components/panels/news_panel.jsx | 10 ++++------ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/public/news/2019-05-22-01.md b/public/news/2019-05-22-01.md index b6013a9..e4bf5b0 100644 --- a/public/news/2019-05-22-01.md +++ b/public/news/2019-05-22-01.md @@ -1,5 +1,6 @@ Hello World! --- +_22 May 2019_ Oh, um... OK, let's start then! Welcome to Kingdom Battles where you can fight for your life and the honour of being at the top of the ladder! Well, as soon as the ladder is implemented... diff --git a/public/styles/shared.css b/public/styles/shared.css index 5c36f63..abf93bf 100644 --- a/public/styles/shared.css +++ b/public/styles/shared.css @@ -13,13 +13,13 @@ body { flex-direction: column; overflow-x: hidden; overflow-y: auto; - background-color: #000000; + background-color: #111111; color: white; } h1 { font-size: 24pt; - color: red; + color: pink; } h2 { @@ -44,6 +44,10 @@ ul { padding-bottom: .5rem; } +a { + color: lightblue; +} + .centered { text-align: center; } @@ -171,22 +175,30 @@ footer { } } -/* News panel */ +/* main panel */ .mainPanel { - margin-left: 15px; + margin-left: 30px; flex: 1; display: flex; flex-direction: column; justify-content: flex-start; } +@media screen and (max-width: 768px) { + .mainPanel { + margin-left: 15px; + } +} + @media screen and (max-width: 480px) { .mainPanel { + margin-left: 0; align-self: stretch; width: auto; } } +/* profile page */ .table { flex: 1; display: flex; diff --git a/src/components/panels/news_panel.jsx b/src/components/panels/news_panel.jsx index 4342ed3..b37a77a 100644 --- a/src/components/panels/news_panel.jsx +++ b/src/components/panels/news_panel.jsx @@ -9,18 +9,18 @@ class NewsPanel extends React.Component { data: {} }; - this.fetchNews(); + this.fetchNews(3); } render() { return (
- {Object.keys(this.state.data).map((key, index) =>

)} + {Object.keys(this.state.data).map((key) =>

)}
); } - fetchNews() { + fetchNews(max = 3) { //build the XHR let xhr = new XMLHttpRequest(); @@ -34,9 +34,7 @@ class NewsPanel extends React.Component { xhr.open('POST', '/newsrequest', true); xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); - xhr.send(JSON.stringify({ - max: 3 - })); + xhr.send(JSON.stringify({ max: max })); } };