Skip to content

Commit 2beb009

Browse files
author
MadeByIToncek
committed
Dark mode? Yeah...and also more text...aren't I productive :D
1 parent 0b0613b commit 2beb009

4 files changed

Lines changed: 25 additions & 12 deletions

File tree

docs/Developer Documentation/commons.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 2
44
# Commons
55
This [repository](https://github.com/TrailCompass/commons) is the glue, holding the entire software together. It consists of two main parts. API part is an implementation of the communication protocol, Proto part defines the entire protocol, including all shared objects.
66

7-
## Protocol
7+
## Protocol {#protocol}
88
This part of the commons repository contains the exchange definitions, exchanged objects, request and response packets and utilities, needed for generic exchanges. Exchange definitions are written like interfaces in the following style:
99
```java
1010
public interface IExchange {
@@ -24,5 +24,17 @@ In the demo provided above, this subexchange, called `ITestExchange`, defines tw
2424

2525
The same can be said about `castCardWithOtherCard()` method. It consumes [`CastCardWithOtherCardRequest`](https://github.com/TrailCompass/commons/blob/main/src/main/java/space/itoncek/trailcompass/proto/requests/deck/CastCardWithOtherCardRequest.java), which is a record, containing the token of a player, `UUID` of the cast card and `UUID` of another card from hider's deck. It returns [`OkResponse`](https://github.com/TrailCompass/commons/blob/main/src/main/java/space/itoncek/trailcompass/proto/responses/generic/OkResponse.java), which is equivalent to `void` return type in Java.
2626

27-
# Creating a subexchange
28-
Every subexchange should represent a different module of the TrailCompass protocol. For example, all the packets related to login and authentication should be contained within one subexchange, in this case called [`IAuthExchange`](https://github.com/TrailCompass/commons/blob/main/src/main/java/space/itoncek/trailcompass/proto/exchange/IAuthExchange.java).
27+
# Creating a subexchange {#creating-subexchanges}
28+
Every subexchange should represent a different module of the TrailCompass protocol. For example, all the packets related to login and authentication should be contained within one subexchange, in this case called [`IAuthExchange`](https://github.com/TrailCompass/commons/blob/main/src/main/java/space/itoncek/trailcompass/proto/exchange/IAuthExchange.java).
29+
30+
When creating a new subexchange, you should first define the exchange's methods and packet definitions (this will be explained [later](#packet-definitions)). This should be written in the following format:
31+
```java
32+
public interface ITestExchange {
33+
ServerVersionResponse version(ServerVersionRequest request) throws BackendException;
34+
OkResponse castCardWithOtherCard(CastCardWithOtherCardRequest req) throws BackendException;
35+
}
36+
```
37+
38+
# Creating a method {#creating-method}
39+
40+
## Creating packet definitions {#packet-definitions}

docusaurus.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ const config = {
151151
copyright: `Copyright © ${new Date().getFullYear()} TrailCompass developer team <br> Built with Docusaurus.`,
152152
},
153153
prism: {
154-
theme: prismThemes.github,
155-
darkTheme: prismThemes.github,
154+
theme: prismThemes.vsLight,
155+
darkTheme: prismThemes.vsDark,
156+
additionalLanguages: ['java', 'kotlin']
156157
},
157158
}),
158159
};

src/css/custom.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
/* For readability concerns, you should choose a lighter palette in dark mode. */
2121
[data-theme='dark'] {
22-
--ifm-color-primary: #0D1C36;
23-
--ifm-color-primary-dark: #071327;
24-
--ifm-color-primary-darker: #041635;
22+
--ifm-color-primary: #99bdff;
23+
--ifm-color-primary-dark: #e6efff;
24+
--ifm-color-primary-darker: #ffffff;
2525
--ifm-color-primary-darkest: #00091a;
26-
--ifm-color-primary-light: #4875c2;
27-
--ifm-color-primary-lighter: #5a7cbd;
28-
--ifm-color-primary-lightest: #628bd1;
26+
--ifm-color-primary-light: #0f2f67;
27+
--ifm-color-primary-lighter: #041a44;
28+
--ifm-color-primary-lightest: #000f2a;
2929
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
3030
}

src/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import styles from './index.module.css';
1010
function HomepageHeader() {
1111
const {siteConfig} = useDocusaurusContext();
1212
return (
13-
<header className={clsx('hero hero--primary', styles.heroBanner)}>
13+
<header className={clsx('hero hero--primary', styles.heroBanner)} style={{backgroundColor:"#001b36ff"}}>
1414
<div className="container">
1515
<img src="/img/title.svg"></img>
1616
<div className={styles.buttons}>

0 commit comments

Comments
 (0)