Animationen hinzugefügt

This commit is contained in:
silas 2018-09-21 17:09:02 +02:00
parent e83d0f8544
commit 2c3775308f
14 changed files with 630 additions and 664 deletions

View File

@ -5,8 +5,7 @@
* Licensed under MIT Open Source * Licensed under MIT Open Source
*/ */
.top-bar-title { .top-bar-title {
white-space: nowrap; white-space: nowrap; }
}
#action-bar .close-listener { #action-bar .close-listener {
position: fixed; position: fixed;
@ -15,197 +14,136 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
background: transparent; background: transparent;
z-index: 9000; z-index: 9000; }
}
#action-bar #responsive-menu .top-bar-right { #action-bar #responsive-menu .top-bar-right {
position: relative; position: relative;
text-align: right; text-align: right;
width: 100%; width: 100%; }
}
#action-bar .top-bar-right { #action-bar .top-bar-right {
width: auto; width: auto; }
} #action-bar .top-bar-right .menu.action-bar a img + span {
#action-bar .top-bar-right .menu.action-bar a img + span { display: none; }
display: none; #action-bar .top-bar-right .menu.action-bar .action {
} position: relative;
#action-bar .top-bar-right .menu.action-bar .action { z-index: 9000; }
position: relative; #action-bar .top-bar-right .menu.action-bar .action.is-dropdown-submenu-parent {
z-index: 9000; z-index: 9001; }
} #action-bar .top-bar-right .menu.action-bar .action.hidden {
#action-bar .top-bar-right .menu.action-bar .action.is-dropdown-submenu-parent { display: none; }
z-index: 9001; @media screen and (max-width: 24.9375em) {
} #action-bar .top-bar-right .menu.action-bar .action.smedium {
#action-bar .top-bar-right .menu.action-bar .action.hidden { display: none; } }
display: none; @media screen and (max-width: 39.9375em) {
} #action-bar .top-bar-right .menu.action-bar .action li {
@media screen and (max-width: 24.9375em) { display: table-cell; }
#action-bar .top-bar-right .menu.action-bar .action.smedium { #action-bar .top-bar-right .menu.action-bar .action.medium {
display: none; display: none; } }
} @media screen and (max-width: 63.9375em) {
} #action-bar .top-bar-right .menu.action-bar .action.large {
@media screen and (max-width: 39.9375em) { display: none; } }
#action-bar .top-bar-right .menu.action-bar .action li { #action-bar .top-bar-right .menu.action-bar .action.never {
display: table-cell; display: none; }
} #action-bar .top-bar-right .menu.action-bar.hidden {
#action-bar .top-bar-right .menu.action-bar .action.medium { display: inline-block;
display: none; position: absolute;
} z-index: 9000;
} border: 1px solid #cacaca;
@media screen and (max-width: 63.9375em) { padding: 0.2rem;
#action-bar .top-bar-right .menu.action-bar .action.large { transform: translateX(-100%);
display: none; text-align: left; }
} #action-bar .top-bar-right .menu.action-bar.hidden .action.hidden {
} display: none; }
#action-bar .top-bar-right .menu.action-bar .action.never { #action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent {
display: none; z-index: 9001; }
} #action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent ul.is-dropdown-submenu {
#action-bar .top-bar-right .menu.action-bar.hidden { top: auto; }
display: inline-block; #action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent ul.is-dropdown-submenu > li.action, #action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent ul.is-dropdown-submenu > .close-listener {
position: absolute; z-index: 9001; }
z-index: 9000; #action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent > a:after {
border: 1px solid #cacaca; display: block;
padding: 0.2rem; width: 0;
transform: translateX(-100%); height: 0;
text-align: left; border: 6px inset;
} content: "";
#action-bar .top-bar-right .menu.action-bar.hidden .action.hidden { border-bottom-width: 0;
display: none; border-top-style: solid;
} border-color: #ffffff transparent transparent;
#action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent { right: 5px;
z-index: 9001; left: auto;
} margin-top: -3px; }
#action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent ul.is-dropdown-submenu { #action-bar .top-bar-right .menu.action-bar.hidden .action a {
top: auto; white-space: nowrap; }
} #action-bar .top-bar-right .menu.action-bar.hidden .action a img {
#action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent ul.is-dropdown-submenu > li.action, #action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent ul.is-dropdown-submenu > .close-listener { display: none; }
z-index: 9001; #action-bar .top-bar-right .menu.action-bar.hidden .action a img + span {
} display: inherit; }
#action-bar .top-bar-right .menu.action-bar.hidden .action.is-dropdown-submenu-parent > a:after { @media print, screen and (min-width: 40em) {
display: block; #action-bar .top-bar-right .menu.action-bar.hidden .action.medium {
width: 0; display: none; } }
height: 0; @media print, screen and (min-width: 25em) {
border: 6px inset; #action-bar .top-bar-right .menu.action-bar.hidden .action.smedium {
content: ""; display: none; } }
border-bottom-width: 0; @media print, screen and (min-width: 64em) {
border-top-style: solid; #action-bar .top-bar-right .menu.action-bar.hidden .action.large {
border-color: #ffffff transparent transparent; display: none; } }
right: 5px; @media screen and (max-width: 24.9375em) {
left: auto; #action-bar .top-bar-right .menu.action-bar.hidden .action.smedium {
margin-top: -3px; display: block; }
} #action-bar .top-bar-right .menu.action-bar.hidden .action.smedium.hidden {
#action-bar .top-bar-right .menu.action-bar.hidden .action a { display: none; } }
white-space: nowrap; @media screen and (max-width: 39.9375em) {
} #action-bar .top-bar-right .menu.action-bar.hidden .action.medium {
#action-bar .top-bar-right .menu.action-bar.hidden .action a img { display: block; }
display: none; #action-bar .top-bar-right .menu.action-bar.hidden .action.medium.hidden {
} display: none; } }
#action-bar .top-bar-right .menu.action-bar.hidden .action a img + span { @media screen and (max-width: 63.9375em) {
display: inherit; #action-bar .top-bar-right .menu.action-bar.hidden .action.large {
} display: block; }
@media print, screen and (min-width: 40em) { #action-bar .top-bar-right .menu.action-bar.hidden .action.large.hidden {
#action-bar .top-bar-right .menu.action-bar.hidden .action.medium { display: none; } }
display: none; #action-bar .top-bar-right .menu.action-bar.hidden .action.never {
} display: block; }
} #action-bar .top-bar-right .menu.action-bar.hidden .action.never.hidden {
@media print, screen and (min-width: 25em) { display: none; }
#action-bar .top-bar-right .menu.action-bar.hidden .action.smedium { #action-bar .top-bar-right .menu.action-bar.hidden .action.always {
display: none; display: none; }
} #action-bar .top-bar-right .menu .action {
} z-index: 100; }
@media print, screen and (min-width: 64em) { @media screen and (max-width: 39.9375em) {
#action-bar .top-bar-right .menu.action-bar.hidden .action.large { #action-bar .top-bar-right .menu .action a {
display: none; width: 100%; } }
} @media screen and (max-width: 39.9375em) {
} #action-bar .top-bar-right .menu .action a {
@media screen and (max-width: 24.9375em) { padding-left: 0.68rem; } }
#action-bar .top-bar-right .menu.action-bar.hidden .action.smedium { @media screen and (max-width: 24.9375em) {
display: block; #action-bar .top-bar-right .menu .action a {
} padding-left: 0.236rem; } }
#action-bar .top-bar-right .menu.action-bar.hidden .action.smedium.hidden { @media screen and (max-width: 39.9375em) {
display: none; #action-bar .top-bar-right .menu .action:not(.is-dropdown-submenu-parent) a {
} padding-right: 0.68rem; } }
} @media screen and (max-width: 24.9375em) {
@media screen and (max-width: 39.9375em) { #action-bar .top-bar-right .menu .action:not(.is-dropdown-submenu-parent) a {
#action-bar .top-bar-right .menu.action-bar.hidden .action.medium { padding-right: 0.236rem; } }
display: block; #action-bar .top-bar-right .menu .action.img a {
} padding-top: 0; }
#action-bar .top-bar-right .menu.action-bar.hidden .action.medium.hidden { #action-bar .top-bar-right .menu .action.img a img {
display: none; vertical-align: inherit;
} max-height: 1.4rem; }
} #action-bar .top-bar-right .menu > li > ul.is-dropdown-submenu {
@media screen and (max-width: 63.9375em) { min-width: 0; }
#action-bar .top-bar-right .menu.action-bar.hidden .action.large { #action-bar .top-bar-right .menu > li > ul.is-dropdown-submenu .action {
display: block; display: inherit; }
} #action-bar .top-bar-right .menu > li.opens-right > ul.is-dropdown-submenu {
#action-bar .top-bar-right .menu.action-bar.hidden .action.large.hidden { right: auto;
display: none; left: auto; }
} #action-bar .top-bar-right .menu > li.opens-right > ul.is-dropdown-submenu a {
} text-align: left; }
#action-bar .top-bar-right .menu.action-bar.hidden .action.never {
display: block;
}
#action-bar .top-bar-right .menu.action-bar.hidden .action.never.hidden {
display: none;
}
#action-bar .top-bar-right .menu.action-bar.hidden .action.always {
display: none;
}
#action-bar .top-bar-right .menu .action {
z-index: 100;
}
@media screen and (max-width: 39.9375em) {
#action-bar .top-bar-right .menu .action a {
width: 100%;
}
}
@media screen and (max-width: 39.9375em) {
#action-bar .top-bar-right .menu .action a {
padding-left: 0.68rem;
}
}
@media screen and (max-width: 24.9375em) {
#action-bar .top-bar-right .menu .action a {
padding-left: 0.236rem;
}
}
@media screen and (max-width: 39.9375em) {
#action-bar .top-bar-right .menu .action:not(.is-dropdown-submenu-parent) a {
padding-right: 0.68rem;
}
}
@media screen and (max-width: 24.9375em) {
#action-bar .top-bar-right .menu .action:not(.is-dropdown-submenu-parent) a {
padding-right: 0.236rem;
}
}
#action-bar .top-bar-right .menu .action.img a {
padding-top: 0;
}
#action-bar .top-bar-right .menu .action.img a img {
vertical-align: inherit;
max-height: 1.4rem;
}
#action-bar .top-bar-right .menu > li > ul.is-dropdown-submenu {
min-width: 0;
}
#action-bar .top-bar-right .menu > li > ul.is-dropdown-submenu .action {
display: inherit;
}
#action-bar .top-bar-right .menu > li.opens-right > ul.is-dropdown-submenu {
right: auto;
left: auto;
}
#action-bar .top-bar-right .menu > li.opens-right > ul.is-dropdown-submenu a {
text-align: left;
}
.dropdown.menu > li.is-dropdown-submenu-parent > a:after { .dropdown.menu > li.is-dropdown-submenu-parent > a:after {
border-color: #ffffff transparent transparent; border-color: #ffffff transparent transparent; }
}
form { form {
position: relative; position: relative; }
}
.sending .sending-loader { .sending .sending-loader {
position: absolute; position: absolute;
@ -219,103 +157,83 @@ form {
bottom: 0; bottom: 0;
right: 0; right: 0;
z-index: 10; z-index: 10;
border-radius: 2px; border-radius: 2px; }
} .sending .sending-loader .loader {
.sending .sending-loader .loader { position: absolute; }
position: absolute;
}
.sending-loader { .sending-loader {
display: none; display: none; }
}
input.notEmpty:invalid { input.notEmpty:invalid {
background-color: lightcoral; background-color: lightcoral; }
}
label { label {
position: relative; position: relative; }
} label [type='text'], label [type='password'], label [type='date'], label [type='datetime'], label [type='datetime-local'], label [type='month'], label [type='week'], label [type='email'], label [type='number'], label [type='search'], label [type='tel'], label [type='time'], label [type='url'], label [type='color'], label textarea, label input[type=text], label input:not([type]) {
label [type=text], label [type=password], label [type=date], label [type=datetime], label [type=datetime-local], label [type=month], label [type=week], label [type=email], label [type=number], label [type=search], label [type=tel], label [type=time], label [type=url], label [type=color], label textarea, label input[type=text], label input:not([type]) { display: block;
display: block; width: 100%;
width: 100%; height: 2.4375rem;
height: 2.4375rem; margin: 0 0 1rem;
margin: 0 0 1rem; padding: 0.5rem;
padding: 0.5rem; box-shadow: none !important;
box-shadow: none !important; font-size: 1rem;
font-size: 1rem; font-weight: normal;
font-weight: normal; line-height: 1.5;
line-height: 1.5; border: none;
border: none; border-bottom: solid black;
border-bottom: solid black; outline: 0;
outline: 0; margin-bottom: 15px; }
margin-bottom: 15px; label [type='text']:focus, label [type='password']:focus, label [type='date']:focus, label [type='datetime']:focus, label [type='datetime-local']:focus, label [type='month']:focus, label [type='week']:focus, label [type='email']:focus, label [type='number']:focus, label [type='search']:focus, label [type='tel']:focus, label [type='time']:focus, label [type='url']:focus, label [type='color']:focus, label textarea:focus, label input[type=text]:focus, label input:not([type]):focus {
} border: none;
label [type=text]:focus, label [type=password]:focus, label [type=date]:focus, label [type=datetime]:focus, label [type=datetime-local]:focus, label [type=month]:focus, label [type=week]:focus, label [type=email]:focus, label [type=number]:focus, label [type=search]:focus, label [type=tel]:focus, label [type=time]:focus, label [type=url]:focus, label [type=color]:focus, label textarea:focus, label input[type=text]:focus, label input:not([type]):focus { box-shadow: none !important;
border: none; border-bottom: solid black; }
box-shadow: none !important; label [type='text']:focus ~ span, label [type='text'].notEmpty:not(:focus) ~ span, label [type='password']:focus ~ span, label [type='password'].notEmpty:not(:focus) ~ span, label [type='date']:focus ~ span, label [type='date'].notEmpty:not(:focus) ~ span, label [type='datetime']:focus ~ span, label [type='datetime'].notEmpty:not(:focus) ~ span, label [type='datetime-local']:focus ~ span, label [type='datetime-local'].notEmpty:not(:focus) ~ span, label [type='month']:focus ~ span, label [type='month'].notEmpty:not(:focus) ~ span, label [type='week']:focus ~ span, label [type='week'].notEmpty:not(:focus) ~ span, label [type='email']:focus ~ span, label [type='email'].notEmpty:not(:focus) ~ span, label [type='number']:focus ~ span, label [type='number'].notEmpty:not(:focus) ~ span, label [type='search']:focus ~ span, label [type='search'].notEmpty:not(:focus) ~ span, label [type='tel']:focus ~ span, label [type='tel'].notEmpty:not(:focus) ~ span, label [type='time']:focus ~ span, label [type='time'].notEmpty:not(:focus) ~ span, label [type='url']:focus ~ span, label [type='url'].notEmpty:not(:focus) ~ span, label [type='color']:focus ~ span, label [type='color'].notEmpty:not(:focus) ~ span, label textarea:focus ~ span, label textarea.notEmpty:not(:focus) ~ span, label input[type=text]:focus ~ span, label input[type=text].notEmpty:not(:focus) ~ span, label input:not([type]):focus ~ span, label input:not([type]).notEmpty:not(:focus) ~ span {
border-bottom: solid black; top: -11px;
} left: 0;
label [type=text]:focus ~ span, label [type=text].notEmpty:not(:focus) ~ span, label [type=password]:focus ~ span, label [type=password].notEmpty:not(:focus) ~ span, label [type=date]:focus ~ span, label [type=date].notEmpty:not(:focus) ~ span, label [type=datetime]:focus ~ span, label [type=datetime].notEmpty:not(:focus) ~ span, label [type=datetime-local]:focus ~ span, label [type=datetime-local].notEmpty:not(:focus) ~ span, label [type=month]:focus ~ span, label [type=month].notEmpty:not(:focus) ~ span, label [type=week]:focus ~ span, label [type=week].notEmpty:not(:focus) ~ span, label [type=email]:focus ~ span, label [type=email].notEmpty:not(:focus) ~ span, label [type=number]:focus ~ span, label [type=number].notEmpty:not(:focus) ~ span, label [type=search]:focus ~ span, label [type=search].notEmpty:not(:focus) ~ span, label [type=tel]:focus ~ span, label [type=tel].notEmpty:not(:focus) ~ span, label [type=time]:focus ~ span, label [type=time].notEmpty:not(:focus) ~ span, label [type=url]:focus ~ span, label [type=url].notEmpty:not(:focus) ~ span, label [type=color]:focus ~ span, label [type=color].notEmpty:not(:focus) ~ span, label textarea:focus ~ span, label textarea.notEmpty:not(:focus) ~ span, label input[type=text]:focus ~ span, label input[type=text].notEmpty:not(:focus) ~ span, label input:not([type]):focus ~ span, label input:not([type]).notEmpty:not(:focus) ~ span { bottom: 0;
top: -11px; font-size: 11px;
left: 0; opacity: 1;
bottom: 0; color: black; }
font-size: 11px; label [type='text'] ~ span, label [type='password'] ~ span, label [type='date'] ~ span, label [type='datetime'] ~ span, label [type='datetime-local'] ~ span, label [type='month'] ~ span, label [type='week'] ~ span, label [type='email'] ~ span, label [type='number'] ~ span, label [type='search'] ~ span, label [type='tel'] ~ span, label [type='time'] ~ span, label [type='url'] ~ span, label [type='color'] ~ span, label textarea ~ span, label input[type=text] ~ span, label input:not([type]) ~ span {
opacity: 1; position: absolute;
color: black; pointer-events: none;
} left: 10px;
label [type=text] ~ span, label [type=password] ~ span, label [type=date] ~ span, label [type=datetime] ~ span, label [type=datetime-local] ~ span, label [type=month] ~ span, label [type=week] ~ span, label [type=email] ~ span, label [type=number] ~ span, label [type=search] ~ span, label [type=tel] ~ span, label [type=time] ~ span, label [type=url] ~ span, label [type=color] ~ span, label textarea ~ span, label input[type=text] ~ span, label input:not([type]) ~ span { bottom: 10px;
position: absolute; top: 7px;
pointer-events: none; transition: 0.2s ease all;
left: 10px; color: #626262; }
bottom: 10px;
top: 7px;
transition: 0.2s ease all;
color: #626262;
}
.listjs { .listjs {
position: relative; position: relative; }
} .listjs label {
.listjs label { display: inline-block; }
display: inline-block; .listjs label input {
} margin-bottom: 0; }
.listjs label input { .listjs table {
margin-bottom: 0; border-collapse: collapse; }
} .listjs table thead tr th, .listjs table tfoot tr th {
.listjs table { text-align: left; }
border-collapse: collapse; .listjs table thead tr th.sort, .listjs table tfoot tr th.sort {
} cursor: pointer; }
.listjs table thead tr th, .listjs table tfoot tr th { .listjs table tbody.list tr:first-child td {
text-align: left; border-top: solid 1px #696969; }
} .listjs table tbody.list tr:last-child td {
.listjs table thead tr th.sort, .listjs table tfoot tr th.sort { border-bottom: solid 1px #696969; }
cursor: pointer; .listjs table tbody.list tr td {
} border-top: solid 1px #c8c8c8;
.listjs table tbody.list tr:first-child td { padding: 0.3rem; }
border-top: solid 1px #696969; .listjs ul.pagination {
} float: right;
.listjs table tbody.list tr:last-child td { display: inline-block;
border-bottom: solid 1px #696969; margin: 0; }
} .listjs ul.pagination li {
.listjs table tbody.list tr td { display: inline-block;
border-top: solid 1px #c8c8c8; padding-left: 5px;
padding: 0.3rem; padding-right: 5px;
} text-decoration: underline; }
.listjs ul.pagination { .listjs ul.pagination li.active, .listjs ul.pagination li.disabled {
float: right; text-decoration: none; }
display: inline-block;
margin: 0;
}
.listjs ul.pagination li {
display: inline-block;
padding-left: 5px;
padding-right: 5px;
text-decoration: underline;
}
.listjs ul.pagination li.active, .listjs ul.pagination li.disabled {
text-decoration: none;
}
/** /**
* Foundation for Sites by ZURB * Foundation for Sites by ZURB
* Version 6.4.3 * Version 6.4.3
@ -323,21 +241,18 @@ label [type=text] ~ span, label [type=password] ~ span, label [type=date] ~ span
* Licensed under MIT Open Source * Licensed under MIT Open Source
*/ */
*, :after, :before { *, :after, :before {
box-sizing: inherit; box-sizing: inherit; }
}
html { html {
min-height: 100%; min-height: 100%;
width: 100%; width: 100%;
height: 100%; height: 100%;
font-size: 18px; font-size: 18px;
letter-spacing: 1px; letter-spacing: 1px; }
}
.max-height { .max-height {
height: 100%; height: 100%;
min-height: 100%; min-height: 100%; }
}
body { body {
margin: 0; margin: 0;
@ -350,19 +265,16 @@ body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #fefefe; background: #fefefe;
color: #0a0a0a; color: #0a0a0a; }
}
footer { footer {
border-top: #d8d8d8 solid 1px; border-top: #d8d8d8 solid 1px;
text-align: center; text-align: center; }
}
.top-bar .top-bar-title strong { .top-bar .top-bar-title strong {
vertical-align: middle; vertical-align: middle;
display: inline-block; display: inline-block;
/*margin-left: 8px;*/ /*margin-left: 8px;*/ }
}
nav.top-bar { nav.top-bar {
color: #FFF; color: #FFF;
@ -370,52 +282,40 @@ nav.top-bar {
font-size: 20px; font-size: 20px;
box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 2px 9px 1px rgba(0, 0, 0, 0.12), 0 4px 2px -2px rgba(0, 0, 0, 0.2); box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 2px 9px 1px rgba(0, 0, 0, 0.12), 0 4px 2px -2px rgba(0, 0, 0, 0.2);
padding: 0.6rem; padding: 0.6rem;
display: block; display: block; }
}
.top-bar ul { .top-bar ul {
background: red !important; background: red !important; }
}
button.button, a.button { button.button, a.button {
border-radius: 2px; border-radius: 2px;
background-color: red; background-color: red; }
} button.button.disabled, button.button.disabled:hover, button.button.disabled:focus, a.button.disabled, a.button.disabled:hover, a.button.disabled:focus {
button.button.disabled, button.button.disabled:hover, button.button.disabled:focus, a.button.disabled, a.button.disabled:hover, a.button.disabled:focus { background-color: red; }
background-color: red; button.button:focus, button.button:hover, a.button:focus, a.button:hover {
} background-color: #e00000; }
button.button:focus, button.button:hover, a.button:focus, a.button:hover {
background-color: #e00000;
}
.fill-me { .fill-me {
display: flex; display: flex;
flex-direction: column; flex-direction: column; }
} .fill-me.vertical {
.fill-me.vertical { flex-direction: row; }
flex-direction: row; .fill-me .grow {
} flex: 1; }
.fill-me .grow {
flex: 1;
}
.flex-center { .flex-center {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
display: flex; display: flex;
align-items: center; align-items: center; }
} .flex-center > * {
.flex-center > * { max-height: 100%; }
max-height: 100%;
}
.menu a, .dropdown.menu a { .menu a, .dropdown.menu a {
padding: 0.4rem 0.5rem; padding: 0.4rem 0.5rem; }
}
svg path { svg path {
fill: currentColor; fill: currentColor; }
}
div.mainContainer { div.mainContainer {
position: relative; position: relative;
@ -423,52 +323,42 @@ div.mainContainer {
max-width: 100%; max-width: 100%;
overflow: auto; overflow: auto;
flex: 1; flex: 1;
margin: 0.5rem; margin: 0.5rem; }
} div.mainContainer > .row, div.mainContainer #main-content, div.mainContainer #site-content {
div.mainContainer > .row, div.mainContainer #main-content, div.mainContainer #site-content { position: absolute;
position: absolute; width: 100%;
width: 100%; height: 100%;
height: 100%; top: 0;
top: 0; bottom: 0;
bottom: 0; left: 0;
left: 0; right: 0; }
right: 0;
}
.inline-block { .inline-block {
display: inline-block; display: inline-block; }
}
.right { .right {
float: right; float: right; }
}
#logo-img { #logo-img {
max-height: 2.2rem; max-height: 2.2rem; }
}
a { a {
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
color: inherit; color: inherit; }
}
a.hidden-link { a.hidden-link {
text-decoration: none; text-decoration: none;
color: inherit; color: inherit; }
}
label { label {
cursor: pointer; cursor: pointer; }
}
.align-right { .align-right {
text-align: right; text-align: right; }
}
.view-panel { .view-panel {
display: none; display: none; }
}
.loader { .loader {
left: 50%; left: 50%;
@ -476,212 +366,160 @@ label {
position: fixed; position: fixed;
-webkit-transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
text-align: center; text-align: center; }
} .loader.inline {
.loader.inline { left: initial;
left: initial; top: initial;
top: initial; position: initial;
position: initial; -webkit-transform: initial;
-webkit-transform: initial; transform: initial;
transform: initial; text-align: center;
text-align: center; display: inline; }
display: inline; .loader.small #spinner {
} transform: scale(0.5); }
.loader.small #spinner { .loader #spinner {
transform: scale(0.5); box-sizing: border-box;
} stroke: #b71c1a;
.loader #spinner { stroke-width: 3px;
box-sizing: border-box; transform-origin: 50%;
stroke: #b71c1a; animation: line 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite, rotate 1.6s linear infinite; }
stroke-width: 3px;
transform-origin: 50%;
animation: line 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite, rotate 1.6s linear infinite;
}
@keyframes rotate { @keyframes rotate {
from { from {
transform: rotate(0); transform: rotate(0); }
}
to { to {
transform: rotate(450deg); transform: rotate(450deg); } }
}
}
@keyframes line { @keyframes line {
0% { 0% {
stroke-dasharray: 2, 85.964; stroke-dasharray: 2, 85.964;
transform: rotate(0); transform: rotate(0); }
}
50% { 50% {
stroke-dasharray: 65.973, 21.9911; stroke-dasharray: 65.973, 21.9911;
stroke-dashoffset: 0; stroke-dashoffset: 0; }
}
100% { 100% {
stroke-dasharray: 2, 85.964; stroke-dasharray: 2, 85.964;
stroke-dashoffset: -65.973; stroke-dashoffset: -65.973;
transform: rotate(90deg); transform: rotate(90deg); } }
}
}
#print-content { #print-content {
display: none; display: none; }
}
.action-button { .action-button {
max-height: 1.7rem; max-height: 1.7rem;
margin-left: 0.4rem; margin-left: 0.4rem;
margin-right: 0.4rem; margin-right: 0.4rem; }
} .action-button:hover {
.action-button:hover { background: #e8e8e8; }
background: #e8e8e8;
}
.vcenter-container { .vcenter-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: table; display: table; }
} .vcenter-container .vcenter {
.vcenter-container .vcenter { vertical-align: middle;
vertical-align: middle; display: table-cell;
display: table-cell; flex-direction: column;
flex-direction: column; justify-content: center; }
justify-content: center;
}
.max-width { .max-width {
width: 100%; width: 100%; }
}
input, button { input, button {
letter-spacing: 1px !important; letter-spacing: 1px !important; }
}
.no-padding { .no-padding {
padding: 0; padding: 0;
border: 0; border: 0; }
}
.center { .center {
text-align: center; text-align: center; }
}
@media print { @media print {
nav, .mainContainer, footer, #styles { nav, .mainContainer, footer, #styles {
display: none !important; display: none !important; }
}
#print-content { #print-content {
display: block !important; display: block !important; } }
}
}
.overflow-y-auto { .overflow-y-auto {
overflow-y: auto !important; overflow-y: auto !important; }
}
.row.no-after:after { .row.no-after:after {
content: initial; content: initial; }
}
.margin-bottom { .margin-bottom {
margin-bottom: 1rem; margin-bottom: 1rem; }
} @media print, screen and (min-width: 25em) {
@media print, screen and (min-width: 25em) { .margin-bottom {
.margin-bottom { margin-bottom: 2rem; } }
margin-bottom: 2rem; @media print, screen and (min-width: 40em) {
} .margin-bottom {
} margin-bottom: 3rem; } }
@media print, screen and (min-width: 40em) { @media print, screen and (min-width: 64em) {
.margin-bottom { .margin-bottom {
margin-bottom: 3rem; margin-bottom: 4rem; } }
} @media screen and (min-width: 75em) {
} .margin-bottom {
@media print, screen and (min-width: 64em) { margin-bottom: 5rem; } }
.margin-bottom {
margin-bottom: 4rem;
}
}
@media screen and (min-width: 75em) {
.margin-bottom {
margin-bottom: 5rem;
}
}
.font-small { .font-small {
font-size: 0.7em; font-size: 0.7em; }
}
.border-bottom { .border-bottom {
border-bottom: 1px solid #cacaca; border-bottom: 1px solid #cacaca; }
}
.border-right { .border-right {
border-right: 1px solid #cacaca; border-right: 1px solid #cacaca; }
}
.border-left { .border-left {
border-left: 1px solid #cacaca; border-left: 1px solid #cacaca; }
}
img.logo { img.logo {
vertical-align: inherit; vertical-align: inherit;
display: inline-block; display: inline-block;
height: auto; height: auto;
max-width: 1.1rem; max-width: 1.1rem;
margin-right: 2px; margin-right: 2px; }
}
.align-center { .align-center {
text-align: center; text-align: center; }
}
hr.separator { hr.separator {
margin: 1rem 0; margin: 1rem 0; }
}
.button-line { .button-line {
display: flex; display: flex; }
} .button-line .button {
.button-line .button { flex: 1;
flex: 1; margin-left: 1px;
margin-left: 1px; margin-right: 1px;
margin-right: 1px; padding: 0.5rem 0.77rem; }
padding: 0.5rem 0.77rem;
}
@media screen and (max-width: 24.9375em) { @media screen and (max-width: 24.9375em) {
.small-small { .small-small {
font-size: small; font-size: small; } }
}
}
select { select {
border: 0; border: 0;
padding: 0.3rem 0.3rem; padding: 0.3rem 0.3rem; }
}
.share-icon { .share-icon {
max-width: 1.5rem; max-width: 1.5rem;
margin: 0.1rem; margin: 0.1rem; }
}
.hidden { .hidden {
display: none; display: none; }
}
.no-transition { .no-transition {
transition: none !important; transition: none !important; }
}
img.action-image { img.action-image {
max-height: 1.4rem; max-height: 1.4rem;
cursor: pointer; cursor: pointer; }
}
img.back-button { img.back-button {
max-height: 0.6rem; max-height: 0.6rem;
margin-right: 0.2rem; margin-right: 0.2rem;
cursor: pointer; cursor: pointer;
vertical-align: inherit; vertical-align: inherit; }
}
.no-margin-bottom { .no-margin-bottom {
margin-bottom: 0; margin-bottom: 0; }
}

View File

@ -8,85 +8,64 @@
overflow: auto; overflow: auto;
background-color: black; background-color: black;
/* Fallback color */ /* Fallback color */
background-color: rgba(0, 0, 0, 0.56); background-color: rgba(0, 0, 0, 0.56); }
} .background .modal {
.background .modal { position: relative;
position: relative; top: 50%;
top: 50%; margin: auto;
margin: auto; width: 80%;
width: 80%; background-color: #fefefe;
background-color: #fefefe; transform: translateY(-50%);
transform: translateY(-50%); padding: 0.5rem;
padding: 0.5rem; display: flex;
display: flex; flex-direction: column;
flex-direction: column; max-height: 80%;
max-height: 80%; max-width: 1024px; }
max-width: 1024px; @media screen and (max-width: 63.9375em) {
} .background .modal.small-margin {
@media screen and (max-width: 63.9375em) { width: 90%; } }
.background .modal.small-margin { @media screen and (max-width: 24.9375em) {
width: 90%; .background .modal.small-margin {
} width: 95%; } }
} .background .modal.max-small {
@media screen and (max-width: 24.9375em) { max-width: 0; }
.background .modal.small-margin { .background .modal.max-smedium {
width: 95%; max-width: 400px; }
} .background .modal.max-medium {
} max-width: 640px; }
.background .modal.max-small { .background .modal.max-large {
max-width: 0; max-width: 1024px; }
} .background .modal.max-xlarge {
.background .modal.max-smedium { max-width: 1200px; }
max-width: 400px; .background .modal.max-xxlarge {
} max-width: 1440px; }
.background .modal.max-medium { .background .modal .title {
max-width: 640px; font-weight: bold;
} padding-bottom: 0.5rem; }
.background .modal.max-large { .background .modal .content-container {
max-width: 1024px; overflow-y: auto;
} max-height: 100%; }
.background .modal.max-xlarge { .background .modal .content-container .loader {
max-width: 1200px; position: static;
} transform: none; }
.background .modal.max-xxlarge { .background .modal .close {
max-width: 1440px; text-align: right;
} color: #aaa;
.background .modal .title { float: right;
font-weight: bold; font-size: 28px;
padding-bottom: 0.5rem; font-weight: bold;
} line-height: 1; }
.background .modal .content-container { .background .modal .close:hover, .background .modal .close:focus {
overflow-y: auto; color: black;
max-height: 100%; text-decoration: none;
} cursor: pointer; }
.background .modal .content-container .loader { .background .modal .modal-button-container {
position: static; padding-top: 0.5rem; }
transform: none; .background .modal .modal-button-container .button {
} margin-left: 0.2rem;
.background .modal .close { margin-bottom: 0 !important;
text-align: right; padding: 0.6em 0.8em; }
color: #aaa; @media screen and (max-width: 24.9375em) {
float: right; .background .modal .modal-button-container .button {
font-size: 28px; margin-left: 0.1rem;
font-weight: bold; padding: 0.3em 0.5em; } }
line-height: 1;
}
.background .modal .close:hover, .background .modal .close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
.background .modal .modal-button-container {
padding-top: 0.5rem;
}
.background .modal .modal-button-container .button {
margin-left: 0.2rem;
margin-bottom: 0 !important;
padding: 0.6em 0.8em;
}
@media screen and (max-width: 24.9375em) {
.background .modal .modal-button-container .button {
margin-left: 0.1rem;
padding: 0.3em 0.5em;
}
}

