Skip to content

Commit 8de682e

Browse files
committed
Use new color scheme and remove color configurator
1 parent c8fb081 commit 8de682e

File tree

2 files changed

+11
-108
lines changed

2 files changed

+11
-108
lines changed

redesign/index.html

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>ReactPHP</title>
77

8-
<style id="css-config">
9-
:root {
10-
--color-base: #2b3e51;
11-
--color-highlight: #fc4349;
12-
}
13-
</style>
14-
158
<link href="https://fonts.googleapis.com/css?family=Raleway:300,700|Source+Sans+Pro:400,400i,700,700i|Roboto Mono" rel="stylesheet">
169
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.css" rel="stylesheet">
1710
<link href="style.css" rel="stylesheet">
@@ -235,103 +228,5 @@ <h2>Example</h2>
235228

236229
<script>hljs.configure({classPrefix: ''});hljs.initHighlightingOnLoad();</script>
237230

238-
<style>
239-
#color-picker {
240-
position: fixed;
241-
bottom: 0;
242-
left: 50%;
243-
transform: translateX(-50%);
244-
padding: 5px;
245-
background: #fff;
246-
box-shadow: 0 0 5px rgba(0, 0, 0, .5);
247-
}
248-
249-
#color-picker fieldset {
250-
display: inline-block;
251-
white-space: nowrap;
252-
border: 0;
253-
padding: 5px;
254-
}
255-
</style>
256-
<form id="color-picker">
257-
<fieldset>
258-
<label>Base</label>
259-
<input type="color" value="#2B3E51" id="base">
260-
</fieldset>
261-
262-
<fieldset>
263-
<label>Highlight</label>
264-
<input type="color" value="#FC4349" id="highlight">
265-
</fieldset>
266-
</form>
267-
268-
<script>
269-
function parseQueryParams(query){
270-
if (query.indexOf('?') === 0) {
271-
query = query.substr(1);
272-
}
273-
if (query.indexOf('#') === 0) {
274-
query = query.substr(1);
275-
}
276-
277-
if (!query) {
278-
return {};
279-
}
280-
281-
var pairs = query.split('&');
282-
var obj = {}, p;
283-
284-
for (var i = 0, n = pairs.length; i < n; i++) {
285-
if (!pairs[i]) {
286-
continue;
287-
}
288-
289-
p = pairs[i].split('=');
290-
obj[p[0]] = decodeURIComponent(p[1]);
291-
}
292-
293-
return obj;
294-
}
295-
296-
function getColors() {
297-
var query = parseQueryParams(location.hash);
298-
299-
query.base = query.base || '#2b3e51';
300-
query.highlight = query.highlight || '#fc4349';
301-
302-
return query;
303-
}
304-
305-
function setColors() {
306-
var colors = getColors();
307-
308-
document.getElementById('css-config').innerHTML = ':root { --color-base: ' + colors.base + '; --color-highlight: ' + colors.highlight + '; }';
309-
}
310-
311-
function changeColor(type, color) {
312-
var colors = getColors();
313-
314-
colors[type] = color;
315-
location.hash = 'base=' + encodeURIComponent(colors.base) + '&highlight=' + encodeURIComponent(colors.highlight);
316-
}
317-
318-
var base = document.getElementById('base');
319-
var highlight = document.getElementById('highlight');
320-
321-
var colors = getColors();
322-
323-
base.setAttribute('value', colors.base);
324-
base.addEventListener('change', function(e) {
325-
changeColor('base', e.target.value);
326-
}, false);
327-
328-
highlight.setAttribute('value', colors.highlight);
329-
highlight.addEventListener('change', function(e) {
330-
changeColor('highlight', e.target.value);
331-
}, false);
332-
333-
setColors();
334-
window.onhashchange = setColors;
335-
</script>
336231
</body>
337232
</html>

redesign/style.css

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
:root {
2+
--color-base: #333;
3+
--color-highlight: #8892bf;
4+
--color-highlight-dark: #4f5b93;
5+
--color-highlight-light: #c4c9df;
6+
--color-highlight-lighter: #e2e4ef;
7+
}
8+
19
html {
210
box-sizing: border-box;
311
}
@@ -30,7 +38,7 @@ h2 {
3038
}
3139

3240
h3 {
33-
color:var(--color-highlight);
41+
color:var(--color-highlight-dark);
3442
text-shadow: 1px 1px 0 rgba(255, 255, 255, .5);
3543
}
3644

@@ -79,12 +87,12 @@ code {
7987
background: var(--color-base);
8088
padding: 40px;
8189
text-align: center;
82-
color: rgba(255, 255, 255, .85);
90+
color: var(--color-highlight-lighter);
8391
text-shadow: 1px 1px 0 rgba(0, 0, 0, .125);
8492
}
8593

8694
.hero2 h2 {
87-
color: var(--color-highlight);
95+
color: var(--color-highlight-light);
8896
}
8997

9098
.hero3 {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy