fix the color input styles on chrome

pull/8/head
easrng 2022-07-12 20:21:36 +00:00
parent 61c456eceb
commit e43184ab49
1 changed files with 397 additions and 388 deletions

View File

@ -1,388 +1,397 @@
*, *,
*:before, *:before,
*:after { *:after {
box-sizing: border-box; box-sizing: border-box;
} }
:root { :root {
--bg-rgb: 28, 23, 36; --bg-rgb: 28, 23, 36;
--fg-rgb: 234, 234, 248; --fg-rgb: 234, 234, 248;
--accent-rgb: 181, 127, 220; --accent-rgb: 181, 127, 220;
--fg: rgb(var(--fg-rgb)); --fg: rgb(var(--fg-rgb));
--bg: rgb(var(--bg-rgb)); --bg: rgb(var(--bg-rgb));
--default-user-color: rgb(126, 208, 255); --default-user-color: rgb(126, 208, 255);
--accent: rgb(var(--accent-rgb)); --accent: rgb(var(--accent-rgb));
--fg-transparent: rgba(var(--fg-rgb), 0.25); --fg-transparent: rgba(var(--fg-rgb), 0.25);
--bg-transparent: rgba(var(--bg-rgb), 0.25); --bg-transparent: rgba(var(--bg-rgb), 0.25);
--autocomplete-bg: linear-gradient( --autocomplete-bg: linear-gradient(
var(--fg-transparent), var(--fg-transparent),
var(--fg-transparent) var(--fg-transparent)
), ),
linear-gradient(var(--bg), var(--bg)); linear-gradient(var(--bg), var(--bg));
--chip-bg: linear-gradient( --chip-bg: linear-gradient(
var(--accent-transparent), var(--accent-transparent),
var(--accent-transparent) var(--accent-transparent)
), ),
linear-gradient(var(--bg), var(--bg)); linear-gradient(var(--bg), var(--bg));
--accent-transparent: rgba(var(--accent-rgb), 0.25); --accent-transparent: rgba(var(--accent-rgb), 0.25);
} }
html { html {
background-color: var(--bg); background-color: var(--bg);
color: var(--fg); color: var(--fg);
font-size: 1.125rem; font-size: 1.125rem;
font-family: sans-serif; font-family: sans-serif;
} }
html, html,
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
overscroll-behavior: none; overscroll-behavior: none;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
body { body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
video { video {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
} }
#video-container { #video-container {
flex-grow: 0; flex-grow: 0;
flex-shrink: 1; flex-shrink: 1;
display: none; display: none;
} }
a { a {
color: var(--accent); color: var(--accent);
} }
.chip { .chip {
color: var(--fg); color: var(--fg);
background: var(--chip-bg); background: var(--chip-bg);
text-decoration: none; text-decoration: none;
padding: 0 0.5rem 0 1.45rem; padding: 0 0.5rem 0 1.45rem;
display: inline-flex; display: inline-flex;
position: relative; position: relative;
font-size: 0.9rem; font-size: 0.9rem;
height: 1.125rem; height: 1.125rem;
align-items: center; align-items: center;
border-radius: 2rem; border-radius: 2rem;
overflow: hidden; overflow: hidden;
} }
.chip::before { .chip::before {
content: ""; content: "";
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
width: 1.125rem; width: 1.125rem;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
background: var(--accent-transparent); background: var(--accent-transparent);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 18px; background-size: 18px;
background-position: center; background-position: center;
} }
.join-chip::before { .join-chip::before {
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2ZmZiI+PHBhdGggZD0iTTggNXYxNGwxMS03eiIvPjwvc3ZnPg=="); background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2ZmZiI+PHBhdGggZD0iTTggNXYxNGwxMS03eiIvPjwvc3ZnPg==");
} }
.time-chip::before { .time-chip::before {
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2ZmZiI+PHBhdGggZD0iTTExLjk5IDJDNi40NyAyIDIgNi40OCAyIDEyczQuNDcgMTAgOS45OSAxMEMxNy41MiAyMiAyMiAxNy41MiAyMiAxMlMxNy41MiAyIDExLjk5IDJ6TTEyIDIwYy00LjQyIDAtOC0zLjU4LTgtOHMzLjU4LTggOC04IDggMy41OCA4IDgtMy41OCA4LTggOHoiLz48cGF0aCBkPSJNMTIuNSA3SDExdjZsNS4yNSAzLjE1Ljc1LTEuMjMtNC41LTIuNjd6Ii8+PC9zdmc+"); background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2ZmZiI+PHBhdGggZD0iTTExLjk5IDJDNi40NyAyIDIgNi40OCAyIDEyczQuNDcgMTAgOS45OSAxMEMxNy41MiAyMiAyMiAxNy41MiAyMiAxMlMxNy41MiAyIDExLjk5IDJ6TTEyIDIwYy00LjQyIDAtOC0zLjU4LTgtOHMzLjU4LTggOC04IDggMy41OCA4IDgtMy41OCA4LTggOHoiLz48cGF0aCBkPSJNMTIuNSA3SDExdjZsNS4yNSAzLjE1Ljc1LTEuMjMtNC41LTIuNjd6Ii8+PC9zdmc+");
} }
label { label {
display: block; display: block;
} }
input[type="url"], input[type="url"],
input[type="text"] { input[type="text"] {
background: #fff; background: #fff;
background-clip: padding-box; background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, 0.12); border: 1px solid rgba(0, 0, 0, 0.12);
border-radius: 6px; border-radius: 6px;
color: rgba(0, 0, 0, 0.8); color: rgba(0, 0, 0, 0.8);
display: block; display: block;
margin: 0.5em 0; margin: 0.5em 0;
padding: 0.5em 1em; padding: 0.5em 1em;
line-height: 1.5; line-height: 1.5;
font-family: sans-serif; font-family: sans-serif;
font-size: 1em; font-size: 1em;
width: 100%; width: 100%;
resize: none; resize: none;
overflow-x: wrap; overflow-x: wrap;
overflow-y: scroll; overflow-y: scroll;
} }
button { button {
background-color: var(--accent); background-color: var(--accent);
border: var(--accent); border: var(--accent);
border-radius: 6px; border-radius: 6px;
color: #fff; color: #fff;
padding: 0.5em 1em; padding: 0.5em 1em;
display: inline-block; display: inline-block;
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
vertical-align: middle; vertical-align: middle;
font-family: sans-serif; font-family: sans-serif;
font-size: 1em; font-size: 1em;
width: 100%; width: 100%;
user-select: none; user-select: none;
border: 1px solid rgba(0, 0, 0, 0); border: 1px solid rgba(0, 0, 0, 0);
line-height: 1.5; line-height: 1.5;
cursor: pointer; cursor: pointer;
margin: 0.5em 0; margin: 0.5em 0;
} }
button:disabled { button:disabled {
filter: saturate(0.75); filter: saturate(0.75);
opacity: 0.75; opacity: 0.75;
cursor: default; cursor: default;
} }
button.small-button { button.small-button {
font-size: 0.75em; font-size: 0.75em;
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
} }
.subtitle-track-group { .subtitle-track-group {
display: flex; display: flex;
} }
.subtitle-track-group > * { .subtitle-track-group > * {
margin-top: 0 !important; margin-top: 0 !important;
margin-bottom: 0 !important; margin-bottom: 0 !important;
margin-right: 1ch !important; margin-right: 1ch !important;
} }
#pre-join-controls, #pre-join-controls,
#create-controls { #create-controls {
margin: 0; margin: 0;
flex-grow: 1; flex-grow: 1;
overflow-y: auto; overflow-y: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
#join-session-form, #join-session-form,
#create-session-form { #create-session-form {
width: 500px; width: 500px;
max-width: 100%; max-width: 100%;
padding: 1rem; padding: 1rem;
} }
#join-session-form > *:first-child, #join-session-form > *:first-child,
#create-session-form > *:first-child { #create-session-form > *:first-child {
margin-top: 0; margin-top: 0;
} }
#post-create-message { #post-create-message {
display: none; display: none;
width: 100%; width: 100%;
font-size: 0.85em; font-size: 0.85em;
} }
#chatbox-container { #chatbox-container {
display: none; display: none;
} }
.chat-message { .chat-message {
overflow-wrap: break-word; overflow-wrap: break-word;
margin-bottom: 0.125rem; margin-bottom: 0.125rem;
} }
.chat-message > strong, .chat-message > strong,
#viewer-list strong { #viewer-list strong {
color: var(--user-color, var(--default-user-color)); color: var(--user-color, var(--default-user-color));
} }
.chat-message.user-join, .chat-message.user-join,
.chat-message.user-leave, .chat-message.user-leave,
.chat-message.ping { .chat-message.ping {
font-style: italic; font-style: italic;
} }
.chat-message.set-time, .chat-message.set-time,
.chat-message.set-playing, .chat-message.set-playing,
.chat-message.join-session { .chat-message.join-session {
font-style: italic; font-style: italic;
text-align: right; text-align: right;
font-size: 0.85em; font-size: 0.85em;
} }
.chat-message.command-message { .chat-message.command-message {
font-size: 0.85em; font-size: 0.85em;
} }
.chat-message.set-time > strong, .chat-message.set-time > strong,
.chat-message.set-playing > strong, .chat-message.set-playing > strong,
.chat-message.join-session > strong { .chat-message.join-session > strong {
color: unset !important; color: unset !important;
} }
.emoji { .emoji {
width: 2ch; width: 2ch;
height: 2ch; height: 2ch;
object-fit: contain; object-fit: contain;
margin-bottom: -0.35ch; margin-bottom: -0.35ch;
} }
#chatbox { #chatbox {
padding: 0.5em 1em; padding: 0.5em 1em;
overflow-y: scroll; overflow-y: scroll;
flex-shrink: 1; flex-shrink: 1;
flex-grow: 1; flex-grow: 1;
} }
#viewer-list { #viewer-list {
padding: 0.5em 1em; padding: 0.5em 1em;
/* TODO: turn this into max-height instead of fixed height without breaking the chatbox height */ /* TODO: turn this into max-height instead of fixed height without breaking the chatbox height */
overflow-y: scroll; overflow-y: scroll;
border-bottom: var(--fg-transparent); border-bottom: var(--fg-transparent);
border-bottom-style: solid; border-bottom-style: solid;
max-height: 4rem; max-height: 4rem;
flex-shrink: 0; flex-shrink: 0;
} }
#chatbox-container { #chatbox-container {
background-color: var(--bg); background-color: var(--bg);
flex-direction: column; flex-direction: column;
flex-grow: 1; flex-grow: 1;
flex-shrink: 1; flex-shrink: 1;
flex-basis: 36ch; flex-basis: 36ch;
min-width: 36ch; min-width: 36ch;
overflow: hidden; overflow: hidden;
} }
#chatbox-send { #chatbox-send {
padding: 0 1em; padding: 0 1em;
padding-bottom: 0.5em; padding-bottom: 0.5em;
position: relative; position: relative;
} }
#chatbox-send > input { #chatbox-send > input {
font-size: 0.75em; font-size: 0.75em;
width: 100%; width: 100%;
} }
#emoji-autocomplete { #emoji-autocomplete {
position: absolute; position: absolute;
bottom: 3.25rem; bottom: 3.25rem;
background-image: var(--autocomplete-bg); background-image: var(--autocomplete-bg);
border-radius: 6px; border-radius: 6px;
width: calc(100% - 2rem); width: calc(100% - 2rem);
max-height: 8.5rem; max-height: 8.5rem;
overflow-y: auto; overflow-y: auto;
clip-path: inset(0 0 0 0 round 8px); clip-path: inset(0 0 0 0 round 8px);
} }
#emoji-autocomplete:empty { #emoji-autocomplete:empty {
display: none; display: none;
} }
.emoji-option { .emoji-option {
background: transparent; background: transparent;
font-size: 0.75rem; font-size: 0.75rem;
text-align: left; text-align: left;
margin: 0 0.25rem; margin: 0 0.25rem;
border-radius: 4px; border-radius: 4px;
width: calc(100% - 0.5rem); width: calc(100% - 0.5rem);
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0.25rem 0.5rem; padding: 0.25rem 0.5rem;
scroll-margin: 0.25rem; scroll-margin: 0.25rem;
} }
.emoji-option:first-child { .emoji-option:first-child {
margin-top: 0.25rem; margin-top: 0.25rem;
} }
.emoji-option:last-child { .emoji-option:last-child {
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
} }
.emoji-option .emoji { .emoji-option .emoji {
width: 1.25rem; width: 1.25rem;
height: 1.25rem; height: 1.25rem;
margin: 0 0.5rem 0 0; margin: 0 0.5rem 0 0;
font-size: 2.25ch; font-size: 2.25ch;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
overflow: hidden; overflow: hidden;
flex-shrink: 0; flex-shrink: 0;
} }
.emoji-name { .emoji-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.emoji-option.selected { .emoji-option.selected {
background: var(--fg-transparent); background: var(--fg-transparent);
} }
#join-session-colour { #join-session-colour {
-moz-appearance: none; -moz-appearance: none;
-webkit-appearance: none; -webkit-appearance: none;
appearance: none; appearance: none;
border: none; border: none;
padding: 0; padding: 0;
border-radius: 6px; border-radius: 6px;
overflow: hidden; overflow: hidden;
margin: 0.5em 0; margin: 0.5em 0;
height: 2rem; height: 2rem;
width: 2.5rem; width: 2.5rem;
cursor: pointer; cursor: pointer;
} }
input[type="color"]::-moz-color-swatch, input[type="color"]::-moz-color-swatch {
input[type="color"]::-webkit-color-swatch, border: none;
input[type="color"]::-webkit-color-swatch-wrapper { margin: 0;
/* This *should* be working in Chrome, but it doesn't for reasons that are beyond me. */ padding: 0;
border: none; }
margin: 0;
padding: 0; input[type="color"]::-webkit-color-swatch {
} border: none;
margin: 0;
@media (min-aspect-ratio: 4/3) { padding: 0;
body { }
flex-direction: row;
} input[type="color"]::-webkit-color-swatch-wrapper {
border: none;
#chatbox-container { margin: 0;
height: 100vh !important; padding: 0;
flex-grow: 0; }
}
@media (min-aspect-ratio: 4/3) {
#video-container { body {
flex-grow: 1; flex-direction: row;
} }
#chatbox { #chatbox-container {
height: calc(100vh - 5em - 4em) !important; height: 100vh !important;
} flex-grow: 0;
} }
#video-container {
flex-grow: 1;
}
#chatbox {
height: calc(100vh - 5em - 4em) !important;
}
}