Skip to content

Commit 40d2c09

Browse files
committed
hi
1 parent fc60977 commit 40d2c09

26 files changed

Lines changed: 573 additions & 243 deletions

client/OBScore.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import { emittable, receivable } from "./events"
2+
import * as socketio from "socket.io"
3+
4+
declare global {
5+
interface Window {io: Function}
6+
}
27

38
export default class OBS {
49
private css: string = `
@@ -10,7 +15,7 @@ export default class OBS {
1015
private name: string
1116
private timeout: number
1217
private onUpdate: Function
13-
private socket?: SocketIOClient.Socket
18+
private socket?: socketio.Server
1419
private printedNotReady: boolean = true
1520

1621
constructor(name: string, onUpdate: Function, timeout = 500) {
@@ -50,11 +55,11 @@ export default class OBS {
5055
}
5156

5257
connect(server: string) {
53-
if (typeof io !== "function")
58+
if (typeof window.io !== "function")
5459
throw new Error("socket.io not found")
5560

5661
/* global io */
57-
const socket = io(server)
62+
const socket = window.io(server)
5863
this.socket = socket
5964

6065
socket.on(receivable.connect, () => {

controller/notes.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
BO5 / BO3 / Custom?
1+
BO5 / BO3 / Custom?
2+
Animationen sind irgendwie sequenziert, nicht parallel
3+
Persistenz im Speicher oder sowas
4+
Tooltips

controller/package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

controller/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"dependencies": {
66
"@fortawesome/fontawesome-free": "^5.12.1",
77
"@fortawesome/fontawesome-svg-core": "^1.2.27",
8+
"@fortawesome/free-brands-svg-icons": "^5.12.1",
89
"@fortawesome/free-solid-svg-icons": "^5.12.1",
910
"@fortawesome/react-fontawesome": "^0.1.8",
1011
"@types/bootstrap": "^4.3.1",
@@ -47,6 +48,8 @@
4748
},
4849
"devDependencies": {
4950
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
51+
"@typescript-eslint/eslint-plugin": "^2.19.0",
52+
"@typescript-eslint/parser": "^2.19.0",
5053
"eslint-plugin-react": "^7.16.0",
5154
"ts-node-dev": "^1.0.0-pre.44"
5255
}

controller/src/App.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ $variablesPath: url("/node_modules/bootstrap/scss/_variables.scss");
3232
}
3333
}
3434

35+
.form-control:disabled {
36+
// background-color: lighten($color: rgb(33, 37, 41), $amount: 10);
37+
background-color: black;
38+
color: grey;
39+
cursor: not-allowed;
40+
}
41+
3542
html {
36-
//overflow: hidden;
43+
overflow: hidden;
3744
}

controller/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export default function App() {
1212
<Fragment>
1313
<CustomTabs/>
1414
<div className="tab-content" id="nav-tabContent">
15-
<TabContent id="players" active={true}>
15+
<TabContent id="players" active={false}>
1616
<Players/>
1717
</TabContent>
18-
<TabContent id="meta">
18+
<TabContent id="meta" active={true}>
1919
<Meta/>
2020
</TabContent>
2121
</div>

controller/src/elements/FAButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ interface FAButtonProps extends ButtonProps {
1515
className?: string,
1616
onClick?: any,
1717
onMouseDown?: any,
18-
center?: boolean
18+
center?: boolean,
19+
style?: React.CSSProperties
1920
}
2021

2122
export default function FAButton(props: FAButtonProps) {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from "react"
2+
import { InputGroup, FormControl } from "react-bootstrap"
3+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
4+
import * as fa from "@fortawesome/free-solid-svg-icons"
5+
6+
export default function SponsorTagInput({
7+
sponsor,
8+
tag,
9+
changeSponsor,
10+
changeTag
11+
}: {
12+
sponsor: string,
13+
tag: string,
14+
changeSponsor: (event: React.FormEvent) => void,
15+
changeTag: (event: React.FormEvent) => void,
16+
}) {
17+
return (
18+
<InputGroup size="sm">
19+
<InputGroup.Prepend>
20+
<InputGroup.Text>
21+
<FontAwesomeIcon icon={fa.faUser} fixedWidth/>
22+
</InputGroup.Text>
23+
</InputGroup.Prepend>
24+
<FormControl
25+
style={{flex: 0.3}}
26+
value={sponsor}
27+
onChange={changeSponsor}
28+
/>
29+
<div className="border border-light"/>
30+
<FormControl
31+
value={tag}
32+
onChange={changeTag}
33+
/>
34+
</InputGroup>
35+
)
36+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@mixin transition(
2+
$classNames,
3+
$transition,
4+
$begin: (),
5+
$end: ()
6+
) {
7+
.#{$classNames}-enter,
8+
.#{$classNames}-enter-done,
9+
.#{$classNames}-exit-active,
10+
.#{$classNames}-exit,
11+
.#{$classNames}-exit-done,
12+
.#{$classNames}-enter-active {
13+
transition: #{$transition};
14+
}
15+
16+
.#{$classNames}-exit-active,
17+
.#{$classNames}-exit-done,
18+
.#{$classNames}-enter {
19+
@each $p, $v in $begin {
20+
#{$p}: $v;
21+
}
22+
}
23+
24+
.#{$classNames}-enter-active,
25+
.#{$classNames}-enter-done,
26+
.#{$classNames}-exit {
27+
@each $p, $v in $end {
28+
#{$p}: $v;
29+
}
30+
}
31+
}

controller/src/model/Attendee.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default class Attendee {
22
constructor(
3-
public name: string,
3+
public tag: string,
44
public sponsor?: string,
55
public twitter?: string,
66
public twitch?: string
@@ -9,7 +9,7 @@ export default class Attendee {
99
toString() {
1010
return (
1111
this.sponsor ? `[${this.sponsor}] ` : ""
12-
+ this.name
12+
+ this.tag
1313
)
1414
}
1515
}

0 commit comments

Comments
 (0)