mirror of
https://github.com/trambarhq/relaks-wordpress-example.git
synced 2025-09-25 06:51:30 +02:00
Various CSS fixes.
This commit is contained in:
@@ -87,7 +87,7 @@ class FrontEnd extends PureComponent {
|
||||
*/
|
||||
handleScroll = (evt) => {
|
||||
let { topNavCollapsed } = this.state;
|
||||
let container = document.body.parentElement;
|
||||
let container = document.body;
|
||||
let previousPos = this.previousScrollPosition || 0;
|
||||
let currentPos = container.scrollTop;
|
||||
let delta = currentPos - previousPos;
|
||||
@@ -99,9 +99,11 @@ class FrontEnd extends PureComponent {
|
||||
let page = (pageContainer) ? pageContainer.firstChild : null;
|
||||
if (page) {
|
||||
let pageRect = page.getBoundingClientRect();
|
||||
if (pageRect.y <= 40) {
|
||||
if (pageRect.top <= 40) {
|
||||
this.setState({ topNavCollapsed: true });
|
||||
}
|
||||
} else {
|
||||
this.setState({ topNavCollapsed: true });
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
|
||||
<title>Relaks WordPress Example</title>
|
||||
</head>
|
||||
|
@@ -6,7 +6,7 @@ class WelcomePage extends AsyncComponent {
|
||||
|
||||
async renderAsync(meanwhile) {
|
||||
return (
|
||||
<div>
|
||||
<div className="page">
|
||||
<h1>Welcome</h1>
|
||||
<p>Lorem ipsum dolor sit amet, utinam quodsi expetendis in has. Primis accumsan mnesarchum ne eam, simul ludus no est, duo ne ferri minim facilisis. Virtute detraxit intellegam quo ad, usu mundi minimum at, soleat insolens intellegam no est. Dicta viderer efficiantur id vix, simul zril legere te sea. Sed quaeque alienum principes ex, ne idque dicit duo, dolor voluptaria in vel.</p>
|
||||
<p>Ne nisl essent cum, at quod antiopam has. Sanctus graecis ocurreret sed at, veniam urbanitas at cum. Epicurei ullamcorper est ut, no mei virtute lobortis indoctum. Putant inermis definiebas ne nec, habeo mazim offendit ei vim. Dicat tempor no duo, mea ex cibo autem. Eos probatus ocurreret rationibus no.</p>
|
||||
|
@@ -2,16 +2,13 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
HTML {
|
||||
overflow-x: hidden;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
|
||||
BODY {
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
overscroll-behavior: contain;
|
||||
font-family: sans-serif;
|
||||
margin: 0;
|
||||
background-color: #66023c; // prevent white gap in side nav
|
||||
}
|
||||
|
||||
.contents {
|
||||
@@ -35,8 +32,7 @@ A {
|
||||
width: 18em;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: -10em; // prevent visual glitch in Android
|
||||
padding-bottom: 10em;
|
||||
bottom: 0;
|
||||
background-color: #66023c;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -45,7 +41,7 @@ A {
|
||||
position: fixed;
|
||||
left: 18em;
|
||||
top: 0;
|
||||
width: calc(100vw - 18em);
|
||||
width: calc(100% - 18em);
|
||||
background-color: #990000; // prevent visual glitch in Android
|
||||
|
||||
.title-bar {
|
||||
@@ -123,19 +119,21 @@ A {
|
||||
|
||||
.input-container {
|
||||
position: relative;
|
||||
box-sizing: content-box;
|
||||
|
||||
INPUT {
|
||||
max-width: 20em;
|
||||
width: 100%;
|
||||
padding-left: 1.6em;
|
||||
padding-left: 1.8em;
|
||||
border: 1px solid #660000;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.fa-search {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 3px;
|
||||
font-size: 0.9em;
|
||||
left: 0.25em;
|
||||
top: 0.4em;
|
||||
font-size: 0.8em;
|
||||
color: transparentize(#660000, 0.75);
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -153,8 +151,12 @@ A {
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
margin-left: 18em;
|
||||
background-color: #ffffff;
|
||||
|
||||
.page {
|
||||
max-width: 60em;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 800px) {
|
||||
.page-container {
|
||||
@@ -170,7 +172,7 @@ A {
|
||||
.top-nav {
|
||||
transition: left 0.3s;
|
||||
left: 18em;
|
||||
width: calc(100vw - 1em);
|
||||
width: calc(100% - 1em);
|
||||
|
||||
.title-bar {
|
||||
height: 3em;
|
||||
@@ -211,7 +213,7 @@ A {
|
||||
|
||||
.page-container {
|
||||
padding-top: 6em;
|
||||
width: calc(100vw - 1em);
|
||||
width: calc(100% - 1em);
|
||||
max-width: none;
|
||||
|
||||
.side-collapsed & {
|
||||
@@ -223,13 +225,15 @@ A {
|
||||
@media only screen and (max-width: 400px) {
|
||||
.top-nav {
|
||||
.search-bar {
|
||||
padding-right: 0;
|
||||
|
||||
.input-container {
|
||||
width: 100%;
|
||||
|
||||
INPUT {
|
||||
border: 0;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
margin-left: -1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user