diff --git a/web/components/layouts/AdminLayout.tsx b/web/components/layouts/AdminLayout.tsx index 4df70a6a4..c6f44cb85 100644 --- a/web/components/layouts/AdminLayout.tsx +++ b/web/components/layouts/AdminLayout.tsx @@ -1,15 +1,37 @@ +/* eslint-disable @next/next/no-css-tags */ import { AppProps } from 'next/app'; import { FC } from 'react'; import ServerStatusProvider from '../../utils/server-status-context'; import AlertMessageProvider from '../../utils/alert-message-context'; import { MainLayout } from '../MainLayout'; +/* +NOTE: A bunch of compiled css is loaded here for the Admin UI. +These are old stylesheets that were converted from sass and should not be +edited or maintained. Instead we are using css modules everywhere. So if you +need to change a style rewrite the css file as a css module and import it +into the component that needs it, removing it from this global list. +*/ export const AdminLayout: FC = ({ Component, pageProps }) => ( - - - - - - - + <> + + + + + + + + + + + + + + + + + + + + ); diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx index bcc77c582..aed8dd49b 100644 --- a/web/pages/_app.tsx +++ b/web/pages/_app.tsx @@ -6,22 +6,6 @@ import '../styles/variables.css'; import '../styles/global.less'; import '../styles/globals.scss'; import '../styles/ant-overrides.scss'; -// import '../styles/markdown-editor.scss'; - -import '../styles/main-layout.scss'; - -import '../styles/form-textfields.scss'; -import '../styles/form-misc-elements.scss'; -import '../styles/config-socialhandles.scss'; -import '../styles/config-storage.scss'; -import '../styles/config-edit-string-tags.scss'; -import '../styles/config-video-variants.scss'; -import '../styles/config-public-details.scss'; - -import '../styles/home.scss'; -import '../styles/chat.scss'; -import '../styles/pages.scss'; -import '../styles/offline-notice.scss'; import '../components/video/VideoJS/VideoJS.scss'; diff --git a/web/public/styles/admin/chat.css b/web/public/styles/admin/chat.css new file mode 100644 index 000000000..bcf73257c --- /dev/null +++ b/web/public/styles/admin/chat.css @@ -0,0 +1 @@ +.chat-messages .ant-table-cell.name-col{text-overflow:ellipsis;overflow:hidden}.chat-messages .ant-table-cell.toggle-col label{font-size:0.7rem}.chat-messages .ant-table-cell .message-contents{overflow:auto;max-height:200px}.chat-messages .ant-table-cell .message-contents img{position:relative;margin-top:-5px;width:3rem;padding:0.25rem}.chat-messages .ant-table-cell .message-contents p{margin-bottom:0}.chat-messages .bulk-editor{margin:0.5rem 0;padding:0.5rem;border:1px solid var(--textfield-border);display:flex;flex-direction:row;align-items:center;justify-content:flex-end;border-radius:4px}.chat-messages .bulk-editor.active .label{color:var(--black-3)}.chat-messages .bulk-editor .label{font-size:0.75rem;color:var(--white-50);margin-right:0.5rem}.chat-messages .bulk-editor button{margin:0 0.2rem;font-size:0.75rem}.ant-table-filter-dropdown{max-width:250px}.toggle-switch{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;justify-content:flex-end;transition:opacity 0.15s}.toggle-switch .outcome-icon{margin-right:0.5rem}.toggle-switch.hidden{opacity:0.25}.toggle-switch.hidden:hover{opacity:1}.toggle-switch .ant-btn .anticon{opacity:0.5}.toggle-switch .ant-btn:hover .anticon{opacity:1}.toggle-switch .ant-btn-text:hover{background-color:var(--black-35)}.blockuser-popover{max-width:400px}.user-item-container{border:none;background:none;text-align:left;padding:0;margin:0;cursor:pointer;outline:none}.user-item-container .display-name{color:var(--white);border-bottom:1px dotted var(--white-50)}.user-item-container:hover .display-name{border-color:var(--white)}.user-details h5{color:var(--white)}.user-details .created-at{font-size:0.75em;font-style:italic}.user-details .connection-info{font-size:0.88em}.user-details .previous-names-list{font-size:0.88em}.user-details .previous-names-list .user-name-item{font-family:monospace}.user-details .previous-names-list .latest{font-style:italic}.user-details .previous-names-list .latest .user-name-item{font-weight:bold;font-style:normal;color:var(--pink)}.user-details .ant-divider{border-color:var(--white-25)}.block-user-button{text-transform:capitalize} diff --git a/web/public/styles/admin/config-edit-string-tags.css b/web/public/styles/admin/config-edit-string-tags.css new file mode 100644 index 000000000..41a973e01 --- /dev/null +++ b/web/public/styles/admin/config-edit-string-tags.css @@ -0,0 +1 @@ +.edit-current-strings .ant-tag{margin:0.1rem;font-size:0.85rem;border-radius:10em;padding:0.25em 1em}.edit-current-strings .ant-tag:hover{opacity:1}.edit-current-strings .ant-tag .ant-tag-close-icon{transform:translateY(-1px);margin-left:0.3rem;padding:2px;border-radius:5rem;color:var(--black);border:1px solid var(--black);transition-duration:var(--ant-transition-duration)}.edit-current-strings .ant-tag .ant-tag-close-icon:hover{border-color:var(--owncast-purple);background-color:var(--white)}.edit-current-strings .ant-tag .ant-tag-close-icon:hover svg{fill:black;transition:fill var(--ant-transition-duration)}.add-new-string-section{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;margin-top:2em}.continuous-status-section{margin-top:1em} diff --git a/web/public/styles/admin/config-public-details.css b/web/public/styles/admin/config-public-details.css new file mode 100644 index 000000000..9d46e0094 --- /dev/null +++ b/web/public/styles/admin/config-public-details.css @@ -0,0 +1 @@ +.config-public-details-page{width:100%}.config-public-details-page .top-container{display:flex;flex-direction:row;flex-wrap:nowrap}@media (max-width: 1200px){.config-public-details-page .top-container{flex-wrap:wrap}.config-public-details-page .top-container .social-items-container{display:flex;flex-direction:row;justify-content:space-around;flex-wrap:nowrap;margin:1em 0;width:100%;max-width:none}.config-public-details-page .top-container .social-items-container .tags-module{margin-right:1em}.config-public-details-page .top-container .social-items-container .form-module{max-width:none}}@media (max-width: 1200px) and (max-width: 980px){.config-public-details-page .top-container .social-items-container{flex-direction:column}.config-public-details-page .top-container .social-items-container .form-module{width:100%}.config-public-details-page .top-container .social-items-container .tags-module{margin-bottom:0}}.config-public-details-page .instance-details-container{width:100%}.config-public-details-page .social-items-container{background-color:var(--container-bg-color-alt);padding:0 0.75em;margin-left:1em;max-width:450px}.config-public-details-page .social-items-container .form-module{background-color:var(--black)}.config-public-details-page .social-items-container .social-handles-container{min-width:350px}.config-public-details-page .instance-details-container,.config-public-details-page .page-content-module{margin:1em 0}.config-public-details-page .field-summary textarea{height:6em !important}.config-public-details-page .edit-custom-css #field-customStyles{height:15em;width:100%;font-family:monospace;resize:auto}.other-field-container{margin:0.5em 0}.logo-upload-container .input-group{align-items:center}.logo-upload-container img.logo-preview{min-height:120px;min-width:120px;max-height:256px;max-width:256px;margin-right:1em;display:inline-block;border:1px solid var(--white-25)} diff --git a/web/public/styles/admin/config-socialhandles.css b/web/public/styles/admin/config-socialhandles.css new file mode 100644 index 000000000..a6ab4e12c --- /dev/null +++ b/web/public/styles/admin/config-socialhandles.css @@ -0,0 +1 @@ +.social-option .ant-select-item-option-content,.social-option .ant-select-selection-item,.social-dropdown .ant-select-item-option-content,.social-dropdown .ant-select-selection-item{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;padding:0.25em;line-height:normal}.social-option .ant-select-item-option-content .option-icon,.social-option .ant-select-selection-item .option-icon,.social-dropdown .ant-select-item-option-content .option-icon,.social-dropdown .ant-select-selection-item .option-icon{height:1.5em;width:1.5em;line-height:normal}.social-option .ant-select-item-option-content .option-label,.social-option .ant-select-selection-item .option-label,.social-dropdown .ant-select-item-option-content .option-label,.social-dropdown .ant-select-selection-item .option-label{display:inline-block;margin-left:1em;line-height:normal;word-break:break-word}.social-links-edit-container .social-handles-table .social-handle-cell{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;color:var(--white-75)}.social-links-edit-container .social-handles-table .social-handle-cell .option-icon{height:2em;width:2em;line-height:normal}.social-links-edit-container .social-handles-table .social-handle-cell .option-label{display:flex;flex-direction:column;margin:0 0 0 1em;line-height:2;font-size:0.85em;word-break:break-word}.social-links-edit-container .social-handles-table .actions{display:flex;flex-direction:row;align-items:center;justify-content:space-evenly;width:6em} diff --git a/web/public/styles/admin/config-storage.css b/web/public/styles/admin/config-storage.css new file mode 100644 index 000000000..24db84c31 --- /dev/null +++ b/web/public/styles/admin/config-storage.css @@ -0,0 +1 @@ +.edit-storage-container{padding:1em}.edit-storage-container .form-fields{display:none;margin-bottom:1em}.edit-storage-container.enabled .form-fields{display:block}.edit-storage-container .button-container{margin:2em 0 1em 0}.edit-storage-container .advanced-section{margin:1em 0}.edit-server-details-container .field-streamkey-container{margin-bottom:1.5em}.edit-server-details-container .field-streamkey-container .field-tip{color:var(--ant-warning)}.edit-server-details-container .field-streamkey-container .left-side{display:flex;flex-direction:row;align-items:flex-start}.edit-server-details-container .field-streamkey-container .textfield-with-submit-container{margin-bottom:0}.edit-server-details-container .field-streamkey-container .streamkey-actions{white-space:nowrap}.edit-server-details-container .field-streamkey-container .streamkey-actions button{margin:0.25em}@media (max-width: 800px){.edit-server-details-container .field-streamkey-container .streamkey-actions{margin-top:2em}}.edit-server-details-container .advanced-settings{max-width:800px} diff --git a/web/public/styles/admin/config-video-variants.css b/web/public/styles/admin/config-video-variants.css new file mode 100644 index 000000000..2cafdc127 --- /dev/null +++ b/web/public/styles/admin/config-video-variants.css @@ -0,0 +1 @@ +.config-video-variants .variants-table{margin-top:2em}.config-video-variants .variants-table-module{min-width:400px}.config-variant-form .description{margin-top:0}.config-variant-form .passthrough-warning{text-align:center;padding:1em;color:var(--ant-warning);font-size:0.88em;font-weight:500;background-color:var(--black-50);border-radius:var(--container-border-radius)}.config-variant-form .cpu-usage-container,.config-variant-form .bitrate-container{min-height:22em}.config-variant-form .advanced-settings{margin-top:1em}.config-variant-form .advanced-settings .resolution-module,.config-variant-form .advanced-settings .video-passthrough-module{min-height:30em}.config-variant-form.video-passthrough-enabled .form-module:not(.video-passthrough-module){opacity:0.25;cursor:not-allowed}.variants-table .actions{display:flex;align-items:center;justify-content:center}.variants-table .delete-button{margin-left:0.5em;opacity:0.8}.read-more-subtext{font-size:0.8rem}.codec-module .ant-collapse-content-active{background-color:var(--white-15)} diff --git a/web/public/styles/admin/form-misc-elements.css b/web/public/styles/admin/form-misc-elements.css new file mode 100644 index 000000000..af4fba38d --- /dev/null +++ b/web/public/styles/admin/form-misc-elements.css @@ -0,0 +1 @@ +.status-container{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;font-size:0.75rem}.status-container.status-success{color:var(--ant-success)}.status-container.status-error{color:var(--ant-error)}.status-container.status-warning{color:var(--ant-warning)}.status-container.empty{display:none}.status-container .status-icon{display:inline-block;margin-right:0.5em}.field-tip{font-size:0.8em;color:var(--white-50)}.field-container{padding:0.85em 0 0.5em}.segment-slider-container{width:100%;margin:auto;padding:1em 2em 0.75em;background-color:var(--owncast-purple-25);border-radius:var(--container-border-radius)}.segment-slider-container .status-container{width:100%;margin:0.5em auto;text-align:center}.segment-slider-container .selected-value-note{width:100%;margin:3em auto 0;text-align:center;font-size:0.75em;line-height:normal;color:var(--white);padding:1em;border-radius:var(--container-border-radius);background-color:var(--black-35)}.segment-tip{width:10em;text-align:center;margin:auto;display:inline-block}#selected-codec-note{margin-top:8px;text-align:justify;line-height:1.4em} diff --git a/web/public/styles/admin/form-textfields.css b/web/public/styles/admin/form-textfields.css new file mode 100644 index 000000000..6df440343 --- /dev/null +++ b/web/public/styles/admin/form-textfields.css @@ -0,0 +1 @@ +.formfield-container{--form-label-container-width: 15em;display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;width:100%;max-width:600px}.formfield-container .label-side{padding-right:1.25em;text-align:right;width:var(--form-label-container-width);margin:0.2em 0}.formfield-container .formfield-label{font-weight:500;font-size:1em;color:var(--owncast-purple)}.formfield-container .formfield-label::after{content:':'}.formfield-container.required .formfield-label::before{content:'*';display:inline-block;margin-right:0.25em;color:var(--ant-error)}.formfield-container .input-side{max-width:500px;width:100%}.formfield-container .input-group{display:flex;flex-direction:row;justify-content:flex-start;align-items:center}.formfield-container .status-container{margin:0.25em;width:100%;display:block}.formfield-container .status-container.empty{display:none;visibility:visible}.formfield-container .field-tip{margin:0.5em 0.5em}@media (max-width: 800px){.formfield-container{flex-wrap:wrap}.formfield-container .label-side{width:100%;text-align:left}}.textfield-with-submit-container{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:1em}.textfield-with-submit-container .textfield-component{width:100%}.textfield-with-submit-container .textfield-component .textfield-container .field-tip,.textfield-with-submit-container .textfield-component .textfield-container .status-container{display:none}.textfield-with-submit-container .lower-container{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start}.textfield-with-submit-container .lower-container .label-spacer{width:var(--form-label-container-width)}.textfield-with-submit-container .lower-container .lower-content{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-end;width:100%}.textfield-with-submit-container .lower-container .lower-content .field-tip{margin-right:1em;width:100%}.textfield-with-submit-container .lower-container .lower-content .status-container{margin:0.5em}.textfield-with-submit-container .lower-container .lower-content .status-container.empty{display:none}.textfield-with-submit-container .lower-container .update-button-container{visibility:hidden;margin:0.25em 0}.textfield-with-submit-container.submittable .lower-container .update-button-container{visibility:visible}@media (max-width: 800px){.textfield-with-submit-container .label-spacer{display:none}}.toggleswitch-container{margin:2em 0 1em}.toggleswitch-container .label-side{margin-top:0}.toggleswitch-container .input-group{display:flex;flex-direction:row;justify-content:flex-start;align-items:center}.toggleswitch-container .input-group .status-container{width:auto;margin:0 0 0 1em;display:inline-block} diff --git a/web/public/styles/admin/home.css b/web/public/styles/admin/home.css new file mode 100644 index 000000000..3c8558abe --- /dev/null +++ b/web/public/styles/admin/home.css @@ -0,0 +1 @@ +.home-container .online-status-section{margin-bottom:1em}.home-container .online-status-section .online-details-card{border-color:var(--online-color)}.home-container .stream-details-item-container{margin:1em 0}.home-container .stream-details-item-container:first-of-type{margin-top:0}.home-container .stream-details>.ant-card-bordered{border-color:rgba(255,255,255,0.1)}.home-container .outbound-details{margin-bottom:1em}.offline-content .list-section{background-color:var(--container-bg-color-alt);border-radius:var(--container-border-radius);padding:1em}.offline-content .list-section>.ant-card{background-color:var(--black);margin-bottom:1em}.offline-intro{display:flex;flex-direction:row;justify-content:space-evenly;align-items:center;margin-bottom:2em}.offline-intro .logo-svg{height:6em;width:6em}.news-feed{margin-top:0;padding:1.5em}.news-feed h2{font-size:1.2em;margin-top:0;color:var(--pink)}.news-feed article{padding:1em 0.25em;font-size:0.9rem;color:var(--white-75);border-bottom:1px solid var(--gray)}.news-feed article h3{font-size:1.2em}.news-feed article h3 a{font-weight:400;font-size:1em}.news-feed article .timestamp{margin-top:0;font-size:0.75em;color:var(--white-50)} diff --git a/web/public/styles/admin/main-layout.css b/web/public/styles/admin/main-layout.css new file mode 100644 index 000000000..e67660ea7 --- /dev/null +++ b/web/public/styles/admin/main-layout.css @@ -0,0 +1 @@ +.app-container .side-nav{position:fixed;height:100vh;overflow:auto;z-index:10;background-color:var(--nav-bg-color)}.app-container .menu-container{border-color:transparent}.app-container h1.owncast-title{padding:1rem;padding-bottom:4px;display:flex;flex-direction:row;justify-content:center;align-items:center}.app-container h1.owncast-title .logo-container{background-color:var(--white);padding-top:4px;padding-right:6px;padding-left:6px;border-radius:9999px}.app-container h1.owncast-title .title-label{display:inline-block;margin-left:1rem;color:var(--white);font-size:1.15rem;font-weight:200;text-transform:uppercase;line-height:normal;letter-spacing:0.05em}.app-container .layout-main{margin-left:240px}.app-container .layout-header{display:flex;flex-direction:row;justify-content:flex-end;padding-right:1rem;padding-left:1rem;background-color:var(--nav-bg-color)}.app-container .main-content-container{padding:2em 3em 3em;min-width:50vw}.app-container .footer-container{text-align:center}.app-container .online-status-indicator{display:flex;flex-direction:row;justify-content:center;align-items:center}.app-container .online-status-indicator .online-thumbnail{width:12.5rem}.app-container .online-status-indicator .status-label{color:var(--white);text-transform:uppercase;font-size:0.75rem;display:inline-block;margin-right:0.5rem;color:var(--offline-color)}.app-container .online-status-indicator .status-icon{font-size:1.5rem}.app-container .online-status-indicator .status-icon svg{fill:var(--offline-color)}.app-container.online .online-status-indicator .status-icon svg{fill:var(--online-color)}.app-container.online .online-status-indicator .status-label{white-space:nowrap;color:var(--online-color)}.global-stream-title-container{display:flex;justify-content:center;align-items:center;width:100%}.global-stream-title-container .textfield-with-submit-container{flex-direction:row;justify-content:center;align-items:center;margin-bottom:0}.global-stream-title-container .textfield-with-submit-container .input-side{width:400px}@media (max-width: 800px){.global-stream-title-container .textfield-with-submit-container .input-side{width:auto}}.global-stream-title-container .textfield-with-submit-container .label-side{display:none}.global-stream-title-container .textfield-with-submit-container .lower-container{width:auto}.global-stream-title-container .textfield-with-submit-container .lower-container .lower-content{flex-direction:column-reverse;position:relative}.global-stream-title-container .textfield-with-submit-container .lower-container .label-spacer,.global-stream-title-container .textfield-with-submit-container .lower-container .field-tip{display:none}.global-stream-title-container .textfield-with-submit-container .lower-container .status-container{line-height:1;position:absolute;bottom:-2em}.global-stream-title-container .textfield-with-submit-container .lower-container .update-button-container{margin:0;margin-left:0.5em;line-height:1} diff --git a/web/public/styles/admin/offline-notice.css b/web/public/styles/admin/offline-notice.css new file mode 100644 index 000000000..54036cc18 --- /dev/null +++ b/web/public/styles/admin/offline-notice.css @@ -0,0 +1 @@ +.stream-info-box{background-color:var(--purple-dark);color:var(--white);padding:0.25rem 0.5rem;margin:0 !important}.stream-info-box .ant-typography-copy{margin-left:0.25rem}.stream-info-label{align-self:center;text-align:right;margin:0}.stream-info-container{margin:8px 0 4px 0;display:grid;grid-template-columns:max-content 1fr;grid-template-rows:min-content min-content;gap:8px 8px;grid-template-areas:'. .' '. .'} diff --git a/web/public/styles/admin/pages.css b/web/public/styles/admin/pages.css new file mode 100644 index 000000000..4179d137a --- /dev/null +++ b/web/public/styles/admin/pages.css @@ -0,0 +1 @@ +.upgrade-page h2,.upgrade-page h3{color:var(--pink);font-size:1.25em} diff --git a/web/styles/chat.scss b/web/styles/chat.scss deleted file mode 100644 index 3b07f005c..000000000 --- a/web/styles/chat.scss +++ /dev/null @@ -1,148 +0,0 @@ -// Users, Chat views - -.chat-messages { - .ant-table-cell { - &.name-col { - text-overflow: ellipsis; - overflow: hidden; - } - &.toggle-col { - label { - font-size: 0.7rem; - } - } - - .message-contents { - overflow: auto; - max-height: 200px; - img { - position: relative; - margin-top: -5px; - width: 3rem; - padding: 0.25rem; - } - p { - margin-bottom: 0; - } - } - } - - .bulk-editor { - margin: 0.5rem 0; - padding: 0.5rem; - border: 1px solid var(--textfield-border); - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-end; - border-radius: 4px; - &.active { - .label { - color: var(--black-3); - } - } - - .label { - font-size: 0.75rem; - color: var(--white-50); - margin-right: 0.5rem; - } - - button { - margin: 0 0.2rem; - font-size: 0.75rem; - } - } -} -.ant-table-filter-dropdown { - max-width: 250px; -} - -.toggle-switch { - display: flex; - flex-direction: row; - align-items: center; - flex-wrap: nowrap; - justify-content: flex-end; - transition: opacity 0.15s; - - .outcome-icon { - margin-right: 0.5rem; - } - &.hidden { - opacity: 0.25; - &:hover { - opacity: 1; - } - } - .ant-btn { - .anticon { - opacity: 0.5; - } - &:hover { - .anticon { - opacity: 1; - } - } - } - .ant-btn-text:hover { - background-color: var(--black-35); - } -} - -.blockuser-popover { - max-width: 400px; -} - -.user-item-container { - // reset