diff --git a/public/content.css b/public/content.css index 8ed09687..9fc67cd8 100644 --- a/public/content.css +++ b/public/content.css @@ -119,13 +119,28 @@ margin-left: 5px; } -.sponsorSkipNotice { - min-width: 350px; - background-color: rgba(28, 28, 28, 0.9); +.sponsorSkipNoticeParent { + min-width: 350px; position: absolute; + right: 5px; bottom: 100px; right: 10px; + + z-index: 1000; + + border-radius: 5px; + + border-spacing: 5px 10px; + padding-left: 5px; + padding-right: 5px; + + border-collapse: unset; +} + +.sponsorSkipNotice { + min-width: 350px; + background-color: rgba(28, 28, 28, 0.9); border-radius: 5px; @@ -135,9 +150,13 @@ border-collapse: unset; - transition: opacity 0.1s ease-out; + transition: all 0.1s ease-out; } +/* .sponsorSkipNotice .miniNotice { + bottom: 146px; +} */ + .sponsorSkipNotice .hidden { display: none; } diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx index 35635fc6..ac0cbc59 100644 --- a/src/components/NoticeComponent.tsx +++ b/src/components/NoticeComponent.tsx @@ -26,6 +26,7 @@ export interface NoticeProps { // Callback for when this is closed closeListener: () => void, + onMouseEnter?: (e: React.MouseEvent) => void, zIndex?: number, style?: React.CSSProperties @@ -99,8 +100,8 @@ class NoticeComponent extends React.Component { + (this.state.startFaded ? " sponsorSkipNoticeFaded" : "") + (this.amountOfPreviousNotices > 0 ? " secondSkipNotice" : "")} style={noticeStyle} - onMouseEnter={() => { this.timerMouseEnter(); this.fadedMouseEnter(); } } - onMouseLeave={() => this.timerMouseLeave()}> + onMouseEnter={(e) => this.onMouseEnter(e) } + onMouseLeave={() => this.timerMouseLeave()}> {/* First row */} @@ -181,6 +182,13 @@ class NoticeComponent extends React.Component { )]; } + onMouseEnter(event: React.MouseEvent): void { + if (this.props.onMouseEnter) this.props.onMouseEnter(event); + + this.fadedMouseEnter(); + this.timerMouseEnter(); + } + fadedMouseEnter(): void { if (this.state.startFaded) { this.setState({ diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 7f6e3a36..a99ef289 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -48,6 +48,8 @@ export interface SkipNoticeState { actionState?: SkipNoticeAction; showKeybindHint?: boolean; + + smaller?: boolean; } class SkipNoticeComponent extends React.Component { @@ -118,7 +120,9 @@ class SkipNoticeComponent extends React.Component this.contentContainer().v?.playbackRate} - style={noticeStyle} - ref={this.noticeRef} - closeListener={() => this.closeListener()} - smaller={this.props.smaller} - firstColumn={firstColumn}> - - {(Config.config.audioNotificationOnSkip) && } +
+ this.contentContainer().v?.playbackRate} + style={noticeStyle} + ref={this.noticeRef} + closeListener={() => this.closeListener()} + smaller={this.props.smaller} + firstColumn={firstColumn} + onMouseEnter={() => this.onMouseEnter() } > + + {(Config.config.audioNotificationOnSkip) && } + + {/* Text Boxes */} + {!this.state.smaller ? + this.getMessageBoxes() + : null} + + {!this.state.smaller ? + this.getBottomRow() + : null} + + {/* Text Boxes */} - {!this.props.smaller ? - this.getMessageBoxes() - : ""} - - {/* Bottom Row */} - {!this.props.smaller ? - ( + {this.state.smaller ? ( + + {this.getMessageBoxes()} - {/* Vote Button Container */} - {!this.state.thanksForVotingText ? - - - : - - - } - - {/* Unskip/Skip Button */} - {this.getSkipButton()} - - {/* Never show button if autoSkip is enabled */} - {!this.autoSkip ? "" : - - } - ) - : ""} - - {/* Downvote Options Row */} - {this.state.downvoting && - - - - - } - - {/* Category Chooser Row */} - {this.state.choosingCategory && - - - - } - - {/* Segment Chooser Row */} - {this.state.actionState !== SkipNoticeAction.None && - - - - } - - + {this.getBottomRow()} +
- - {/* Upvote Button */} - this.prepAction(SkipNoticeAction.Upvote)}> - - - - {/* Report Button */} - this.adjustDownvotingState(true)}> - - - - - {this.state.thanksForVotingText} - - -
- - {/* Normal downvote */} - - - {/* Category vote */} - -
- {/* Category Selector */} - - - {/* Submit Button */} - {this.segments.length === 1 && - - } - -
- {this.getSubmissionChooser()} -
+ ) : null} +
); } + getBottomRow(): JSX.Element[] { + return [ + /* Bottom Row */ + ( + + {/* Vote Button Container */} + {!this.state.thanksForVotingText ? + + + {/* Upvote Button */} + this.prepAction(SkipNoticeAction.Upvote)}> + + + + {/* Report Button */} + this.adjustDownvotingState(true)}> + + + + + + : + + + {this.state.thanksForVotingText} + + } + + {/* Unskip/Skip Button */} + {!this.props.smaller ? this.getSkipButton() : null} + + {/* Never show button if autoSkip is enabled */} + {!this.autoSkip ? "" : + + + + } + ), + + /* Downvote Options Row */ + (this.state.downvoting && + + + + {/* Normal downvote */} + + + {/* Category vote */} + + + + + ), + + /* Category Chooser Row */ + (this.state.choosingCategory && + + + {/* Category Selector */} + + + {/* Submit Button */} + {this.segments.length === 1 && + + } + + + + ), + + /* Segment Chooser Row */ + (this.state.actionState !== SkipNoticeAction.None && + + + {this.getSubmissionChooser()} + + + ) + ]; + } + getSkipButton(): JSX.Element { return ( @@ -315,6 +349,14 @@ class SkipNoticeComponent extends React.Component