View File

@ -7,16 +7,11 @@
.settings-container { .settings-container {
border: 1px solid black; border: 1px solid black;
border-radius: 2px; border-radius: 2px;
padding: 0.3rem; padding: 0.3rem; }
} @media print, screen and (min-width: 40em) {
@media print, screen and (min-width: 40em) { .settings-container #settings-fragments-container {
.settings-container #settings-fragments-container { border-left: 1px solid #cacaca; } }
border-left: 1px solid #cacaca; .settings-container #settings-fragments-container #settings-fragments > * {
} display: none; }
} .settings-container #settings-fragments-container #settings-fragments > *.active {
.settings-container #settings-fragments-container #settings-fragments > * { display: block; }
display: none;
}
.settings-container #settings-fragments-container #settings-fragments > *.active {
display: block;
}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<div class="max-height overflow-hidden"><div id=segment-leaf-template class="segment segment-leaf"><div class=leaf-element></div></div><div id=segment-parent-template class="segment segment-parent"><div class=child-container></div></div><div id=segment-row-template class="segment segment-row"><div class=child-container></div></div><div id=segment-triangle-template class="segment segment-triangle"><div class=child-container></div></div><div class=max-height><div class="show-while-playing height-20 text-right"><button class=button id=help-button data-translation=help></button></div><div class="show-when-won height-20 center flex-center"><b data-translation=won id=won-text></b><div id=coin-container><div id=coin-template class=coin><img src=img/coin.png></div></div></div><div class="flex-center height-60"><div id=level></div></div><div class="show-when-won flex-center height-20"><button class="button max-width" id=continue-button data-translation=continue></button></div></div></div> <div class="max-height overflow-hidden"><div id=segment-leaf-template class="segment segment-leaf"><div class=leaf-element></div></div><div id=segment-parent-template class="segment segment-parent"><div class=child-container></div></div><div id=segment-row-template class="segment segment-row"><div class=child-container></div></div><div id=segment-triangle-template class="segment segment-triangle"><div class=child-container></div></div><div class=max-height><div class="text-right max-width"><button class="button right show-while-playing" id=help-button data-translation=help></button></div><div class="height-20 show-when-won center flex-center fill-me"><div class="grow max-width"><b data-translation=won id=won-text></b></div><div id=coin-container><div id=coin-template class=coin style="opacity: 0"><img src=img/coin.png></div></div></div><div class="flex-center level-container"><div id=level></div></div><div class="show-when-won flex-center height-20"><button class="button max-width" id=continue-button data-translation=continue></button></div></div></div>

