summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-01-30 12:41:59 +0100
committerJules Laplace <julescarbon@gmail.com>2019-01-30 12:41:59 +0100
commitba9d0860484fcc52f89dc72cd97dee2d9205aa36 (patch)
treef3ac547370aaa9f7c12c10a64c3623374b7b83f8
parent78fbb43ae9726ee1f0ca7f4c27f4060a34763629 (diff)
update mobile css
-rw-r--r--client/splash/index.js3
-rw-r--r--client/splash/modal.js19
-rw-r--r--site/assets/css/css.css2
-rw-r--r--site/assets/css/splash.css46
-rw-r--r--site/assets/demo/splash/index.html2
5 files changed, 67 insertions, 5 deletions
diff --git a/client/splash/index.js b/client/splash/index.js
index 322ed0ff..e247b7f5 100644
--- a/client/splash/index.js
+++ b/client/splash/index.js
@@ -30,8 +30,9 @@ function build() {
}
function bind() {
+ document.querySelector('.slogan').addEventListener('click', modal.close)
toArray(document.querySelectorAll('.aboutLink')).forEach(el => {
- el.addEventListener('click', modal.open)
+ el.addEventListener('click', modal.toggle)
})
document.querySelector('.about .inner').addEventListener('click', e => e.stopPropagation())
document.querySelector('.about').addEventListener('click', modal.close)
diff --git a/client/splash/modal.js b/client/splash/modal.js
index d5a63d75..47d26c06 100644
--- a/client/splash/modal.js
+++ b/client/splash/modal.js
@@ -1,10 +1,25 @@
-export function open() {
+let isOpen = false
+
+export function toggle(e) {
+ if (isOpen) close(e)
+ else open(e)
+}
+
+export function open(e) {
+ if (e) e.preventDefault()
+ if (isOpen) return
const el = document.querySelector('.about')
+ document.body.classList.add('modalOpen')
el.classList.add('open')
+ isOpen = true
}
-export function close() {
+export function close(e) {
+ if (e) e.preventDefault()
+ if (!isOpen) return
const el = document.querySelector('.about')
+ document.body.classList.remove('modalOpen')
el.classList.remove('open')
+ isOpen = false
}
diff --git a/site/assets/css/css.css b/site/assets/css/css.css
index e29f2595..7544fd9d 100644
--- a/site/assets/css/css.css
+++ b/site/assets/css/css.css
@@ -76,6 +76,7 @@ header .links {
flex-direction: row;
font-family: 'Roboto Mono', monospace;
}
+header .links span,
header .links a {
display: block;
color: #777;
@@ -84,6 +85,7 @@ header .links a {
margin-right: 32px;
transition: color 0.1s cubic-bezier(0,0,1,1), border-color 0.1s cubic-bezier(0,0,1,1);
border-bottom: 1px solid rgba(255,255,255,0);
+ padding: 3px;
}
header .links a.active {
color: #bbb;
diff --git a/site/assets/css/splash.css b/site/assets/css/splash.css
index 238139a4..be0762b2 100644
--- a/site/assets/css/splash.css
+++ b/site/assets/css/splash.css
@@ -70,4 +70,48 @@ header .links a.activeLink {
}
.about a {
color: #fff;
-} \ No newline at end of file
+}
+
+@media screen and (max-width: 700px) {
+ header, footer {
+ transition: background 0.4s;
+ }
+ .modalOpen header,
+ .modalOpen footer {
+ background: rgba(25, 25, 25, 1.0);
+ }
+ header .slogan {
+ padding-left: 20px;
+ }
+ footer {
+ display: block;
+ background: rgba(25, 25, 25, 0.8);
+ padding: 10px 20px;
+ }
+ footer div {
+ background: transparent;
+ text-align: center;
+ width: 100%;
+ display: block;
+ padding: 0;
+ }
+ header .links {
+ padding: 4px 5px 0 0;
+ }
+ header .links span,
+ header .links a {
+ margin-right: 10px;
+ margin-left: 0px;
+ font-size: 14px;
+ }
+}
+@media screen and (min-height: 500px) {
+ .about {
+ display: block;
+ }
+ .about .inner {
+ max-width: 100%;
+ padding: 20px;
+ padding-top: 70px;
+ }
+}
diff --git a/site/assets/demo/splash/index.html b/site/assets/demo/splash/index.html
index e285c861..32517d97 100644
--- a/site/assets/demo/splash/index.html
+++ b/site/assets/demo/splash/index.html
@@ -18,7 +18,7 @@
<div class='site_name'>MegaPixels</div>
</a>
<div class='links'>
- <a href="#" class='aboutLink'>LAUNCHING MAY 2019</a>
+ <span>LAUNCHING MAY 2019</span>
<a href="#" class='aboutLink activeLink'>ABOUT</a>
</div>
</header>