Skip to content

Commit

Permalink
update: small layout
Browse files Browse the repository at this point in the history
  • Loading branch information
canwdev committed Sep 20, 2023
1 parent 9d0d5c4 commit 8b121d8
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 72 deletions.
2 changes: 1 addition & 1 deletion vue/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>KeeNote v4.0.5</title>
<title>KeeNote v4.0.6</title>
</head>
<body>
<div id="app"></div>
Expand Down
3 changes: 3 additions & 0 deletions vue/src/components/MarkdownEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ export default defineComponent({
min-height: 50px;
border-radius: 4px;
border: 1px solid rgb(224, 224, 230);
@media screen and (max-height: 500px) {
height: calc(100vh - 30px);
}
&._dark {
border-color: transparent;
}
Expand Down
14 changes: 1 addition & 13 deletions vue/src/views/Home/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,5 @@ export default defineComponent({
</template>

<style lang="scss" scoped>
.login-view {
height: 100%;
:deep(.n-layout-scroll-container) {
display: flex;
align-items: center;
justify-content: center;
}
.card-wrap {
max-width: 500px;
margin: 20px;
}
}
@import './login';
</style>
14 changes: 1 addition & 13 deletions vue/src/views/Home/UnlockView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,5 @@ export default defineComponent({
</template>

<style lang="scss" scoped>
.login-view {
height: 100%;
:deep(.n-layout-scroll-container) {
display: flex;
align-items: center;
justify-content: center;
}
.card-wrap {
max-width: 500px;
margin: 20px;
}
}
@import './login';
</style>
17 changes: 17 additions & 0 deletions vue/src/views/Home/login.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

.login-view {
height: 100%;

:deep(.n-layout-scroll-container) {
display: flex;
align-items: center;
justify-content: center;
@media screen and (max-height: 500px) {
align-items: flex-start;
}
}
.card-wrap {
max-width: 500px;
margin: 20px;
}
}
123 changes: 79 additions & 44 deletions vue/src/views/Note/DetailView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default defineComponent({
<template>
<div class="detail-view">
<n-layout class="layout-inner-root">
<n-layout-header bordered>
<n-layout-header class="detail-header" bordered>
<n-space align="center" justify="space-between" class="header-space">
<n-button quaternary @click="handleBack">
<n-icon size="18"> <ArrowLeft16Regular /> </n-icon>&nbsp;Back</n-button
Expand Down Expand Up @@ -228,7 +228,7 @@ export default defineComponent({

<div v-if="entryDetail" class="detail-card-wrap">
<div class="detail-card">
<n-space vertical>
<n-space vertical class="detail-infos">
<n-space justify="space-between">
<n-space align="center">
<n-date-picker
Expand Down Expand Up @@ -312,23 +312,24 @@ export default defineComponent({

<AttachmentBox :entry-detail="entryDetail" @dataUpdated="syncAndSave" />
</n-collapse-transition>
<MarkdownEditor
ref="complexEditorRef"
v-if="isComplexEditor"
v-model="entryDetail.fieldsV2.Notes"
@turnOff="isComplexEditor = false"
/>
<n-input
v-else
v-model:value="entryDetail.fieldsV2.Notes"
type="textarea"
placeholder="Input your Note here."
:autosize="{
minRows: 20,
}"
style="background-color: inherit !important"
/>
</n-space>

<MarkdownEditor
ref="complexEditorRef"
v-if="isComplexEditor"
v-model="entryDetail.fieldsV2.Notes"
@turnOff="isComplexEditor = false"
/>
<n-input
v-else
v-model:value="entryDetail.fieldsV2.Notes"
type="textarea"
placeholder="Input your Note here."
:autosize="{
minRows: 20,
}"
style="background-color: inherit !important"
/>
</div>
</div>

Expand All @@ -344,13 +345,26 @@ export default defineComponent({
height: 100%;
$min_width: 800px;
.header-space {
width: 100%;
height: 100%;
padding: 6px 24px;
box-sizing: border-box;
@media screen and (max-width: $min_width) {
padding: 2px;
.detail-header {
.header-space {
width: 100%;
height: 100%;
padding: 6px 24px;
box-sizing: border-box;
@media screen and (max-width: $min_width) {
padding: 2px;
}
@media screen and (max-height: 500px) {
height: 10px;
overflow: hidden;
transition: all 0.3s;
opacity: 0;
&:hover {
opacity: 1;
height: 100%;
border: 1px dashed;
}
}
}
}
Expand All @@ -375,6 +389,9 @@ export default defineComponent({
overflow: auto;
padding-top: 10px;
padding-bottom: 5px;
@media screen and (max-height: 500px) {
padding-top: 0;
}
}
.detail-card {
Expand All @@ -391,25 +408,43 @@ export default defineComponent({
@media screen and (max-width: 1200px) {
margin-top: 10px;
}
}
}
.extra-info {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: auto;
gap: 10px;
margin-bottom: 10px;
@media screen and (max-width: $min_width) {
grid-template-columns: repeat(1, 1fr);
}
.extra-item {
display: flex;
align-items: center;
label {
margin-right: 5px;
min-width: 70px;
text-align: right;
@media screen and (max-height: 500px) {
margin-top: 1px;
}
.detail-infos {
@media screen and (max-height: 500px) {
height: 10px;
overflow: hidden;
transition: all 0.3s;
opacity: 0;
&:hover {
margin-left: -5px;
margin-right: -5px;
padding: 5px 5px 0;
opacity: 1;
outline: 1px dashed;
height: 100%;
}
}
.extra-info {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: auto;
gap: 10px;
margin-bottom: 10px;
@media screen and (max-width: $min_width) {
grid-template-columns: repeat(1, 1fr);
}
.extra-item {
display: flex;
align-items: center;
label {
margin-right: 5px;
min-width: 70px;
text-align: right;
}
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion vue/src/views/Note/NoteBaseView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ export default defineComponent({
<n-layout-sider
collapse-mode="width"
:collapsed-width="50"
:width="248"
:width="240"
show-trigger="arrow-circle"
bordered
>
Expand Down

0 comments on commit 8b121d8

Please sign in to comment.