exiguus/js.randext

View on GitHub
example/static/css/style.css

Summary

Maintainability
Test Coverage
/**
 * Device Selector Example
 *  Simon Gattner 2018
 *
**/

@keyframes fadeInBody {
  0% {
    background-color: #FFFFFF;
    opacity: 0;
  }
  100% {
    background-color: #ff7070;
    opacity: 1;
  }
}

@keyframes fadeInBoxShadow {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "DejaVu Sans Mono", monospace;
  font-size: 16px;
  color: #f1fff0;
  background-color: #ff7070;
  animation: fadeInBody .6s ease-in;
}

header {
  padding: 4em 1em 2em 1em;
}

header h1 {
  width: 100%;
  font-size: 2em;
  margin-bottom: .6em;
  width: 100%;
  overflow: hidden;
  white-space: pre-line;
}

header h2 {
  font-size: 1em;
  font-weight: normal;
  padding-bottom: .8em;
  margin-bottom: 2vw;
  border-bottom: 2px solid #f1fff0;
}

header p {
  display: block;
  unicode-bidi: embed;
  font-family: monospace;
  font-weight: normal;
  font-size: .9em;
  white-space: pre;
  overflow: hidden;
}

header pre {
  min-width: 640px;
}

header section {
  width: 100%;
  margin-bottom: 0;
}

footer {
  margin: 0 1em;
  padding: 2em 0;
  border-top: 2px solid #f1fff0;
}

footer .logo .javascript {
  height: 1em;
}

footer {
  padding: 1em 0;
  margin-bottom: 1rem;
}

footer::after {
  content: " ";
  clear: both;
  display: block;
  visibility: hidden;
  height: 0px;
}

footer p {
  display: block;
  float: right;
  max-width: 33.333%
}

footer p a {
  margin-right: 0;
  letter-spacing: 0.2em;
  vertical-align: -.1em;
  text-decoration: none;
}

footer ul {
  display: block;
  float: left;
  margin-left: -.5em;
  max-width: 66.666%;
}

footer ul li {
  display: inline-block;
  margin-right: .4em;
  list-style: none;
}

footer ul li a {
  display: block;
  padding: .2em .4em;
}

footer .logo {
  vertical-align: -.2em;
}

footer .logo + [data-randext-async] {
  display: inline;
}

main {
  display: block;
  padding: 0 1em 2em 1em;
}

main pre {
  position: relative;
  padding: 2em 2em 3em;
  font-size: .9em;
  color: #ff7070;
  background-color: rgba(255, 255, 255, .2);
  overflow-x: auto;
  opacity: .8;
  animation: fadeInBoxShadow 1s linear;
  transition: all 1s ease-out;
}

main pre code {
  padding: 1em 3em !important;
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, .2) !important;
}

main pre::after {
  content: "</code>";
  position: absolute;
  right: 1em;
  bottom: 1em;
  font-size: 1em;
}

main pre.inline {
  border-bottom: 2px solid #f1fff0;
  font-size: 110%;
}

main section {
  margin-bottom: 1em;
}

main section:first-child {
  margin-bottom: 6em;
}

main section:not(:last-child):not(:first-child),
header section {
  border-bottom: 1px solid #f1fff0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:visited {
  color: inherit;
  text-decoration: none;
}

a:hover, a:active, a:focus {
  color: inherit;
  text-decoration: underline;
}

h1, h2, h3, h4, p {
  margin-bottom: 1em;
}

dl, main pre {
  margin-bottom: 4em;
}

dl::after {
  content: ' ';
  display: table;
  width: 1px;
  height: 1px;
  clear: left;
}

dt, dd {
  float: left;
  margin-bottom: .5em;
  line-height: 2em;
  min-width: 160px;
}

dd+dt {
  clear: left;
}

dd {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

dd code {
  display: inline-block;
  padding: 0 .4em;
  margin-left: 1em;
  min-width: 160px;
  font-size: 100%;
  border-left: 1px solid #f1fff0;
}

dl.install {
  background-color: rgba(255, 255, 255, .2);
  padding: 2em 4em 2em 1.5em;
  margin: 0 0 2em 0;
}

dl.install dd code {
  background-color: rgba(255, 255, 255, .2);
  padding: 2em 4em 2em 1.5em;
  margin: 0;
}

[data-randext] {
  display: block;
  margin-bottom: 1em;
  unicode-bidi: embed;
  font-family: inherit;
  font-size: 1em;
  letter-spacing: .064em;
  line-height: 1.875em;
  white-space: pre-line;
  width: 100%;
  color: inherit;
}

p>[data-randext],
code>[data-randext],
h1>[data-randext],
h2>[data-randext] {
  display: inline;
}

h1>[data-randext],
h2>[data-randext] {
  font-size: 1em;
  font-weight: normal;
  margin-bottom: 0;
}

.hljs {
  background: transparent;

}

@media only screen and (min-width: 860px) {
  main {
    padding: 0 4em 2em 4em;
  }
  header {
    display: flex;
    flex-flow: row-reverse nowrap;
    height: 100%;
    padding: 4em 4em 2em 4em;
  }

  header section h1 {
    padding-top: 2vw;
  }

  footer {
    margin: 0 4em;
  }
}

[data-randext] {
  opacity: 0;
}

[data-randext="true"] {
  opacity: 1;
}

[data-randext-char] {
  display: inline-block;
  width: .65em;
  height: 1.66em;
  font-size: inherit;
  font-family: inherit;
  letter-spacing: inherit;
  line-height: 1.6em;
  vertical-align: middle;
}

[data-randext-line] {
  color: red;
}

[data-randext-line]:before {
  content: " ";
  display: table-cell;
  width: 1em;
  height: 1em;
}

[data-randext-char-active="true"] {
  font-weight: bold;
  opacity: 1;
}