Add board time update
This commit is contained in:
parent
bd8f10f1e7
commit
6eff4b772d
23 changed files with 1750 additions and 1259 deletions
|
@ -1,5 +1,6 @@
|
|||
package de.kif.frontend
|
||||
|
||||
import de.kif.frontend.views.board.initBoard
|
||||
import de.kif.frontend.views.calendar.initCalendar
|
||||
import de.kif.frontend.views.table.initTableLayout
|
||||
import de.kif.frontend.views.initWorkGroupConstraints
|
||||
|
@ -30,4 +31,7 @@ fun main() = init {
|
|||
if (document.getElementsByClassName("post-edit-right").length > 0) {
|
||||
initPostEdit()
|
||||
}
|
||||
if (document.getElementsByClassName("board").length > 0) {
|
||||
initBoard()
|
||||
}
|
||||
}
|
||||
|
|
29
src/jsMain/kotlin/de/kif/frontend/views/board/Board.kt
Normal file
29
src/jsMain/kotlin/de/kif/frontend/views/board/Board.kt
Normal file
|
@ -0,0 +1,29 @@
|
|||
package de.kif.frontend.views.board
|
||||
|
||||
import de.kif.common.formatDateTime
|
||||
import de.kif.frontend.iterator
|
||||
import de.westermann.kwebview.interval
|
||||
import org.w3c.dom.HTMLElement
|
||||
import org.w3c.dom.get
|
||||
import kotlin.browser.document
|
||||
import kotlin.js.Date
|
||||
|
||||
fun initBoard() {
|
||||
val boardSchedules = document.getElementsByClassName("board-schedules")[0] as HTMLElement
|
||||
val dateView = document.getElementsByClassName("board-header-date")[0] as HTMLElement
|
||||
val referenceTime = boardSchedules.dataset["reference"]?.toLongOrNull() ?: 0L
|
||||
|
||||
val scheduleList = mutableListOf<BoardSchedule>()
|
||||
|
||||
for (bs in boardSchedules.getElementsByClassName("board-schedule").iterator()) {
|
||||
scheduleList += BoardSchedule(bs)
|
||||
}
|
||||
|
||||
interval(1000) {
|
||||
val currentTime = Date.now().toLong()
|
||||
dateView.innerText = formatDateTime(currentTime)
|
||||
|
||||
val now = referenceTime - currentTime / 1000
|
||||
scheduleList.forEach { it.updateTime(now) }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package de.kif.frontend.views.board
|
||||
|
||||
import de.kif.common.model.Schedule
|
||||
import de.kif.frontend.views.overview.getByClassOrCreate
|
||||
import de.westermann.kwebview.View
|
||||
import org.w3c.dom.HTMLElement
|
||||
import org.w3c.dom.HTMLSpanElement
|
||||
import org.w3c.dom.get
|
||||
|
||||
class BoardSchedule(
|
||||
view: HTMLElement
|
||||
) : View(view) {
|
||||
private val roomView = view.getByClassOrCreate<HTMLSpanElement>("board-schedule-room")
|
||||
private val timeView = view.getByClassOrCreate<HTMLSpanElement>("board-schedule-time")
|
||||
private val colorView = view.getByClassOrCreate<HTMLSpanElement>("board-schedule-color")
|
||||
private val nameView = view.getByClassOrCreate<HTMLSpanElement>("board-schedule-name")
|
||||
|
||||
private var time: Long = timeView.dataset["time"]?.toLongOrNull() ?: 0L
|
||||
|
||||
fun updateTime(now: Long) {
|
||||
//console.log(time.toString(), now.toString())
|
||||
timeView.textContent = Schedule.timeDifferenceToString(time + now)
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@ import de.westermann.kwebview.components.*
|
|||
class CalendarTools(entry: CalendarEntry) : ViewCollection<View>() {
|
||||
|
||||
fun setName(room: Room, time: Int) {
|
||||
nameView.text = room.name + " - " + Schedule.timeToString(time)
|
||||
nameView.text = room.name + " - " + Schedule.timeOfDayToString(time)
|
||||
}
|
||||
|
||||
lateinit var schedule: Schedule
|
||||
|
|
|
@ -70,9 +70,9 @@ fun async(timeout: Int = 1, block: () -> Unit): Int {
|
|||
return window.setTimeout(block, timeout)
|
||||
}
|
||||
|
||||
fun interval(timeout: Int, block: () -> Unit): Int {
|
||||
if (timeout < 1) throw IllegalArgumentException("Timeout must be greater than 0!")
|
||||
return window.setInterval(block, timeout)
|
||||
fun interval(delay: Int, block: () -> Unit): Int {
|
||||
if (delay < 1) throw IllegalArgumentException("Delay must be greater than 0!")
|
||||
return window.setInterval(block, delay)
|
||||
}
|
||||
|
||||
fun clearTimeout(id: Int) {
|
||||
|
|
11
src/jsMain/resources/style/_config.scss
Normal file
11
src/jsMain/resources/style/_config.scss
Normal file
|
@ -0,0 +1,11 @@
|
|||
$border-radius: 0.2rem;
|
||||
$transitionTime: 150ms;
|
||||
|
||||
@mixin no-select() {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
73
src/jsMain/resources/style/components/_board.scss
Normal file
73
src/jsMain/resources/style/components/_board.scss
Normal file
|
@ -0,0 +1,73 @@
|
|||
@import "../config";
|
||||
|
||||
.board-header {
|
||||
line-height: 6rem;
|
||||
display: flex;
|
||||
padding: 0 2rem;
|
||||
|
||||
& > div {
|
||||
flex-grow: 1;
|
||||
font-family: "Bungee", sans-serif;
|
||||
font-weight: normal;
|
||||
font-size: 1.1rem;
|
||||
text-align: center;
|
||||
|
||||
&:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
&:last-child {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.board {
|
||||
padding: 1rem 1rem 2rem;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
height: calc(100vh - 6rem);
|
||||
|
||||
& > div {
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.board-schedule {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
padding: 1rem 1rem;
|
||||
|
||||
&:not(:last-child) {
|
||||
border-bottom: solid 1px var(--table-border-color)
|
||||
}
|
||||
}
|
||||
|
||||
.board-schedule-room {
|
||||
display: block;
|
||||
padding-left: 1rem;
|
||||
line-height: 2rem;
|
||||
}
|
||||
|
||||
.board-schedule-time {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
line-height: 2rem;
|
||||
}
|
||||
|
||||
.board-schedule-color {
|
||||
background-color: var(--primary-color);
|
||||
position: absolute;
|
||||
top: 3.25rem;
|
||||
left: 1rem;
|
||||
width: 0.5rem;
|
||||
height: 1.5rem;
|
||||
}
|
||||
|
||||
.board-schedule-name {
|
||||
display: block;
|
||||
padding-left: 1rem;
|
||||
line-height: 2rem;
|
||||
}
|
590
src/jsMain/resources/style/components/_calendar.scss
Normal file
590
src/jsMain/resources/style/components/_calendar.scss
Normal file
|
@ -0,0 +1,590 @@
|
|||
@import "../config";
|
||||
|
||||
.header {
|
||||
height: 2.2rem;
|
||||
line-height: 2.2rem;
|
||||
}
|
||||
|
||||
.header-left {
|
||||
float: left;
|
||||
|
||||
& > * {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
a {
|
||||
i {
|
||||
font-size: 1.8rem;
|
||||
padding: 0 0.5rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
&:first-child i::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 100%;
|
||||
height: 100%;
|
||||
width: 4rem;
|
||||
}
|
||||
|
||||
&:last-child i::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
left: -4rem;
|
||||
width: 4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.header-right {
|
||||
float: right;
|
||||
|
||||
&::after {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
.calendar {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.calendar-table {
|
||||
width: 100%;
|
||||
overflow-x: scroll;
|
||||
overflow-y: visible;
|
||||
padding-bottom: 1rem;
|
||||
position: relative;
|
||||
transition: width $transitionTime;
|
||||
}
|
||||
|
||||
.calendar-edit {
|
||||
width: 0;
|
||||
height: 100%;
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
transition: width $transitionTime;
|
||||
|
||||
.calendar-edit-main {
|
||||
position: sticky;
|
||||
opacity: 0;
|
||||
transition: opacity $transitionTime, visibility $transitionTime;
|
||||
top: 1rem;
|
||||
visibility: hidden;
|
||||
height: 100vh;
|
||||
z-index: 2;
|
||||
background-color: var(--background-secondary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-edit-search {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.calendar-edit-list {
|
||||
height: calc(100% - 4.5rem);
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.calendar-work-group {
|
||||
position: relative;
|
||||
display: block;
|
||||
border-radius: $border-radius;
|
||||
line-height: 2rem;
|
||||
font-size: 0.8rem;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background-color: var(--primary-color);
|
||||
color: var(--primary-text-color);
|
||||
|
||||
padding: 0 0.5rem;
|
||||
margin: 0.5rem;
|
||||
|
||||
&::after {
|
||||
content: attr(data-language);
|
||||
bottom: 0;
|
||||
right: 1rem;
|
||||
opacity: 0.6;
|
||||
position: absolute;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
&:hover .calendar-tools {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&.drag {
|
||||
box-shadow: 0 0.1rem 0.2rem var(--shadow-color);
|
||||
z-index: 2;
|
||||
|
||||
.calendar-tools {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
&.pending::before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: var(--background-primary-color);
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
@include no-select()
|
||||
}
|
||||
|
||||
.calendar[data-editable = "true"].edit {
|
||||
.calendar-table {
|
||||
width: calc(100% - 16rem);
|
||||
border-right: solid 1px var(--table-border-color);
|
||||
}
|
||||
|
||||
.calendar-edit {
|
||||
width: 16rem;
|
||||
}
|
||||
|
||||
.calendar-edit-main {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-tools {
|
||||
position: absolute;
|
||||
top: -5rem;
|
||||
right: 0;
|
||||
background-color: var(--background-primary-color);
|
||||
border-radius: $border-radius;
|
||||
display: none;
|
||||
z-index: 10;
|
||||
width: max-content;
|
||||
|
||||
border: solid 1px var(--input-border-color);
|
||||
box-shadow: 0 0.1rem 0.2rem var(--shadow-color);
|
||||
|
||||
div {
|
||||
clear: left;
|
||||
|
||||
span {
|
||||
float: left;
|
||||
display: block;
|
||||
width: 2rem;
|
||||
line-height: 2rem;
|
||||
height: 2rem;
|
||||
text-align: center;
|
||||
color: var(--icon-color-focused);
|
||||
transition: color $transitionTime, background-color $transitionTime;
|
||||
box-sizing: content-box;
|
||||
|
||||
i {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--table-header-color);
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: var(--icon-color-inactive);
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
span:first-child {
|
||||
color: var(--text-primary-color);
|
||||
width: 6rem;
|
||||
|
||||
&:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
padding-top: 0.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
span {
|
||||
padding-bottom: 0.2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-entry {
|
||||
position: absolute;
|
||||
display: block;
|
||||
border-radius: $border-radius;
|
||||
z-index: 1;
|
||||
line-height: 2rem;
|
||||
font-size: 0.8rem;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background-color: var(--primary-color);
|
||||
color: var(--primary-text-color);
|
||||
|
||||
padding: 0 0.5rem;
|
||||
|
||||
&::after {
|
||||
content: attr(data-language);
|
||||
bottom: 0;
|
||||
right: 1rem;
|
||||
opacity: 0.6;
|
||||
position: absolute;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
&:hover .calendar-tools {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&.drag {
|
||||
box-shadow: 0 0.1rem 0.2rem var(--shadow-color);
|
||||
z-index: 2;
|
||||
|
||||
.calendar-tools {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
&.pending::before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: var(--background-primary-color);
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
&.error {
|
||||
outline: solid 0.4rem var(--error-color);
|
||||
}
|
||||
|
||||
@include no-select()
|
||||
}
|
||||
|
||||
.calendar-table-box {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: column;
|
||||
width: max-content;
|
||||
height: max-content;
|
||||
|
||||
.calendar-header, .calendar-row {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
width: max-content;
|
||||
height: max-content;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.calendar-row {
|
||||
.calendar-cell:not(:first-child) {
|
||||
&:hover {
|
||||
background-color: var(--table-header-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.room-to-time {
|
||||
.calendar-header {
|
||||
line-height: 2rem;
|
||||
height: 2rem;
|
||||
width: 100%;
|
||||
|
||||
.calendar-cell:first-child {
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar-cell:not(:first-child) {
|
||||
width: 12rem;
|
||||
position: relative;
|
||||
padding-left: 0.2rem;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-left: solid 1px var(--table-border-color);
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-row {
|
||||
line-height: 2rem;
|
||||
height: 1.3rem;
|
||||
|
||||
.calendar-cell {
|
||||
position: relative;
|
||||
width: 12rem;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-left: solid 1px var(--table-border-color);
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.calendar-entry {
|
||||
top: 0.1rem;
|
||||
bottom: 0;
|
||||
width: auto !important;
|
||||
left: 0.1rem !important;
|
||||
right: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-cell:first-child {
|
||||
width: 6rem;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar-cell:first-child::before {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
&:nth-child(4n + 2) .calendar-cell::before {
|
||||
border-top: solid 1px var(--table-border-color);
|
||||
}
|
||||
|
||||
&.calendar-now::before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 6rem;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
border-bottom: solid 1px $primary-color;
|
||||
}
|
||||
|
||||
&.calendar-now::after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 6rem;
|
||||
transform: scale(1, 0.5) rotate(-45deg);
|
||||
transform-origin: bottom;
|
||||
border-bottom: solid 0.4rem $primary-color;
|
||||
border-right: solid 0.4rem $primary-color;
|
||||
border-top: solid 0.4rem transparent;
|
||||
border-left: solid 0.4rem transparent;
|
||||
margin-top: -0.55rem;
|
||||
margin-left: -0.3rem;
|
||||
}
|
||||
|
||||
@for $i from 0 through 14 {
|
||||
&.calendar-now-#{$i}::after, &.calendar-now-#{$i}::before {
|
||||
top: ($i / 16) * 100%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.time-to-room {
|
||||
flex-direction: row;
|
||||
|
||||
.calendar-header, .calendar-row {
|
||||
flex-direction: column;
|
||||
line-height: 3rem;
|
||||
|
||||
.calendar-cell {
|
||||
height: 3rem;
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-header {
|
||||
.calendar-cell {
|
||||
position: relative;
|
||||
width: 6rem;
|
||||
|
||||
&:not(:first-child) {
|
||||
border-top: solid 1px var(--table-border-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.calendar-row {
|
||||
.calendar-cell {
|
||||
position: relative;
|
||||
width: 1.5rem;
|
||||
|
||||
&:not(:first-child) {
|
||||
border-top: solid 1px var(--table-border-color);
|
||||
}
|
||||
|
||||
.calendar-entry {
|
||||
top: 0.5rem !important;
|
||||
bottom: 0.5rem;
|
||||
width: 0;
|
||||
left: 0;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
font-size: 0.8rem;
|
||||
position: relative;
|
||||
padding-left: 0.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
&:nth-child(2n + 2) .calendar-cell::before {
|
||||
content: '';
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-left: solid 1px var(--table-border-color);
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
&.calendar-now::before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 3rem;
|
||||
bottom: 0;
|
||||
width: 1px;
|
||||
border-right: solid 1px $primary-color;
|
||||
}
|
||||
|
||||
&.calendar-now::after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 3rem;
|
||||
transform: scale(0.5, 1) rotate(45deg);
|
||||
transform-origin: right;
|
||||
border-bottom: solid 0.4rem $primary-color;
|
||||
border-right: solid 0.4rem $primary-color;
|
||||
border-top: solid 0.4rem transparent;
|
||||
border-left: solid 0.4rem transparent;
|
||||
margin-top: -0.3rem;
|
||||
margin-left: -0.55rem;
|
||||
}
|
||||
|
||||
@for $i from 0 through 14 {
|
||||
&.calendar-now-#{$i}::after, &.calendar-now-#{$i}::before {
|
||||
left: ($i / 16) * 100%
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.color-picker {
|
||||
.color-picker-entry {
|
||||
position: relative;
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
float: left;
|
||||
|
||||
input {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
label {
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
left: 0.5rem;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
border-radius: 1.5rem;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
input:checked ~ label::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
background-color: transparent;
|
||||
top: 1rem;
|
||||
left: 0.8rem;
|
||||
width: 1.1rem;
|
||||
height: 0.5rem;
|
||||
transform: rotate(-45deg);
|
||||
border-left: solid 0.3rem var(--background-primary-color);
|
||||
border-bottom: solid 0.3rem var(--background-primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.color-picker-custom {
|
||||
position: relative;
|
||||
clear: both;
|
||||
height: 4rem;
|
||||
|
||||
& > input {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
label {
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
left: 0.5rem;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
border-radius: 1.5rem;
|
||||
z-index: 1;
|
||||
border: solid 0.1rem var(--text-primary-color);
|
||||
}
|
||||
|
||||
input:checked ~ label::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
background-color: transparent;
|
||||
top: 1rem;
|
||||
left: 0.8rem;
|
||||
width: 1.1rem;
|
||||
height: 0.5rem;
|
||||
transform: rotate(-45deg);
|
||||
border-left: solid 0.3rem var(--text-primary-color);
|
||||
border-bottom: solid 0.3rem var(--text-primary-color);
|
||||
}
|
||||
|
||||
label input {
|
||||
position: absolute;
|
||||
left: 4rem;
|
||||
top: 0.2rem;
|
||||
height: 2rem;
|
||||
width: 4rem;
|
||||
}
|
||||
}
|
||||
}
|
193
src/jsMain/resources/style/components/_form.scss
Normal file
193
src/jsMain/resources/style/components/_form.scss
Normal file
|
@ -0,0 +1,193 @@
|
|||
@import "../config";
|
||||
|
||||
.form-control {
|
||||
border: solid 1px var(--input-border-color);
|
||||
outline: none;
|
||||
padding: 0 1rem;
|
||||
line-height: 2.5rem;
|
||||
height: 2.5rem;
|
||||
width: 100%;
|
||||
background-color: var(--background-primary-color);
|
||||
border-radius: $border-radius;
|
||||
margin: 1px;
|
||||
transition: border-color $transitionTime;
|
||||
color: var(--text-primary-color);
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-color);
|
||||
border-width: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
textarea.form-control {
|
||||
height: 16rem;
|
||||
line-height: 1.1rem;
|
||||
padding: 0.6rem 1rem;
|
||||
}
|
||||
|
||||
select:-moz-focusring {
|
||||
color: transparent;
|
||||
text-shadow: 0 0 0 var(--text-primary-color);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
padding-bottom: 1rem;
|
||||
display: block;
|
||||
position: relative;
|
||||
clear: both;
|
||||
|
||||
label {
|
||||
display: block;
|
||||
padding-bottom: 0.3rem;
|
||||
padding-left: 0.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.form-switch {
|
||||
line-height: 24px;
|
||||
|
||||
input {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
opacity: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
padding: 0 0 0 44px;
|
||||
cursor: pointer;
|
||||
|
||||
&:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 0;
|
||||
width: 36px;
|
||||
height: 14px;
|
||||
background-color: var(--bg-disabled-color);
|
||||
border-radius: 14px;
|
||||
z-index: 1;
|
||||
transition: background-color 0.28s cubic-bezier(.4, 0, .2, 1);
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-color: var(--lever-disabled-color);
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
||||
z-index: 2;
|
||||
transition: all 0.28s cubic-bezier(.4, 0, .2, 1);
|
||||
transition-property: left, background-color;
|
||||
}
|
||||
|
||||
@include no-select
|
||||
}
|
||||
|
||||
input:checked + label {
|
||||
&:before {
|
||||
background-color: var(--bg-enabled-color);
|
||||
}
|
||||
|
||||
&:after {
|
||||
left: 16px;
|
||||
background-color: var(--lever-enabled-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-switch-group {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.form-btn {
|
||||
border: solid 1px var(--input-border-color);
|
||||
outline: none;
|
||||
padding: 0 1rem;
|
||||
line-height: 2rem;
|
||||
background-color: var(--background-primary-color);
|
||||
color: var(--primary-color);
|
||||
|
||||
display: inline-block;
|
||||
margin-right: 0.6rem;
|
||||
|
||||
border-radius: $border-radius;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.9rem;
|
||||
|
||||
transition: border-color $transitionTime, outline-color $transitionTime;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
&:focus, &:hover {
|
||||
border-color: var(--primary-color);
|
||||
outline-color: var(--primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--primary-color);
|
||||
color: var(--primary-text-color);
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background-color: var(--error-color);
|
||||
color: var(--error-text-color);
|
||||
border-color: var(--error-color);
|
||||
}
|
||||
|
||||
button::-moz-focus-inner, input::-moz-focus-inner, select::-moz-focus-inner {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
form {
|
||||
margin-bottom: 2rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
form {
|
||||
width: 24rem;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group {
|
||||
display: flex;
|
||||
|
||||
.form-btn {
|
||||
height: 2.5rem;
|
||||
line-height: 2.5rem;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
span {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
& > * {
|
||||
margin-right: 0;
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
|
||||
&:not(:first-child) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
&:not(:last-child) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
135
src/jsMain/resources/style/components/_menu.scss
Normal file
135
src/jsMain/resources/style/components/_menu.scss
Normal file
|
@ -0,0 +1,135 @@
|
|||
@import "../config";
|
||||
|
||||
.menu {
|
||||
background-color: var(--background-secondary-color);
|
||||
color: var(--text-primary-color);
|
||||
width: 100%;
|
||||
clear: both;
|
||||
height: 6rem;
|
||||
line-height: 6rem;
|
||||
|
||||
a {
|
||||
padding: 0 1rem;
|
||||
color: var(--text-primary-color);
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
font-family: "Bungee", sans-serif;
|
||||
font-weight: normal;
|
||||
font-size: 1.1rem;
|
||||
position: relative;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
z-index: 6;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 1rem;
|
||||
right: 1rem;
|
||||
bottom: 1.8em;
|
||||
height: 0.25rem;
|
||||
|
||||
background: transparent;
|
||||
transition: background-color $transitionTime;
|
||||
}
|
||||
|
||||
&.active::after {
|
||||
background: var(--text-primary-color);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: var(--table-border-color);
|
||||
|
||||
&::after {
|
||||
background: var(--primary-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& ~ * {
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
.menu-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.menu-right {
|
||||
float: right;
|
||||
|
||||
.menu-icon {
|
||||
display: block;
|
||||
cursor: default;
|
||||
|
||||
padding: 0 1rem;
|
||||
color: var(--text-primary-color);
|
||||
height: 100%;
|
||||
font-size: 2rem;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.menu-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: var(--background-secondary-color);
|
||||
z-index: 5;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
top: -8rem;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 8rem;
|
||||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
a {
|
||||
display: block;
|
||||
line-height: 3rem;
|
||||
|
||||
&:after {
|
||||
bottom: 0.55rem;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.menu-content {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.menu-right {
|
||||
.menu-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menu-content {
|
||||
display: block;
|
||||
position: static;
|
||||
background-color: transparent;
|
||||
z-index: unset;
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
line-height: unset;
|
||||
|
||||
&:after {
|
||||
bottom: 1.8em
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
223
src/jsMain/resources/style/components/_overview.scss
Normal file
223
src/jsMain/resources/style/components/_overview.scss
Normal file
|
@ -0,0 +1,223 @@
|
|||
@import "../config";
|
||||
|
||||
.overview {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.overview-main {
|
||||
flex-grow: 4;
|
||||
margin-right: 1rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.overview-side {
|
||||
min-width: 20%;
|
||||
}
|
||||
|
||||
.overview-twitter {
|
||||
height: 20rem;
|
||||
background-color: #b3e6f9;
|
||||
}
|
||||
|
||||
.post {
|
||||
position: relative;
|
||||
padding-top: 2rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.post-name {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
font-size: 1.2rem;
|
||||
color: var(--primary-color);
|
||||
line-height: 2rem;
|
||||
padding: 0 1rem;
|
||||
|
||||
&:empty::before {
|
||||
display: block;
|
||||
content: 'No title';
|
||||
opacity: 0.5;
|
||||
font-size: 1.2rem;
|
||||
line-height: 2rem;
|
||||
color: var(--text-primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.post-edit {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 1rem;
|
||||
line-height: 2rem;
|
||||
}
|
||||
|
||||
.post-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.post-column-left, .post-column-right {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.post-image {
|
||||
width: 100%;
|
||||
margin: 1rem 0 0;
|
||||
padding-top: 75%;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.post-no-image .post-column-left {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.post-content {
|
||||
padding: 0 1rem;
|
||||
|
||||
h1, h2, h3, h4, h5, h6, p {
|
||||
margin: 0.7rem 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
td {
|
||||
border-top: solid 1px var(--table-border-color);
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: var(--table-header-color);
|
||||
}
|
||||
|
||||
td, th {
|
||||
padding: 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.post-footer {
|
||||
color: var(--text-secondary-color);
|
||||
padding: 0 1rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 400;
|
||||
margin-top: -0.3rem;
|
||||
}
|
||||
|
||||
.post-edit-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.post-edit-right {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.post-edit-image-box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
margin-top: 0.4rem;
|
||||
|
||||
& > div:nth-child(1) {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
& > div:nth-child(2) {
|
||||
width: 80%;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.post-edit-image {
|
||||
width: 100%;
|
||||
padding-top: 75%;
|
||||
border: solid 1px var(--input-border-color);
|
||||
margin: 0;
|
||||
background-color: var(--background-primary-color);
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.overview-post {
|
||||
margin-bottom: 2rem;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
display: block;
|
||||
bottom: -1rem;
|
||||
height: 1px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: var(--table-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.post-column {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.overview-post::after {
|
||||
left: 1rem;
|
||||
right: 1rem;
|
||||
}
|
||||
|
||||
.post-content, .post-footer {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.overview-post {
|
||||
.post-column {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.post-column-left {
|
||||
width: 30%;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
.post-column-right {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.post-edit-container {
|
||||
flex-direction: row;
|
||||
}
|
||||
.post-edit-right {
|
||||
margin-left: 2rem;
|
||||
}
|
||||
.overview {
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
149
src/jsMain/resources/style/components/_table-layout.scss
Normal file
149
src/jsMain/resources/style/components/_table-layout.scss
Normal file
|
@ -0,0 +1,149 @@
|
|||
@import "../config";
|
||||
|
||||
.table-layout-search {
|
||||
float: left;
|
||||
padding-bottom: 0.5rem !important;
|
||||
}
|
||||
|
||||
.table-layout-action {
|
||||
float: right;
|
||||
line-height: 2.5rem;
|
||||
}
|
||||
|
||||
.table-layout-table {
|
||||
width: 100%;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
clear: both;
|
||||
|
||||
th {
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 0 0.6rem;
|
||||
}
|
||||
|
||||
.action {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
tr {
|
||||
border-top: solid 1px var(--table-border-color);
|
||||
|
||||
&:first-child {
|
||||
background-color: var(--table-header-color);
|
||||
height: 2.5rem;
|
||||
line-height: 2.5rem;
|
||||
}
|
||||
|
||||
&:not(:first-child) {
|
||||
height: 2rem;
|
||||
line-height: 2rem;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--table-header-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
position: relative;
|
||||
|
||||
&:empty:before {
|
||||
content: "\200b";
|
||||
}
|
||||
|
||||
&.error {
|
||||
background-color: var(--error-background-color);
|
||||
}
|
||||
}
|
||||
|
||||
.table-select-box {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
background: var(--background-primary-color);
|
||||
width: 10rem;
|
||||
border: solid 1px var(--input-border-color);
|
||||
border-radius: $border-radius;
|
||||
padding: 0.5rem 0;
|
||||
|
||||
span {
|
||||
padding: 0 0.5rem;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--table-header-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.work-group-constraints {
|
||||
position: relative;
|
||||
|
||||
& > label {
|
||||
margin-bottom: 0.8rem;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
span {
|
||||
width: 4rem;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
|
||||
&:hover::after {
|
||||
content: 'DELETE';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
|
||||
font-weight: bold;
|
||||
color: var(--primary-text-color);
|
||||
background: var(--primary-color);
|
||||
}
|
||||
}
|
||||
|
||||
.form-control {
|
||||
width: 12rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.work-group-constraints-add {
|
||||
position: absolute;
|
||||
top: -0.5rem;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.work-group-constraints-add-list {
|
||||
position: absolute;
|
||||
top: -2rem;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
display: none;
|
||||
padding: 0.5rem 0;
|
||||
|
||||
background: var(--background-primary-color);
|
||||
border: solid 1px var(--input-border-color);
|
||||
border-radius: $border-radius;
|
||||
|
||||
span {
|
||||
padding: 0 0.5rem;
|
||||
line-height: 2rem;
|
||||
display: block;
|
||||
|
||||
&:hover {
|
||||
background-color: var(--table-header-color);
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
display: block;
|
||||
}
|
||||
}
|
31
src/jsMain/resources/style/princess.scss
Normal file
31
src/jsMain/resources/style/princess.scss
Normal file
|
@ -0,0 +1,31 @@
|
|||
@import "_color.scss";
|
||||
|
||||
$background-primary-color: #ffc3e1;
|
||||
$background-secondary-color: #ffa5d2;
|
||||
|
||||
$text-primary-color: #333;
|
||||
$text-secondary-color: rgba($text-primary-color, 0.5);
|
||||
|
||||
$primary-color: #B11D33;
|
||||
$primary-text-color: #fff;
|
||||
|
||||
$error-color: #F00;
|
||||
$error-text-color: #fff;
|
||||
$error-background-color: rgba($error-color, 0.5);
|
||||
|
||||
$input-border-color: #888;
|
||||
$table-border-color: rgba($text-primary-color, 0.1);
|
||||
$table-header-color: rgba($text-primary-color, 0.06);
|
||||
|
||||
$shadow-color: rgba($text-primary-color, 0.8);
|
||||
|
||||
$icon-color-focused: rgba($text-primary-color, 0.87);
|
||||
$icon-color: rgba($text-primary-color, 0.54);
|
||||
$icon-color-inactive: rgba($text-primary-color, 0.38);
|
||||
|
||||
$bg-disabled-color: rgba($text-primary-color, .26);
|
||||
$bg-enabled-color: rgba($primary-color, .5);
|
||||
$lever-disabled-color: $background-primary-color;
|
||||
$lever-enabled-color: $primary-color;
|
||||
|
||||
@include color-setting;
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue