/* Chat: cream paper slips with the name on a washi-tape label ("style 5" from the chat preview). The box sits under the webcam (Game scene: camera group at 1920,600, 640x360 on the 2560 canvas = 1440,450 480x270 on this 1920x1080 page). Newest message on top, slides out from under the camera, older ones are pushed down and dissolve at the bottom edge. Per browser source: ?chat=left,top,width,height (px of the 1920x1080 page) and ?chatflow=up (newest at the bottom), e.g. the Intermission panel: ?parts=chat&chat=130,640,700,360&chatflow=up. Default (no ?chat): under the camera, flowing down. */ #chat { --chat-left: 78%; --chat-top: 63%; /* 680px: just above the bottom of the camera ring, so messages come out from under it */ --chat-width: 20%; --chat-height: 34%; /* down to the bottom edge */ --ink: #3a2a20; --cream: #fffdf7; position: fixed; left: var(--chat-left); top: var(--chat-top); width: var(--chat-width); height: var(--chat-height); display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; padding: 26px 8px 0; overflow: hidden; -webkit-mask-image: linear-gradient(transparent 0, #000 30px, #000 calc(100% - 60px), transparent); mask-image: linear-gradient(transparent 0, #000 30px, #000 calc(100% - 60px), transparent); } /* up: like a normal chat, newest at the bottom, the oldest fade out at the top */ #chat.up { justify-content: flex-end; padding: 14px 8px 8px; -webkit-mask-image: linear-gradient(transparent 0, #000 50px); mask-image: linear-gradient(transparent 0, #000 50px); } #chat.up .msg.in { animation-name: chat-in-up; } @keyframes chat-in-up { from { opacity: 0; transform: translateY(24px) rotate(calc(var(--tilt, 0deg) * -3)) scale(.95); } } #chat .msg { position: relative; flex: none; margin: 9px 6px 0; padding: 19px 14px 9px; border-radius: 2px; background: var(--cream); color: var(--ink); font: 800 17px/1.3 Nunito, sans-serif; word-break: break-word; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); transform: rotate(var(--tilt, 0deg)); } #chat .msg.action { font-style: italic; } /* the name on a strip of washi tape, tinted with the chatter's Twitch colour */ #chat .msg .u { position: absolute; top: -12px; left: 10px; max-width: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 12px 2px; font: 700 23px/1 Caveat, cursive; color: var(--ink); background-color: var(--tape, rgba(201, 182, 228, .92)); background-image: repeating-linear-gradient(45deg, #fff5 0 6px, #0000 6px 12px); transform: rotate(calc(var(--tilt, 0deg) * -2)); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); clip-path: polygon(0 8%, 3% 0, 97% 4%, 100% 0, 98% 100%, 2% 94%); } /* emotes (Twitch + 7TV). Zero-width 7TV emotes (RainTime, PETPET...) stack on the emote before them. */ #chat .em { position: relative; display: inline-grid; vertical-align: -0.45em; margin: 0 1px; } #chat .em > img { grid-area: 1 / 1; height: 1.6em; width: auto; justify-self: center; align-self: center; filter: drop-shadow(0 0 1px rgba(58, 42, 32, .55)); } /* white emotes (Clap...) stay visible on cream */ #chat .msg.big .em > img { height: 2.6em; } /* emote-only messages: bigger emotes */ #chat .msg.in { animation: chat-in .45s cubic-bezier(.2, 1.3, .4, 1) both; } #chat .msg.out { animation: chat-out .6s ease-in both; } @keyframes chat-in { from { opacity: 0; transform: translateY(-24px) rotate(calc(var(--tilt, 0deg) * -3)) scale(.95); } } @keyframes chat-out { to { opacity: 0; transform: translate(40px, 30px) rotate(calc(var(--tilt, 0deg) + 12deg)); } }