fix some styles
This commit is contained in:
@@ -1,10 +1,6 @@
|
|||||||
<!--
|
<!--
|
||||||
todo
|
todo
|
||||||
- clean up commented out css
|
|
||||||
- fix / consolidate responsive styles
|
- fix / consolidate responsive styles
|
||||||
- consolidate utils
|
|
||||||
- remove unused files
|
|
||||||
- reorg /js
|
|
||||||
- standalone video.html
|
- standalone video.html
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -62,8 +62,9 @@ export default class ChatInput extends Component {
|
|||||||
initialCategory: 'custom',
|
initialCategory: 'custom',
|
||||||
showPreview: false,
|
showPreview: false,
|
||||||
emojiSize: '30px',
|
emojiSize: '30px',
|
||||||
emojisPerRow: 6,
|
// emojisPerRow: 6,
|
||||||
position: 'top'
|
position: 'right-start',
|
||||||
|
strategy: 'absolute',
|
||||||
});
|
});
|
||||||
this.emojiPicker.on('emoji', emoji => {
|
this.emojiPicker.on('emoji', emoji => {
|
||||||
this.handleEmojiSelected(emoji);
|
this.handleEmojiSelected(emoji);
|
||||||
@@ -260,10 +261,12 @@ export default class ChatInput extends Component {
|
|||||||
type="button"
|
type="button"
|
||||||
style=${emojiButtonStyle}
|
style=${emojiButtonStyle}
|
||||||
onclick=${this.handleEmojiButtonClick}
|
onclick=${this.handleEmojiButtonClick}
|
||||||
|
disabled=${!inputEnabled}
|
||||||
>😏</button>
|
>😏</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onclick=${this.handleSubmitChatButton}
|
onclick=${this.handleSubmitChatButton}
|
||||||
|
disabled=${!inputEnabled}
|
||||||
type="button"
|
type="button"
|
||||||
id="button-submit-message"
|
id="button-submit-message"
|
||||||
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded"
|
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded"
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ import { h, Component, Fragment } from 'https://unpkg.com/preact?module';
|
|||||||
import htm from 'https://unpkg.com/htm?module';
|
import htm from 'https://unpkg.com/htm?module';
|
||||||
const html = htm.bind(h);
|
const html = htm.bind(h);
|
||||||
|
|
||||||
import UsernameForm from './components/chat/username.js';
|
import Chat from './components/chat/chat.js';
|
||||||
import Chat from './components/chat.js';
|
|
||||||
import Websocket from './utils/websocket.js';
|
import Websocket from './utils/websocket.js';
|
||||||
|
|
||||||
import { getLocalStorage, generateAvatar, generateUsername } from './utils/helpers.js';
|
import { getLocalStorage, generateAvatar, generateUsername } from './utils/helpers.js';
|
||||||
import { KEY_USERNAME, KEY_AVATAR } from '../utils/constants.js';
|
import { KEY_USERNAME, KEY_AVATAR } from './utils/constants.js';
|
||||||
|
|
||||||
export default class StandaloneChat extends Component {
|
export default class StandaloneChat extends Component {
|
||||||
constructor(props, context) {
|
constructor(props, context) {
|
||||||
@@ -36,12 +34,9 @@ export default class StandaloneChat extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render(props, state) {
|
render(props, state) {
|
||||||
const { messagesOnly } = props;
|
|
||||||
const { username, userAvatarImage, websocket } = state;
|
const { username, userAvatarImage, websocket } = state;
|
||||||
|
|
||||||
|
return (
|
||||||
if (messagesOnly) {
|
|
||||||
return (
|
|
||||||
html`
|
html`
|
||||||
<${Chat}
|
<${Chat}
|
||||||
websocket=${websocket}
|
websocket=${websocket}
|
||||||
@@ -49,27 +44,7 @@ export default class StandaloneChat extends Component {
|
|||||||
userAvatarImage=${userAvatarImage}
|
userAvatarImage=${userAvatarImage}
|
||||||
messagesOnly
|
messagesOnly
|
||||||
/>
|
/>
|
||||||
`);
|
`
|
||||||
}
|
);
|
||||||
|
|
||||||
// not needed for standalone, just messages only. remove later.
|
|
||||||
return (
|
|
||||||
html`
|
|
||||||
<${Fragment}>
|
|
||||||
<${UsernameForm}
|
|
||||||
username=${username}
|
|
||||||
userAvatarImage=${userAvatarImage}
|
|
||||||
handleUsernameChange=${this.handleUsernameChange}
|
|
||||||
handleChatToggle=${this.handleChatToggle}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<${Chat}
|
|
||||||
websocket=${websocket}
|
|
||||||
username=${username}
|
|
||||||
userAvatarImage=${userAvatarImage}
|
|
||||||
/>
|
|
||||||
</${Fragment}>
|
|
||||||
`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const TIMER_STREAM_DURATION_COUNTER = 1000;
|
|||||||
export const TEMP_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
export const TEMP_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
||||||
|
|
||||||
export const MESSAGE_OFFLINE = 'Stream is offline.';
|
export const MESSAGE_OFFLINE = 'Stream is offline.';
|
||||||
export const MESSAGE_ONLINE = 'Stream is online';
|
export const MESSAGE_ONLINE = 'Stream is online.';
|
||||||
|
|
||||||
export const URL_OWNCAST = 'https://github.com/gabek/owncast'; // used in footer
|
export const URL_OWNCAST = 'https://github.com/gabek/owncast'; // used in footer
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,9 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
|
||||||
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
|
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
|
||||||
<!-- <link href="./styles/layout.css" rel="stylesheet" /> -->
|
|
||||||
<link href="./styles/chat.css" rel="stylesheet" />
|
<link href="./styles/chat.css" rel="stylesheet" />
|
||||||
<link href="./styles/standalone-chat.css" rel="stylesheet" />
|
<link href="./styles/standalone-chat.css" rel="stylesheet" />
|
||||||
|
|
||||||
|
|
||||||
<script src="//unpkg.com/showdown/dist/showdown.min.js"></script>
|
<script src="//unpkg.com/showdown/dist/showdown.min.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -21,10 +19,8 @@
|
|||||||
import { render, html } from "https://unpkg.com/htm/preact/index.mjs?module";
|
import { render, html } from "https://unpkg.com/htm/preact/index.mjs?module";
|
||||||
import StandaloneChat from './js/standalone-chat-app.js';
|
import StandaloneChat from './js/standalone-chat-app.js';
|
||||||
|
|
||||||
const messagesOnly = false;
|
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
render(html`<${StandaloneChat} messagesOnly=${messagesOnly} />`, document.getElementById("chat-container"));
|
render(html`<${StandaloneChat} messagesOnly />`, document.getElementById("chat-container"));
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ a:hover {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
button[disabled] {
|
||||||
|
opacity: .5;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.visually-hidden {
|
.visually-hidden {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
@@ -72,7 +77,7 @@ header {
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.online #video {
|
.online #video-container #video {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
|
|
||||||
.emoji-picker__emoji {
|
.emoji-picker__emoji {
|
||||||
border-radius: 10px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user