Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New dark mode look and Minecraftia font boxes #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@
font-weight: normal;
}

/*default color*/
:root {
--main-bg-color: #eee;
--box-shadow: #0004;
--refresh-btn-normal: #6a727f;
--refresh-btn-selected: #000;
--login-color: #0008;
--error-bg-color: #ffd8e0;
}
/*for different settings*/
@media(prefers-color-scheme: dark){
:root {
--main-bg-color: #000;
--box-shadow: #eee4;
--refresh-btn-normal: #9096a0;
--refresh-btn-selected: #eee;
--login-color: #fff8;
--error-bg-color: #936e76;
}
}

@media(max-width: 45rem) {
#app {
padding: 2rem 0.5rem;
Expand Down
52 changes: 29 additions & 23 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ async function refresh(): Promise<void> {

var loginPromise: Promise<void> | null = null

/*whoever don't have an account butwant to check how it looks delete this function*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我不建议在这里加这个 comment, 之后我加个 dev api 吧

function login(): Promise<void> {
if (loginPromise) {
return loginPromise
Expand Down Expand Up @@ -224,7 +225,9 @@ onMounted(async () => {
<legend class="config-box-title">
<h3>Connections</h3>
</legend>
<div v-if="connPollError" class="error">{{ connPollError }}</div>
<!-- replacement code to check whether error visual works
<div v-if= "false||connPollError" class="error">{{ connPollError }}</div> -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缩进要对齐

<div v-if= "connPollError" class="error">{{ connPollError }}</div>
<fieldset v-else-if="connections" class="sub-config-box">
<legend>
<span style="font-size: 0.8rem"> count = {{ connections.length }} </span>
Expand All @@ -244,7 +247,7 @@ onMounted(async () => {
</div>
</fieldset>
<div v-else>
<i><b>Loading...</b></i>
<!--<i><b>Loading...</b></i>-->Loading...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你怎么把我的 Loading 删掉了

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

字体不对?
怎么改

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

字体不对不是删掉的理由 😅

给它加个 class, 然后 css 里面设置 font-family 就好

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我直接改的是

Loading...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

byd这行代码github打不出来?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我。。。

</div>
</fieldset>
<fieldset class="whitelist config-box">
Expand Down Expand Up @@ -279,7 +282,7 @@ onMounted(async () => {
</fieldset>
</template>
<div v-else>
<i><b>Loading...</b></i>
<!--<i><b>Loading...</b></i>-->Loading...
</div>
</fieldset>
<fieldset class="blacklist config-box">
Expand Down Expand Up @@ -314,7 +317,7 @@ onMounted(async () => {
</fieldset>
</template>
<div v-else>
<i><b>Loading...</b></i>
<!--<i><b>Loading...</b></i>-->Loading...
</div>
</fieldset>
<div v-if="onlogged" class="login-pop">
Expand All @@ -328,15 +331,28 @@ onMounted(async () => {
</template>

<style scoped>

@media(max-width: 45rem) {
.config-box {
max-width: calc(100% - 1rem);
}
.input-player {
height: 2rem;
width: calc(100% - 8rem);
}
}

/*main resources*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*main resources*/
/* main resources */

.config-box {
width: 41rem;
margin: 1rem 0;
padding: 1rem;
border-right: none;
border-bottom: none;
border-radius: 0.5rem;
box-shadow: 0 0 1rem #0004;
background: #eee;
box-shadow: 0 0 1rem var(--box-shadow);
background: var(--main-bg-color);
font-family: Minecraftia, monospace;
}

.config-box-title > h3 {
Expand All @@ -355,26 +371,26 @@ onMounted(async () => {
border: 0.25rem solid #ff0000;
color: #ca0000;
font-weight: 800;
background-color: #ffd8e0;
background-color: var(--error-bg-color);
}

.sub-config-box {
padding-right: 0;
border: none;
border-top: 0.1rem solid #000a;
border-top: 0.1rem solid var(--box-shadow);
background: inherit;
}

.refresh-btn {
width: 1.5rem;
height: 1.5rem;
color: #6a727f;
color: var(--refresh-btn-normal);
user-select: none;
cursor: pointer;
}

.refresh-btn:hover {
color: #000;
color: var(--refresh-btn-selected);
}

.connections {
Expand Down Expand Up @@ -428,7 +444,7 @@ onMounted(async () => {
height: 100vh;
top: 0;
left: 0;
background: #0008;
background: var(--login-color);
}

.login-box {
Expand All @@ -439,17 +455,7 @@ onMounted(async () => {
left: 10%;
padding: 1rem;
border-radius: 1rem;
background: #eee;
box-shadow: 0 0 2px #000a;
}

@media(max-width: 45rem) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? 你怎么给我适配 mobile 的 media 删了

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移到上面了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@media放最下面,因为按照 css 加载顺序来说,下面的值会覆盖上面的值

就是让代码更好看

.config-box {
max-width: calc(100% - 1rem);
}
.input-player {
height: 2rem;
width: calc(100% - 8rem);
}
box-shadow: 0 0 2px var(--box-shadow);
background-color: var(--main-bg-color);
}
</style>