-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathSettingsButton.svelte
More file actions
68 lines (59 loc) · 1.8 KB
/
SettingsButton.svelte
File metadata and controls
68 lines (59 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<script lang="ts">
import { createPopup } from '../ts/chat-utils';
import { isLiveTL } from '../ts/chat-constants';
import outline from '../assets/outline.svg?raw';
import { onDestroy, onMount } from "svelte";
const openSettings = () => {
createPopup(chrome.runtime.getURL(`${isLiveTL ? 'hyperchat/' : ''}options.html${document.documentElement.getAttribute('dark') === '' ? '?dark' : ''}`));
};
onMount(() => {
console.debug('[HyperChat] Settings button created');
});
onDestroy(() => {
console.debug('[HyperChat] Settings button destroyed');
});
</script>
<div id="hc-settings" on:click={openSettings} class="button">
<div class="button-icon-container">
<div class="button-icon">
{@html outline}
</div>
</div>
<div class="button-label">HyperChat Settings</div>
</div>
<style>
/* CSS Style as copied from BetterTTV albeit slightly modified: https://github.com/night/betterttv/blob/38daf2a12133286c6910db5bb39ccdfaf7a4ffd4/src/modules/settings/youtube/Settings.module.css */
.button {
display: flex;
align-items: center;
padding: 0px 36px 0px 16px;
cursor: pointer;
min-height: 36px;
}
.button:hover {
background-color: var(--yt-spec-additive-background);
border-radius: 8px;
}
.button-label {
color: var(--yt-spec-text-primary);
white-space: nowrap;
font-family: "Roboto", "Arial", sans-serif;
font-size: 1.4rem;
line-height: 2rem;
font-weight: 400;
-webkit-font-smoothing: var(--paper-font-subhead_-_-webkit-font-smoothing);
}
.button-icon-container {
display: flex;
align-items: center;
justify-content: center;
margin-right: 16px;
width: 24px;
height: 24px;
}
.button-icon {
display: flex;
justify-content: center;
fill: var(--yt-spec-text-primary);
}
</style>