New es6 coding standard

* Added babel presets to setup standards
 * set jshint to es6
 * reworked javascript and cerated first two modules
This commit is contained in:
Stephan 2019-04-06 12:31:07 +02:00
parent 3d4eef5eb0
commit 371cb450f8
16 changed files with 1668 additions and 829 deletions

View file

@ -1,189 +1,189 @@
// Root
// -----------------------------------------------------------------------------
html {
// height: 100%;
}
// Sections
// -----------------------------------------------------------------------------
// body
// article
// section
// nav
// aside
// h1-h6
// header
// footer
// Body
// -----------------------------------------------------------------------------
body {
position: relative;
box-sizing: $box_sizing;
margin: 0;
font-family: $family_text_basic;
font-size: $size_text_basic;
line-height: $line_basic;
line-height: $line_text_basic;
color: $color_text_basic;
background-color: $color_back_basic;
*,
::before,
::after {
box-sizing: inherit;
}
&:hover {
.layer_hover {
background-color: transparent !important;
transition: background-color $duration_double $timing_basic 0s !important;
}
}
}
// Article
// -----------------------------------------------------------------------------
article {
}
// Section
// -----------------------------------------------------------------------------
section {
}
.sec_main_center {
width: $width_basic;
margin: 0 auto;
padding-top: $space_small;
@include forTabletPortraitUp {
width: $width_small;
}
@include forTabletLandscapeUp {
width: $width_medium;
}
@include forBigDesktopUp {
width: $width_large;
}
}
.sec_main_status {
border-top-width: $width_border_8;
border-top-style: solid;
border-color: $color_border_basic;
padding-top: $space_small;
}
// Navigation
// -----------------------------------------------------------------------------
nav {
}
// Aside element
// -----------------------------------------------------------------------------
aside {
width: $width_aside_basic;
&.right + .bside {
margin-right: calc(#{$width_aside_basic} + #{$space_basic});
}
&.left + .bside {
margin-left: calc(#{$width_aside_basic} + #{$space_basic});
}
&.right {
float: right;
}
&.left {
float: left;
}
*:first-child {
margin-top: 0;
}
}
// Headings
// -----------------------------------------------------------------------------
h1, h2, h3, h4, h5, h6 {
@extend %head_all;
}
h1 {
@extend %head_1;
margin: $space_large 0 $space_small;
}
h1 + h1 {
margin-top: 0;
}
h2 {
@extend %head_2;
margin: $space_medium 0 $space_small;
}
h2 + h2 {
margin-top: 0;
}
h3 {
@extend %head_3;
margin: $space_double 0;
text-transform: uppercase;
}
h4 {
@extend %head_3;
margin: $space_double 0;
text-transform: none;
}
h5 {
@extend %head_4;
margin: $space_double 0 $space_basic;
text-transform: none;
}
h6 {
@extend %basic;
margin: $space_basic 0;
text-transform: none;
font-weight: bold;
}
// Header
// -----------------------------------------------------------------------------
header {
}
.header_page {
overflow: auto;
}
.header_txt {
margin-bottom: $space_small;
border-bottom: $border_dotted;
h1 {
border-top: $border_basic;
}
}
// Footer
// -----------------------------------------------------------------------------
footer {
}
// Root
// -----------------------------------------------------------------------------
html {
// height: 100%;
}
// Sections
// -----------------------------------------------------------------------------
// body
// article
// section
// nav
// aside
// h1-h6
// header
// footer
// Body
// -----------------------------------------------------------------------------
body {
position: relative;
box-sizing: $box_sizing;
margin: 0;
font-family: $family_text_basic;
font-size: $size_text_basic;
line-height: $line_basic;
line-height: $line_text_basic;
color: $color_text_basic;
background-color: $color_back_basic;
*,
::before,
::after {
box-sizing: inherit;
}
&:hover {
.mouse_over {
background-color: transparent !important;
transition: background-color $duration_double $timing_basic 0s !important;
}
}
}
// Article
// -----------------------------------------------------------------------------
article {
}
// Section
// -----------------------------------------------------------------------------
section {
}
.sec_main_center {
width: $width_basic;
margin: 0 auto;
padding-top: $space_small;
@include forTabletPortraitUp {
width: $width_small;
}
@include forTabletLandscapeUp {
width: $width_medium;
}
@include forBigDesktopUp {
width: $width_large;
}
}
.sec_main_status {
border-top-width: $width_border_8;
border-top-style: solid;
border-color: $color_border_basic;
padding-top: $space_small;
}
// Navigation
// -----------------------------------------------------------------------------
nav {
}
// Aside element
// -----------------------------------------------------------------------------
aside {
width: $width_aside_basic;
&.right + .bside {
margin-right: calc(#{$width_aside_basic} + #{$space_basic});
}
&.left + .bside {
margin-left: calc(#{$width_aside_basic} + #{$space_basic});
}
&.right {
float: right;
}
&.left {
float: left;
}
*:first-child {
margin-top: 0;
}
}
// Headings
// -----------------------------------------------------------------------------
h1, h2, h3, h4, h5, h6 {
@extend %head_all;
}
h1 {
@extend %head_1;
margin: $space_large 0 $space_small;
}
h1 + h1 {
margin-top: 0;
}
h2 {
@extend %head_2;
margin: $space_medium 0 $space_small;
}
h2 + h2 {
margin-top: 0;
}
h3 {
@extend %head_3;
margin: $space_double 0;
text-transform: uppercase;
}
h4 {
@extend %head_3;
margin: $space_double 0;
text-transform: none;
}
h5 {
@extend %head_4;
margin: $space_double 0 $space_basic;
text-transform: none;
}
h6 {
@extend %basic;
margin: $space_basic 0;
text-transform: none;
font-weight: bold;
}
// Header
// -----------------------------------------------------------------------------
header {
}
.header_page {
overflow: auto;
}
.header_txt {
margin-bottom: $space_small;
border-bottom: $border_dotted;
h1 {
border-top: $border_basic;
}
}
// Footer
// -----------------------------------------------------------------------------
footer {
}

View file

@ -1,316 +1,316 @@
// General classes
// -----------------------------------------------------------------------------
%size_content {
box-sizing: content-box;
}
%size_content_solo {
@extend %size_content;
*,
::before,
::after {
box-sizing: $box_sizing;
}
}
%h_content_full {
height: 100%;
body {
min-height: 100%;
}
}
%hidden {
display: none;
}
.magic {
@extend %hidden;
}
.space_even_auto {
margin-right: auto;
margin-left: auto;
}
.space_even_half {
margin-right: 25%;
margin-left: 25%;
}
.space_even_fourth {
margin-right: 37.5%;
margin-left: 37.5%;
}
@each $size, $variable in (basic, #{$space_basic}),
(small, #{$space_small}),
(medium, #{$space_medium}),
(large, #{$space_large}) {
.space_top_#{$size} {
margin-top: $variable;
}
.space_right_#{$size} {
margin-right: $variable;
}
.space_bottom_#{$size} {
margin-bottom: $variable;
}
.space_left_#{$size} {
margin-left: $variable;
}
}
.space_left_fourth {
margin-left: 25%;
}
.width_full {
width: 100%;
margin-right: 0;
margin-left: 0;
}
.width_half {
width: 50%;
margin-right: 0;
margin-left: 0;
}
.width_third {
width: 33.3%;
margin-right: 0;
margin-left: 0;
}
.h_basic {
height: 1024px;
}
.h_full_view {
height: 100vh;
}
.h_100 {
height: 100%;
}
.wrap_center {
& > * {
margin-right: (100% - $width_basic) / 2;
margin-left: (100% - $width_basic) / 2;
@include forTabletPortraitUp {
margin-right: (100% - $width_small) / 2;
margin-left: (100% - $width_small) / 2;
}
@include forTabletLandscapeUp {
margin-right: (100% - $width_medium) / 2;
margin-left: (100% - $width_medium) / 2;
}
@include forBigDesktopUp {
margin-right: (100% - $width_large) / 2;
margin-left: (100% - $width_large) / 2;
}
}
}
// Clearing and floating
// -----------------------------------------------------------------------------
.clear {
clear: both;
&::before,
&::after {
clear: both;
}
}
.overflow {
overflow: auto;
}
.float_left {
float: left;
}
.float_right {
float: right;
}
.float_space_left {
@extend .float_left;
margin-right: $space_small;
}
.float_half_size {
float: left;
width: 50%;
}
.x_long {
overflow-x: scroll;
}
// Inlining
// -----------------------------------------------------------------------------
.inline {
display: inline-block;
}
// Positioned elements
// -----------------------------------------------------------------------------
%viewport_fixed {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
}
%full_parent {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
// width: 100%;
// height: 100%;
}
.pos_abs {
position: absolute;
}
.pos_rel {
position: relative;
}
.pos_fix {
position: fixed;
}
.pin_top {
top: 0;
}
.pin_right {
right: 0;
}
.pin_bottom {
bottom: 0;
}
.pin_left {
left: 0;
}
.pos_full_view {
@extend %viewport_fixed;
background-color: rgba($alpha_color, 0.5);
}
.pos_full_page {
@extend %full_parent;
background-color: rgba($charlie_color, 0.25);
}
.hover_back_change {
background-color: $color_darker;
transition: background-color 0.2s ease-in-out;
&:hover {
background-color: $color_back_basic;
}
}
.hover_full_view_change {
@extend %viewport_fixed;
z-index: $z_heaven;
background-color: transparentize($color_darkest, 0.5);
transition: background-color $duration_long $timing_basic $duration_long;
pointer-events: none;
}
// Colors
// -----------------------------------------------------------------------------
.txt_color_light {
color: $color_brighter;
}
.txt_color_dark {
color: $color_darker;
}
// Text
// -----------------------------------------------------------------------------
.txt_tiny {
font-size: .5em !important;
}
.txt_smaller {
font-size: .75em !important;
}
.txt_larger {
font-size: 1.2em !important;
}
.txt_huge {
font-size: 3em !important;
}
.txt_hero {
font-size: $size_hero;
}
.txt_center {
text-align: center !important;
}
.txt_right {
text-align: right !important;
}
.txt_left {
text-align: left !important;
}
.txt_top {
vertical-align: top !important;
}
.txt_bottom {
vertical-align: bottom !important;
}
.txt_white {
color: white;
}
.txt_black {
color: black;
}
.txt_gradient {
background: linear-gradient(165deg, $alpha_color 30%, $bravo_color 45%, $charlie_color 50%, $delta_color, $echo_color 80%, $foxtrot_color);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
// General classes
// -----------------------------------------------------------------------------
%size_content {
box-sizing: content-box;
}
%size_content_solo {
@extend %size_content;
*,
::before,
::after {
box-sizing: $box_sizing;
}
}
%h_content_full {
height: 100%;
body {
min-height: 100%;
}
}
%hidden {
display: none;
}
.hide {
@extend %hidden;
}
.space_even_auto {
margin-right: auto;
margin-left: auto;
}
.space_even_half {
margin-right: 25%;
margin-left: 25%;
}
.space_even_fourth {
margin-right: 37.5%;
margin-left: 37.5%;
}
@each $size, $variable in (basic, #{$space_basic}),
(small, #{$space_small}),
(medium, #{$space_medium}),
(large, #{$space_large}) {
.space_top_#{$size} {
margin-top: $variable;
}
.space_right_#{$size} {
margin-right: $variable;
}
.space_bottom_#{$size} {
margin-bottom: $variable;
}
.space_left_#{$size} {
margin-left: $variable;
}
}
.space_left_fourth {
margin-left: 25%;
}
.width_full {
width: 100%;
margin-right: 0;
margin-left: 0;
}
.width_half {
width: 50%;
margin-right: 0;
margin-left: 0;
}
.width_third {
width: 33.3%;
margin-right: 0;
margin-left: 0;
}
.h_basic {
height: 1024px;
}
.h_full_view {
height: 100vh;
}
.h_100 {
height: 100%;
}
.wrap_center {
& > * {
margin-right: (100% - $width_basic) / 2;
margin-left: (100% - $width_basic) / 2;
@include forTabletPortraitUp {
margin-right: (100% - $width_small) / 2;
margin-left: (100% - $width_small) / 2;
}
@include forTabletLandscapeUp {
margin-right: (100% - $width_medium) / 2;
margin-left: (100% - $width_medium) / 2;
}
@include forBigDesktopUp {
margin-right: (100% - $width_large) / 2;
margin-left: (100% - $width_large) / 2;
}
}
}
// Clearing and floating
// -----------------------------------------------------------------------------
.clear {
clear: both;
&::before,
&::after {
clear: both;
}
}
.overflow {
overflow: auto;
}
.float_left {
float: left;
}
.float_right {
float: right;
}
.float_space_left {
@extend .float_left;
margin-right: $space_small;
}
.float_half_size {
float: left;
width: 50%;
}
.x_long {
overflow-x: scroll;
}
// Inlining
// -----------------------------------------------------------------------------
.inline {
display: inline-block;
}
// Positioned elements
// -----------------------------------------------------------------------------
%viewport_fixed {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
}
%full_parent {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
// width: 100%;
// height: 100%;
}
.pos_abs {
position: absolute;
}
.pos_rel {
position: relative;
}
.pos_fix {
position: fixed;
}
.pin_top {
top: 0;
}
.pin_right {
right: 0;
}
.pin_bottom {
bottom: 0;
}
.pin_left {
left: 0;
}
.pos_full_view {
@extend %viewport_fixed;
background-color: rgba($alpha_color, 0.5);
}
.pos_full_page {
@extend %full_parent;
background-color: rgba($charlie_color, 0.25);
}
.hover_back_change {
background-color: $color_darker;
transition: background-color 0.2s ease-in-out;
&:hover {
background-color: $color_back_basic;
}
}
.mouse_over {
@extend %viewport_fixed;
z-index: $z_heaven;
background-color: transparentize($color_darkest, 0.5);
transition: background-color $duration_long $timing_basic $duration_long;
pointer-events: none;
}
// Colors
// -----------------------------------------------------------------------------
.txt_color_light {
color: $color_brighter;
}
.txt_color_dark {
color: $color_darker;
}
// Text
// -----------------------------------------------------------------------------
.txt_tiny {
font-size: .5em !important;
}
.txt_smaller {
font-size: .75em !important;
}
.txt_larger {
font-size: 1.2em !important;
}
.txt_huge {
font-size: 3em !important;
}
.txt_hero {
font-size: $size_hero;
}
.txt_center {
text-align: center !important;
}
.txt_right {
text-align: right !important;
}
.txt_left {
text-align: left !important;
}
.txt_top {
vertical-align: top !important;
}
.txt_bottom {
vertical-align: bottom !important;
}
.txt_white {
color: white;
}
.txt_black {
color: black;
}
.txt_gradient {
background: linear-gradient(165deg, $alpha_color 30%, $bravo_color 45%, $charlie_color 50%, $delta_color, $echo_color 80%, $foxtrot_color);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

View file

@ -2,75 +2,75 @@
// ------------------------------------------------------------------------------
.html_card {
@extend %h_content_full;
@extend %h_content_full;
body {
body {
.card_bkg {
@extend %full_parent;
transition-duration: 800ms;
overflow: hidden;
vertical-align: top;
z-index: -1;
.card_bkg {
@extend %full_parent;
transition-duration: 800ms;
overflow: hidden;
vertical-align: top;
z-index: -1;
& > svg {
position: relative;
}
}
& > svg {
position: relative;
}
}
.card_box {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
.card_box {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
* {
font-family: $family_text_card;
// text-align: center;
}
* {
font-family: $family_text_card;
// text-align: center;
}
& > div {
position: relative;
padding: 64px 64px 24px 64px;
border: 1px solid #FFF;
background-color: #F5F5F5;
z-index: 40;
}
}
& > div {
position: relative;
padding: 64px 64px 24px 64px;
border: 1px solid #FFF;
background-color: #F5F5F5;
z-index: 40;
}
}
h1 {
margin: 16px 0;
color: #1E1E1E;
font-size: 24px;
line-height: 1.4em;
font-weight: normal;
}
h1 {
margin: 16px 0;
color: #1E1E1E;
font-size: 24px;
line-height: 1.4em;
font-weight: normal;
}
p {
margin-top: 0;
margin-bottom: 16px;
font-size: 12px;
line-height: 1.4em;
}
p {
margin-top: 0;
margin-bottom: 16px;
font-size: 12px;
line-height: 1.4em;
}
.marked {
// padding-left: 1em;
// text-indent: -1em;
.marked {
// padding-left: 1em;
// text-indent: -1em;
&::before { content: "*\0000a0" }
}
&::before { content: "*\0000a0" }
}
.decent { color: #666 }
.decent { color: #666 }
a {
color: #000;
text-decoration: none;
a {
color: #000;
text-decoration: none;
&:hover {
color: #F4F9FA;
background-color: #0C85FF;
text-decoration: none;
}
}
}
&:hover {
color: #F4F9FA;
background-color: #0C85FF;
text-decoration: none;
}
}
}
}

View file

@ -1,115 +1,120 @@
// Custom extends and mixins
// ------------------------------------------------------------------------------
@import "mixins";
@import "extends";
// Explanation module styles
// ------------------------------------------------------------------------------
%expose_after {
&::after {
content: "";
display: block;
height: 48px;
background-color: rgba($delta_color, 0.1) !important;
}
}
%expose_before {
&::before {
content: "";
display: block;
height: 48px;
background-color: rgba($delta_color, 0.1) !important;
}
}
%expose {
&::before, &::after {
content: "";
display: block;
height: 48px;
background-color: rgba($delta_color, 0.1) !important;
}
}
%exp {
}
%exp_hidden {
display: none;
}
.exp_wrap {
position: relative;
}
.exp_pop {
@extend %exp_hidden !optional;
position: absolute;
z-index: 100;
top: $space_large;
left: $space_large;
padding: $space_half;
border: 4px solid $color_back_basic;
border-radius: 4px;
background-color: $color_back_basic;
pointer-events: none;
}
.exp_marker_pop {
position: absolute;
top: -$size_text_basic / 4 * 3;
right: -$size_text_basic / 2;
width: $size_text_basic;
height: $size_text_basic;
border: $space_tiny solid $color_highlight_basic;
border-radius: $size_text_basic;
color: $color_highlight_basic;
background-color: $color_darkest;
}
.exp_expose {
@extend %expose !optional;
}
.exp_expose_pre {
@extend %expose_after;
}
.exp_expose_post {
@extend %expose_before;
}
.exp_overlay_btn {
position: fixed;
width: 3em;
height: 2em;
// padding: $space_basic $space_basic * 2;
cursor: pointer;
}
.exp_help_btn {
display: table;
right: $space_double;
bottom: $space_double;
background-color: rgba($color_darkest, 0.4);
&:hover {
background-color: $color_brightest;
> .span_solo {
color: $color_darkest;
}
}
.span_solo {
display: table-cell;
color: rgba($color_brightest, 0.8);
font-family: $family_text_mono;
font-size: 1.4em;
text-align: center;
vertical-align: middle;
}
}
.expose_height {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba($delta_color, 0.1) !important;
@include vendor-prefix(transition, height 0.5s ease);
}
// Custom extends and mixins
// ------------------------------------------------------------------------------
@import "mixins";
@import "extends";
// Explanation module styles
// ------------------------------------------------------------------------------
%expose_after {
&::after {
content: "";
display: block;
height: 48px;
background-color: rgba($delta_color, 0.1) !important;
}
}
%expose_before {
&::before {
content: "";
display: block;
height: 48px;
background-color: rgba($delta_color, 0.1) !important;
}
}
%expose {
&::before, &::after {
content: "";
display: block;
height: 48px;
background-color: rgba($delta_color, 0.1) !important;
}
}
%exp {
}
%exp_hidden {
display: none;
}
.exp_wrap {
position: relative;
}
.exp_overlay {
@extend %full_parent;
background-color: transparentize($alpha_color, .6);
}
.exp_pop {
@extend %exp_hidden !optional;
position: absolute;
z-index: 100;
top: $space_large;
left: $space_large;
padding: $space_half;
border: 4px solid $color_back_basic;
border-radius: 4px;
background-color: $color_back_basic;
pointer-events: none;
}
.exp_marker_pop {
position: absolute;
top: -$size_text_basic / 4 * 3;
right: -$size_text_basic / 2;
width: $size_text_basic;
height: $size_text_basic;
border: $space_tiny solid $color_highlight_basic;
border-radius: $size_text_basic;
color: $color_highlight_basic;
background-color: $color_darkest;
}
.exp_expose {
@extend %expose !optional;
}
.exp_expose_pre {
@extend %expose_after;
}
.exp_expose_post {
@extend %expose_before;
}
.exp_overlay_btn {
position: fixed;
width: 3em;
height: 2em;
// padding: $space_basic $space_basic * 2;
cursor: pointer;
}
.exp_help_btn {
display: table;
right: $space_double;
bottom: $space_double;
background-color: rgba($color_darkest, 0.4);
&:hover {
background-color: $color_brightest;
> .span_solo {
color: $color_darkest;
}
}
.span_solo {
display: table-cell;
color: rgba($color_brightest, 0.8);
font-family: $family_text_mono;
font-size: 1.4em;
text-align: center;
vertical-align: middle;
}
}
.expose_height {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba($delta_color, 0.1) !important;
@include vendor-prefix(transition, height 0.5s ease);
}