q5.js
Version:
[q5 fork] p5.js small & fast alternative (experimental) implementation.
160 lines (141 loc) • 3.79 kB
text/less
:root {
--color-bg: #fff;
--color-fg: #333;
--color-alpha : #09c;
}
html {
line-height: 1;
text-size-adjust: 100%;
box-sizing: border-box;
font-size: 62.5%;
tab-size: 4;
cursor: default;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
font-size: 1.6em;
line-height: 1.4;
background: var(--color-bg);
color: var(--color-fg);
margin: 0 auto;
padding: 2rem;
max-width: 64rem;
}
*, *:before, *:after {
box-sizing: inherit;
background-repeat: no-repeat;
}
a {
color: var(--color-alpha);
text-decoration: none;
background-color: transparent;
border-bottom: dotted var(--color-alpha) 1px;
&:hover {
border-bottom: solid var(--color-fg) 1px;
}
}
header {
h1 { margin: 0; }
p { margin: 0; }
margin: 0 0 2rem;
}
nav {
border-bottom: dotted #999 1px;
padding: 0 0 2rem;
margin: 0 0 2rem;
display: flex;
flex-wrap: wrap;
width: 100%;
justify-content: space-between;
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
font: inherit;
color: inherit;
margin: 0;
padding: .4rem 1rem;
text-transform: none;
background: #fff;
border: solid #999 1px;
border-radius: .3rem;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E %3Cpath fill='none' stroke='%234c5e88' stroke-linecap='square' stroke-width='10' d='M10 10l20 20 20-20'/%3E %3C/svg%3E");
background-repeat: no-repeat;
background-position: center right 1rem;
background-size: 12px auto;
text-transform: capitalize;
}
input {
font: inherit;
color: inherit;
margin: 0;
padding: .4rem 1rem;
text-transform: none;
background: #fff;
border: solid #999 1px;
border-radius: .3rem;
option { text-transform: capitalize; }
}
}
main {
.hidden {
display: none;
}
#index {
ul {
padding: 0;
margin: 0 auto;
display: grid;
gap: .5rem;
@media (min-width: 20rem) {
grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 36rem) {
grid-template-columns: repeat(3, 1fr);
}
> li {
list-style: inside disc;
text-transform: capitalize;
}
}
}
#content {
h2 {
margin: 0 0 1rem;
text-transform: capitalize;
}
figure {
display:inline-block;
padding: 2rem;
margin: 0 1rem 0 0;
border: dotted .1rem var(--color-fg);
border-radius: .3rem;
iframe {
width: 10rem;
height: 10rem;
border: none;
}
figcaption {
font-size: 80%;
}
}
pre {
background: var(--color-fg);
color: var(--color-bg);
margin: 2rem 0;
padding: 2rem;
border-radius: .3rem;
overflow-x: scroll;
.comm {
color: #999;
}
strong {
color: var(--color-alpha);
}
}
}
}
::-webkit-scrollbar { width: .5rem; } // Width
::-webkit-scrollbar-track { background: none; } // Track
::-webkit-scrollbar-thumb { background: gainsboro; } // Handle
::-webkit-scrollbar-thumb:hover { background: gainsboro; } // Handle on hover