janus/styles/main.css
2016-10-13 14:24:46 -04:00

225 lines
3.7 KiB
CSS

/* Basics */
*, *:before, *:after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
:root {
box-sizing: border-box;
font-family: sans-serif;
font-size: calc(2vw + 2em);
cursor: default;
}
a {
color: inherit;
cursor: pointer;
}
li {
list-style: none;
}
code {
font-family: Consolas, monaco, monospace;
}
kbd {
font-family: Consolas, monaco, monospace;
background-color: hsla(0, 0%, 100%, 0.2);
border-radius: 0.5em;
padding: 0.1em 0.4em 0;
margin: -0.1em 0 0;
}
h1 {
font-size: 1.5rem;
position: relative;
margin: 0 -10vw;
padding: 0 10vw 0.1em;
background-color: hsla(0, 0%, 100%, 0.2);
}
h2 {
font-size: 1rem;
}
h1, h2 {
font-weight: bold;
}
/* Layout */
body {
display: flex;
flex-direction: column;
padding: 0;
margin: 0;
background-color: black;
color: white;
overflow: hidden;
}
body.is-loading:after {
content: 'Loading...';
font-size: 0.5em;
line-height: 100vh;
color: white;
background-image: linear-gradient(45deg, #030, #000, #003);
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
text-align: center;
z-index: 100;
}
body.simulate-projection {
filter: brightness(1.5) contrast(0.65);
}
main {
margin-top: 0;
perspective: 100vmin;
transform-style: preserve-3d;
height: 100vh;
}
/* Components */
nav {
flex-wrap: wrap;
display: flex;
position: fixed;
top: 0;
left: 0;
right: 0;
padding: 0.25em 0.25em 4em;
transition: transform ease 0.5s;
font-size: 0.5rem;
z-index: 2;
background-image: linear-gradient(to top, hsla(0, 0%, 0%, 0), hsla(0, 0%, 0%, 0.5));
}
nav > label {
flex: 0 0 auto;
padding-right: 1ch;
}
nav > input {
flex: 1 1 auto;
padding: 0;
font-size: inherit;
border: none;
background: transparent;
color: inherit;
outline: none;
}
nav > input:invalid {
color: red;
}
ul.help {
width: 100%;
flex-shrink: 0;
font-size: 0.5em;
}
ul.help li {
display: inline-block;
background-color: hsla(0, 0%, 100%, 0.2);
border-radius: 0.5em;
padding: 0 0.5em;
}
section {
position: absolute;
z-index: 1;
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
height: 100%;
margin: 0;
padding: 1em;
overflow: hidden;
text-align: center;
background-color: black;
transition: transform ease 0.5s, opacity ease 0.5s, visibility step-end 0.5s;
transform-origin: 50% 50%;
}
/*
section > * {
transform: rotate(-7deg);
}
*/
[janus-timeline='past'] {
transition: transform ease-in 0.5s, opacity ease-in 0.5s, visibility step-end 0.5s;
}
[janus-timeline='present'] {
transition: transform ease-out 0.5s, opacity ease-out 0.5s, visibility step-start 0.5s;
}
[janus-timeline='future'] {
visibility: hidden;
}
body.show-notes section [janus-timeline='future'] {
visibility: visible;
opacity: 0.25;
}
body.show-notes section[janus-timeline='future'] [janus-timeline='future'] {
opacity: 1;
}
section[janus-timeline='past'] {
transform: translate3d(0, 0, 0) scale(5);
opacity: 0;
visibility: hidden;
pointer-events: none;
z-index: 2;
}
section[janus-timeline='present'] {
transform: none;
opacity: 1;
}
section[janus-timeline='future'] {
transform: translate3d(0, -5vmin, 0) scale(0.8);
opacity: 0;
visibility: hidden;
pointer-events: none;
}
img.cover {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
object-fit: cover;
z-index: -1;
transform: none;
}
body.show-notes section {
transition: none;
}
body.show-notes section[janus-timeline='present'] + section[janus-timeline='future'] {
transform: scale(0.25);
transform-origin: bottom right;
top: auto;
left: auto;
bottom: 0.4rem;
right: 0.4rem;
opacity: 0.75;
visibility: visible;
outline: 0.2rem solid white;
z-index: 3;
}