View File

@ -4578,17 +4578,55 @@ InitPromise.addPromise(function(app){
}); });
class ScaleHelper { class ScaleHelper {
scaleTo(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, addListener) { async scaleTo(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animationDelay, addListener) {
addListener = Helper.nonNull(addListener, true);
animationDelay = Helper.nonNull(animationDelay, 0);
let newFontSize = await this._getNewFontSize(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animationDelay === 0);
if (animationDelay > 0) {
await new Promise(r => {
setTimeout(r, animationDelay);
fontElement.style.fontSize = newFontSize + "px";
});
}
let self = this;
let listener = function () {
let timeout = (typeof addListener === 'number')?addListener:255;
setTimeout(() => {
self.scaleTo(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animationDelay, false);
}, timeout);
};
if (addListener !== false) {
window.addEventListener("resize", listener);
}
return listener;
}
async scaleToFull(fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animDelay, addListener) {
return this.scaleTo(1, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animDelay, addListener);
}
async _getNewFontSize(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, setFontSize) {
margin = Helper.nonNull(margin, 10); margin = Helper.nonNull(margin, 10);
ignoreHeight = Helper.nonNull(ignoreHeight, false); ignoreHeight = Helper.nonNull(ignoreHeight, false);
ignoreWidth = Helper.nonNull(ignoreWidth, false); ignoreWidth = Helper.nonNull(ignoreWidth, false);
fontWeight = Helper.nonNull(fontWeight, fontElement.innerHTML.length); fontWeight = Helper.nonNull(fontWeight, fontElement.innerHTML.length);
addListener = Helper.nonNull(addListener, true); setFontSize = Helper.nonNull(setFontSize, true);
let hasNoTransitionClass = container.classList.contains("no-transition"); let hasNoTransitionClass = container.classList.contains("no-transition");
container.classList.add("no-transition");
if (!hasNoTransitionClass) {
container.classList.add("no-transition");
}
// debugger;
let beforeFontSize = fontElement.style.fontSize;
let currentFontSize = 1; let currentFontSize = 1;
let diff = 0; let diff = 0;
let widthDiff = 0; let widthDiff = 0;
@ -4613,26 +4651,20 @@ class ScaleHelper {
} }
diff = newDiff; diff = newDiff;
} while ((widthDiff > (1 - scale) * containerWidth || ignoreWidth) && (heightDiff > (1 - scale) * containerHeight || ignoreHeight)); } while ((widthDiff > (1 - scale) * containerWidth || ignoreWidth) && (heightDiff > (1 - scale) * containerHeight || ignoreHeight));
fontElement.style.fontSize = (currentFontSize - margin) + 'px';
console.log(setFontSize, currentFontSize, beforeFontSize, fontElement.style.fontSize, fontElement);
currentFontSize -= margin;
fontElement.style.fontSize = ((setFontSize) ? currentFontSize + "px" : beforeFontSize);
if (!hasNoTransitionClass) { if (!hasNoTransitionClass) {
await new Promise((r) => {
setTimeout(r, 50);
});
container.classList.remove("no-transition"); container.classList.remove("no-transition");
} }
let self = this; return currentFontSize;
let listener = function () {
setTimeout(() => {
self.scaleTo(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, false);
}, 255);
};
if (addListener) {
window.addEventListener("resize", listener);
}
return listener;
}
scaleToFull(fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight) {
return this.scaleTo(1, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight);
} }
} }
@ -4926,7 +4958,6 @@ class ParentSegment extends Segment {
} }
applyLocks(locks) { applyLocks(locks) {
console.log(locks);
this.rotatable = locks[0]; this.rotatable = locks[0];
locks.splice(0, 1); locks.splice(0, 1);
for (let i = 0, n = this.children.length; i < n; i++) { for (let i = 0, n = this.children.length; i < n; i++) {
@ -5605,7 +5636,7 @@ class LevelSite extends WordRotatorBaseSite {
return super.onConstruct(args); return super.onConstruct(args);
} }
onFirstStart() { async onFirstStart() {
super.onFirstStart(); super.onFirstStart();
let leafSegmentTemplate = this.findBy("#segment-leaf-template"); let leafSegmentTemplate = this.findBy("#segment-leaf-template");
@ -5632,14 +5663,17 @@ class LevelSite extends WordRotatorBaseSite {
let wonText = this.findBy("#won-text"); let wonText = this.findBy("#won-text");
let scaleHelper = new ScaleHelper(); let scaleHelper = new ScaleHelper();
this.continueButtonScaler = scaleHelper.scaleToFull(continueButton, continueButton.parentElement, false, true); this.continueButtonScaler = await scaleHelper.scaleToFull(continueButton, continueButton.parentElement, false, true);
this.wonTextScaler = scaleHelper.scaleToFull(wonText, wonText.parentElement); this.wonTextScaler = await scaleHelper.scaleToFull(wonText, wonText.parentElement, false, false, 10, null, 5);
this.wonText = wonText;
this.wonText.style.fontSize = "0";
//Benutze Document, da Element außerhalb von Seite (eigentlich unschön!) //Benutze Document, da Element außerhalb von Seite (eigentlich unschön!)
this.levelCounterActionContainer = document.getElementById("level-number-container"); this.levelCounterActionContainer = document.getElementById("level-number-container");
this.levelCounterAction = document.getElementById("level-number"); this.levelCounterAction = document.getElementById("level-number");
this.levelCounterAction.innerText = this.levelCounter; this.levelCounterAction.innerText = this.levelCounter;
this.levelNumberScaler = scaleHelper.scaleToFull(this.levelCounterAction, this.levelCounterActionContainer, false, false, 4); this.levelNumberScaler = await scaleHelper.scaleToFull(this.levelCounterAction, this.levelCounterActionContainer, false, false, 4);
this.levelCounterActionContainer.classList.add("visible");
this.templateContainer = new TemplateContainer(leafSegmentTemplate, parentSegmentTemplate, rowSegmentTemplate, triangleTemplate); this.templateContainer = new TemplateContainer(leafSegmentTemplate, parentSegmentTemplate, rowSegmentTemplate, triangleTemplate);
this.coinTemplate = this.findBy("#coin-template"); this.coinTemplate = this.findBy("#coin-template");
@ -5685,7 +5719,7 @@ class LevelSite extends WordRotatorBaseSite {
let levelSegment = this.findBy("#level"); let levelSegment = this.findBy("#level");
levelSegment.removeAllChildren().appendChild(level.getRootSegment().getElement()); levelSegment.removeAllChildren().appendChild(level.getRootSegment().getElement());
let scaleHelper = new ScaleHelper(); let scaleHelper = new ScaleHelper();
this.levelScaler = scaleHelper.scaleToFull(levelSegment, levelSegment.parentElement, false, false, 2, level.words[0].length * 2); this.levelScaler = await scaleHelper.scaleToFull(levelSegment, levelSegment.parentElement, false, false, 2, level.words[0].length * 2, null, 0);
this.level = level; this.level = level;
return; return;
@ -5700,6 +5734,7 @@ class LevelSite extends WordRotatorBaseSite {
async nextLevel() { async nextLevel() {
try { try {
this._siteContent.classList.remove('won'); this._siteContent.classList.remove('won');
this.wonText.style.fontSize = "0";
const db = WordRotatorDb.getInstance(); const db = WordRotatorDb.getInstance();
const nextLevelJson = await db.loadNextLevel([20, 40, 60, 100, 120, 140, 160]); const nextLevelJson = await db.loadNextLevel([20, 40, 60, 100, 120, 140, 160]);
@ -5722,7 +5757,7 @@ class LevelSite extends WordRotatorBaseSite {
let levelSegment = this.findBy("#level"); let levelSegment = this.findBy("#level");
levelSegment.removeAllChildren().appendChild(level.getRootSegment().getElement()); levelSegment.removeAllChildren().appendChild(level.getRootSegment().getElement());
let scaleHelper = new ScaleHelper(); let scaleHelper = new ScaleHelper();
this.levelScaler = scaleHelper.scaleToFull(levelSegment, levelSegment.parentElement, false, false, 2, level.words[0].length * 2); this.levelScaler = await scaleHelper.scaleToFull(levelSegment, levelSegment.parentElement, false, false, 2, level.words[0].length * 2, null, 0);
this.level = level; this.level = level;
this.levelCounterAction.innerText = this.levelCounter; this.levelCounterAction.innerText = this.levelCounter;
@ -5739,8 +5774,11 @@ class LevelSite extends WordRotatorBaseSite {
onStart(args) { onStart(args) {
let res = super.onStart(args); let res = super.onStart(args);
this.levelCounterAction.innerText = this.levelCounter; if (this.levelCounterAction) {
this.levelCounterActionContainer.classList.add("visible");
this.levelCounterAction.innerText = this.levelCounter;
this.levelCounterActionContainer.classList.add("visible");
}
this.levelScaler(); this.levelScaler();
return res; return res;
} }
@ -5761,17 +5799,52 @@ class LevelSite extends WordRotatorBaseSite {
this._siteContent.classList.add('won'); this._siteContent.classList.add('won');
localStorage.removeItem("currentLevel"); localStorage.removeItem("currentLevel");
let continueButton = this.findBy("#continue-button");
continueButton.style.transition = "none";
continueButton.style.opacity = 0;
this.coinContainer.removeAllChildren(); this.coinContainer.removeAllChildren();
let coinsPerLevel = SystemSettings.get("coinsPerLevel", 5); let coinsPerLevel = SystemSettings.get("coinsPerLevel", 5);
let coinsBefore = parseInt(Helper.nonNull(localStorage.getItem("coins"), "0"));
localStorage.setItem("coins", coinsBefore + parseInt(coinsPerLevel));
let audio = (new Audio(Helper.basePath("/sound/single_coin_fall_on_concrete_.mp3")));
let coinPromise = Promise.all([new Promise((r) => {
setTimeout(r, 500);
}),
new Promise(r => {
audio.addEventListener('loadeddata', r);
})
]);
for (let i = 0; i < coinsPerLevel; i++) { for (let i = 0; i < coinsPerLevel; i++) {
let coinElem = Helper.cloneNode(this.coinTemplate); let coinElem = Helper.cloneNode(this.coinTemplate);
this.coinContainer.appendChild(coinElem); this.coinContainer.appendChild(coinElem);
coinPromise = coinPromise.then(() => {
return new Promise(r => {
let timeout = 350;
coinElem.fadeIn(timeout / 1000);
if (audio !== null) {
audio.pause();
audio.currentTime = 0;
audio.play();
}
setTimeout(() => {
this.coinAction.setTitle(coinsBefore++);
this.coinAction.redraw();
}, timeout / 2);
setTimeout(r, timeout);
})
});
} }
localStorage.setItem("coins", parseInt(Helper.nonNull(localStorage.getItem("coins"), "0")) + parseInt(coinsPerLevel));
this.wonTextScaler(); this.wonTextScaler();
this.continueButtonScaler(); this.continueButtonScaler();
this.levelScaler();
coinPromise.then(() => {
continueButton.fadeIn();
});
await savePromise; await savePromise;
} }
catch (e) { catch (e) {
@ -5790,8 +5863,11 @@ class LevelSite extends WordRotatorBaseSite {
this.coinAction.redraw(); this.coinAction.redraw();
let rotatables = this.level.getRotatableSegments(); let rotatables = this.level.getRotatableSegments();
rotatables = rotatables.filter((segment) => {
return (segment.rotation !== 0);
});
let index = Math.floor(Math.random() * rotatables.length); let index = Math.floor(Math.random() * rotatables.length);
console.log(rotatables, index);
let segmentToHelp = rotatables[index]; let segmentToHelp = rotatables[index];
while (segmentToHelp.rotation !== 0) { while (segmentToHelp.rotation !== 0) {
@ -5800,7 +5876,7 @@ class LevelSite extends WordRotatorBaseSite {
segmentToHelp.setIsRotatable(false); segmentToHelp.setIsRotatable(false);
this.level.saveAsCurrentLevel(); this.level.saveAsCurrentLevel();
} }
else{ else {
FlashMessenger.addMessage("not-enough-coins"); FlashMessenger.addMessage("not-enough-coins");
} }
} }

View File

@ -8,3 +8,8 @@
.tab-header-container .tab-header.active { .tab-header-container .tab-header.active {
border-bottom: 0; border-bottom: 0;
background-color: #FFF; } background-color: #FFF; }
.no-transition {
transition: none !important; }
.no-transition * {
transition: none !important; }

Binary file not shown.

View File

@ -9,17 +9,55 @@ class DelayPromise extends Promise {
} }
class ScaleHelper { class ScaleHelper {
scaleTo(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, addListener) { async scaleTo(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animationDelay, addListener) {
addListener = Helper.nonNull(addListener, true);
animationDelay = Helper.nonNull(animationDelay, 0);
let newFontSize = await this._getNewFontSize(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animationDelay === 0);
if (animationDelay > 0) {
await new Promise(r => {
setTimeout(r, animationDelay);
fontElement.style.fontSize = newFontSize + "px";
});
}
let self = this;
let listener = function () {
let timeout = (typeof addListener === 'number')?addListener:255;
setTimeout(() => {
self.scaleTo(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animationDelay, false);
}, timeout);
};
if (addListener !== false) {
window.addEventListener("resize", listener);
}
return listener;
}
async scaleToFull(fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animDelay, addListener) {
return this.scaleTo(1, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, animDelay, addListener);
}
async _getNewFontSize(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, setFontSize) {
margin = Helper.nonNull(margin, 10); margin = Helper.nonNull(margin, 10);
ignoreHeight = Helper.nonNull(ignoreHeight, false); ignoreHeight = Helper.nonNull(ignoreHeight, false);
ignoreWidth = Helper.nonNull(ignoreWidth, false); ignoreWidth = Helper.nonNull(ignoreWidth, false);
fontWeight = Helper.nonNull(fontWeight, fontElement.innerHTML.length); fontWeight = Helper.nonNull(fontWeight, fontElement.innerHTML.length);
addListener = Helper.nonNull(addListener, true); setFontSize = Helper.nonNull(setFontSize, true);
let hasNoTransitionClass = container.classList.contains("no-transition"); let hasNoTransitionClass = container.classList.contains("no-transition");
container.classList.add("no-transition");
if (!hasNoTransitionClass) {
container.classList.add("no-transition");
}
// debugger;
let beforeFontSize = fontElement.style.fontSize;
let currentFontSize = 1; let currentFontSize = 1;
let diff = 0; let diff = 0;
let widthDiff = 0; let widthDiff = 0;
@ -44,26 +82,20 @@ class ScaleHelper {
} }
diff = newDiff; diff = newDiff;
} while ((widthDiff > (1 - scale) * containerWidth || ignoreWidth) && (heightDiff > (1 - scale) * containerHeight || ignoreHeight)); } while ((widthDiff > (1 - scale) * containerWidth || ignoreWidth) && (heightDiff > (1 - scale) * containerHeight || ignoreHeight));
fontElement.style.fontSize = (currentFontSize - margin) + 'px';
console.log(setFontSize, currentFontSize, beforeFontSize, fontElement.style.fontSize, fontElement);
currentFontSize -= margin;
fontElement.style.fontSize = ((setFontSize) ? currentFontSize + "px" : beforeFontSize);
if (!hasNoTransitionClass) { if (!hasNoTransitionClass) {
await new Promise((r) => {
setTimeout(r, 50);
});
container.classList.remove("no-transition"); container.classList.remove("no-transition");
} }
let self = this; return currentFontSize;
let listener = function () {
setTimeout(() => {
self.scaleTo(scale, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight, false);
}, 255);
};
if (addListener) {
window.addEventListener("resize", listener);
}
return listener;
}
scaleToFull(fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight) {
return this.scaleTo(1, fontElement, container, ignoreHeight, ignoreWidth, margin, fontWeight);
} }
} }

View File

@ -14,18 +14,20 @@
</div> </div>
<!-- Site Content --> <!-- Site Content -->
<div class='max-height'> <div class='max-height'>
<div class = 'show-while-playing height-20 text-right'> <div class="text-right max-width">
<button class="button" id = 'help-button' data-translation="help"></button> <button class="button right show-while-playing" id='help-button' data-translation="help"></button>
</div> </div>
<div class = 'show-when-won height-20 center flex-center'> <div class='height-20 show-when-won center flex-center fill-me'>
<b data-translation="won" id = "won-text"></b> <div class = 'grow max-width'>
<div id = 'coin-container'> <b data-translation="won" id="won-text"></b>
<div id = 'coin-template' class='coin'> </div>
<img src = 'img/coin.png'/> <div id='coin-container'>
<div id='coin-template' class='coin' style="opacity: 0">
<img src='img/coin.png'/>
</div> </div>
</div> </div>
</div> </div>
<div class="flex-center height-60"> <div class="flex-center level-container">
<div id='level'> <div id='level'>
</div> </div>
</div> </div>

View File

@ -34,7 +34,7 @@ export class LevelSite extends WordRotatorBaseSite {
return super.onConstruct(args); return super.onConstruct(args);
} }
onFirstStart() { async onFirstStart() {
super.onFirstStart(); super.onFirstStart();
let leafSegmentTemplate = this.findBy("#segment-leaf-template"); let leafSegmentTemplate = this.findBy("#segment-leaf-template");
@ -61,14 +61,17 @@ export class LevelSite extends WordRotatorBaseSite {
let wonText = this.findBy("#won-text"); let wonText = this.findBy("#won-text");
let scaleHelper = new ScaleHelper(); let scaleHelper = new ScaleHelper();
this.continueButtonScaler = scaleHelper.scaleToFull(continueButton, continueButton.parentElement, false, true); this.continueButtonScaler = await scaleHelper.scaleToFull(continueButton, continueButton.parentElement, false, true);
this.wonTextScaler = scaleHelper.scaleToFull(wonText, wonText.parentElement); this.wonTextScaler = await scaleHelper.scaleToFull(wonText, wonText.parentElement, false, false, 10, null, 5);
this.wonText = wonText;
this.wonText.style.fontSize = "0";
//Benutze Document, da Element außerhalb von Seite (eigentlich unschön!) //Benutze Document, da Element außerhalb von Seite (eigentlich unschön!)
this.levelCounterActionContainer = document.getElementById("level-number-container"); this.levelCounterActionContainer = document.getElementById("level-number-container");
this.levelCounterAction = document.getElementById("level-number"); this.levelCounterAction = document.getElementById("level-number");
this.levelCounterAction.innerText = this.levelCounter; this.levelCounterAction.innerText = this.levelCounter;
this.levelNumberScaler = scaleHelper.scaleToFull(this.levelCounterAction, this.levelCounterActionContainer, false, false, 4); this.levelNumberScaler = await scaleHelper.scaleToFull(this.levelCounterAction, this.levelCounterActionContainer, false, false, 4);
this.levelCounterActionContainer.classList.add("visible");
this.templateContainer = new TemplateContainer(leafSegmentTemplate, parentSegmentTemplate, rowSegmentTemplate, triangleTemplate); this.templateContainer = new TemplateContainer(leafSegmentTemplate, parentSegmentTemplate, rowSegmentTemplate, triangleTemplate);
this.coinTemplate = this.findBy("#coin-template"); this.coinTemplate = this.findBy("#coin-template");
@ -114,7 +117,7 @@ export class LevelSite extends WordRotatorBaseSite {
let levelSegment = this.findBy("#level"); let levelSegment = this.findBy("#level");
levelSegment.removeAllChildren().appendChild(level.getRootSegment().getElement()); levelSegment.removeAllChildren().appendChild(level.getRootSegment().getElement());
let scaleHelper = new ScaleHelper(); let scaleHelper = new ScaleHelper();
this.levelScaler = scaleHelper.scaleToFull(levelSegment, levelSegment.parentElement, false, false, 2, level.words[0].length * 2); this.levelScaler = await scaleHelper.scaleToFull(levelSegment, levelSegment.parentElement, false, false, 2, level.words[0].length * 2, null, 0);
this.level = level; this.level = level;
return; return;
@ -129,6 +132,7 @@ export class LevelSite extends WordRotatorBaseSite {
async nextLevel() { async nextLevel() {
try { try {
this._siteContent.classList.remove('won'); this._siteContent.classList.remove('won');
this.wonText.style.fontSize = "0";
const db = WordRotatorDb.getInstance(); const db = WordRotatorDb.getInstance();
const nextLevelJson = await db.loadNextLevel([20, 40, 60, 100, 120, 140, 160]); const nextLevelJson = await db.loadNextLevel([20, 40, 60, 100, 120, 140, 160]);
@ -151,7 +155,7 @@ export class LevelSite extends WordRotatorBaseSite {
let levelSegment = this.findBy("#level"); let levelSegment = this.findBy("#level");
levelSegment.removeAllChildren().appendChild(level.getRootSegment().getElement()); levelSegment.removeAllChildren().appendChild(level.getRootSegment().getElement());
let scaleHelper = new ScaleHelper(); let scaleHelper = new ScaleHelper();
this.levelScaler = scaleHelper.scaleToFull(levelSegment, levelSegment.parentElement, false, false, 2, level.words[0].length * 2); this.levelScaler = await scaleHelper.scaleToFull(levelSegment, levelSegment.parentElement, false, false, 2, level.words[0].length * 2, null, 0);
this.level = level; this.level = level;
this.levelCounterAction.innerText = this.levelCounter; this.levelCounterAction.innerText = this.levelCounter;
@ -168,8 +172,11 @@ export class LevelSite extends WordRotatorBaseSite {
onStart(args) { onStart(args) {
let res = super.onStart(args); let res = super.onStart(args);
this.levelCounterAction.innerText = this.levelCounter; if (this.levelCounterAction) {
this.levelCounterActionContainer.classList.add("visible");
this.levelCounterAction.innerText = this.levelCounter;
this.levelCounterActionContainer.classList.add("visible");
}
this.levelScaler(); this.levelScaler();
return res; return res;
} }
@ -190,17 +197,52 @@ export class LevelSite extends WordRotatorBaseSite {
this._siteContent.classList.add('won'); this._siteContent.classList.add('won');
localStorage.removeItem("currentLevel"); localStorage.removeItem("currentLevel");
let continueButton = this.findBy("#continue-button");
continueButton.style.transition = "none";
continueButton.style.opacity = 0;
this.coinContainer.removeAllChildren(); this.coinContainer.removeAllChildren();
let coinsPerLevel = SystemSettings.get("coinsPerLevel", 5); let coinsPerLevel = SystemSettings.get("coinsPerLevel", 5);
let coinsBefore = parseInt(Helper.nonNull(localStorage.getItem("coins"), "0"));
localStorage.setItem("coins", coinsBefore + parseInt(coinsPerLevel));
let audio = (new Audio(Helper.basePath("/sound/single_coin_fall_on_concrete_.mp3")));
let coinPromise = Promise.all([new Promise((r) => {
setTimeout(r, 500)
}),
new Promise(r => {
audio.addEventListener('loadeddata', r);
})
]);
for (let i = 0; i < coinsPerLevel; i++) { for (let i = 0; i < coinsPerLevel; i++) {
let coinElem = Helper.cloneNode(this.coinTemplate); let coinElem = Helper.cloneNode(this.coinTemplate);
this.coinContainer.appendChild(coinElem); this.coinContainer.appendChild(coinElem);
coinPromise = coinPromise.then(() => {
return new Promise(r => {
let timeout = 350;
coinElem.fadeIn(timeout / 1000);
if (audio !== null) {
audio.pause();
audio.currentTime = 0;
audio.play();
}
setTimeout(() => {
this.coinAction.setTitle(coinsBefore++);
this.coinAction.redraw();
}, timeout / 2);
setTimeout(r, timeout);
})
});
} }
localStorage.setItem("coins", parseInt(Helper.nonNull(localStorage.getItem("coins"), "0")) + parseInt(coinsPerLevel));
this.wonTextScaler(); this.wonTextScaler();
this.continueButtonScaler(); this.continueButtonScaler();
this.levelScaler();
coinPromise.then(() => {
continueButton.fadeIn();
});
await savePromise; await savePromise;
} }
catch (e) { catch (e) {
@ -219,8 +261,11 @@ export class LevelSite extends WordRotatorBaseSite {
this.coinAction.redraw(); this.coinAction.redraw();
let rotatables = this.level.getRotatableSegments(); let rotatables = this.level.getRotatableSegments();
rotatables = rotatables.filter((segment) => {
return (segment.rotation !== 0);
});
let index = Math.floor(Math.random() * rotatables.length); let index = Math.floor(Math.random() * rotatables.length);
console.log(rotatables, index);
let segmentToHelp = rotatables[index]; let segmentToHelp = rotatables[index];
while (segmentToHelp.rotation !== 0) { while (segmentToHelp.rotation !== 0) {
@ -229,7 +274,7 @@ export class LevelSite extends WordRotatorBaseSite {
segmentToHelp.setIsRotatable(false); segmentToHelp.setIsRotatable(false);
this.level.saveAsCurrentLevel(); this.level.saveAsCurrentLevel();
} }
else{ else {
FlashMessenger.addMessage("not-enough-coins"); FlashMessenger.addMessage("not-enough-coins");
} }
} }

View File

@ -100,7 +100,6 @@ export class ParentSegment extends Segment {
} }
applyLocks(locks) { applyLocks(locks) {
console.log(locks);
this.rotatable = locks[0]; this.rotatable = locks[0];
locks.splice(0, 1); locks.splice(0, 1);
for (let i = 0, n = this.children.length; i < n; i++) { for (let i = 0, n = this.children.length; i < n; i++) {

View File

@ -1,19 +0,0 @@
#author-list {
.author-entry {
border-bottom: 1px solid $borderColor;
.author-image-container {
.author-image {
position: relative;
}
}
.user-flag{
display: none;
}
&.isUser{
.user-flag{
display: inherit;
}
}
}
}

View File

@ -61,10 +61,15 @@ $coinTowerDimension: 28px;
} }
} }
#coin-container .coin { #coin-container {
margin: 3px; height: 30px;
max-width: 30px; .coin {
display: inline-block; margin-left: 3px;
margin-right: 3px;
//height: 30px;
max-width:30px;
display: inline-block;
}
} }
//Segments //Segments
@ -247,18 +252,28 @@ $animationDuration: 0.25s;
} }
//Won-screen //Won-screen
.show-when-won { #site-content > :not(.won) {
//visibility: hidden; .show-when-won {
display: none; //visibility: hidden;
transition: none; display: none;
* { //transition: none;
transition: none; //* {
// transition: none;
//}
} }
} }
.level-container {
height: 100%;
transition: none;
}
.won { .won {
.level-container {
height: 60%;
}
.show-when-won { .show-when-won {
display: flex; //visibility: initial;
} }
.show-while-playing { .show-while-playing {
display: none; display: none;
@ -268,4 +283,3 @@ $animationDuration: 0.25s;
.text-right { .text-right {
text-align: right; text-align: right;
} }