shiori/internal/view/assets/less/common.less
Monirzadeh 4a5564d60b
feat: store created and modified time separately on database for bookmarks (#896)
* sqlite migrate script

* create time just when bookmark added and modified update if change happen

* show added and modified time in footer instead of header

* add bun.lockb that missing

* add migrate for postgres

* add pg support of created time

* change modifed to modifed_at and create to created_at in sqlite

* change modifed to modifed_at and create to created_at in postgre

* add created_at to mariadb

* fix migration file names

* better variable name and more clear code for add modified time if created and modified is not in same day

* add unittest

* add unittest to sure filters work as expected

* index for created_at and modified_at

* build new styles.css

* update swagger documents

* make styles

* change Created and Modified to CreatedAt and ModifiedAt

* fix missing Modified

* fix typo

* missing Modified

* fix typo

* make swagger

* run tests parallel

Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>

* remove t.Parallel()

* remove dayjs dependency and combine two function

* better unittest name

* fix typo

* diffrnt footer style for login and content page

* use class instead of id

* back parallel

* change duplicate url

* remvoe run Parallel

* make styles

---------

Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
2024-06-26 20:17:51 +02:00

829 lines
12 KiB
Text

select {
background: var(--contentBg);
border: 1px solid var(--border);
border-radius: 4px;
color: var(--color);
}
.login-footer {
color: var(--color);
}
.content-footer {
width: 100%;
padding: 20px;
max-width: 840px;
margin-bottom: 16px;
background-color: var(--contentBg);
border: 1px solid var(--border);
display: flex;
flex-flow: column;
align-items: center;
}
.metadata {
display: flex;
flex-flow: row wrap;
text-align: center;
font-size: 16px;
color: var(--colorLink);
&:nth-child(1) {
justify-content: flex-start;
}
&:nth-child(2) {
justify-content: flex-end;
}
&[v-cloak] {
visibility: hidden;
}
}
.links {
display: flex;
flex-flow: row wrap;
a {
padding: 0 4px;
color: var(--color);
text-decoration: underline;
&:hover,
&:focus {
color: var(--main);
}
}
}
* {
border-width: 0;
box-sizing: border-box;
font-family: "Source Sans Pro", sans-serif;
margin: 0;
padding: 0;
text-decoration: none;
}
body {
background-color: var(--bg);
}
a {
cursor: pointer;
}
.spacer {
flex: 1;
}
#login-scene {
height: 100%;
height: 100dvh;
padding: 16px;
overflow: auto;
display: flex;
align-items: center;
flex-flow: column nowrap;
background-color: var(--bg);
> .error-message {
width: 100%;
max-width: 400px;
font-size: 1em;
background-color: var(--contentBg);
border: 1px solid var(--border);
padding: 16px;
margin-top: auto;
margin-bottom: 16px;
text-align: center;
color: var(--errorColor);
}
#login-box {
width: 100%;
max-width: 400px;
margin-bottom: auto;
background-color: var(--contentBg);
display: flex;
flex-flow: column nowrap;
border: 1px solid var(--border);
flex-shrink: 0;
&:first-child {
margin-top: auto;
}
#logo-area {
display: flex;
align-items: center;
flex-flow: column nowrap;
padding: 16px;
background-color: var(--main);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
#logo {
font-size: 3em;
font-weight: 100;
color: var(--contentBg);
span {
margin-right: 8px;
}
}
#tagline {
font-weight: 500;
margin-top: 4px;
color: var(--contentBg);
text-align: center;
}
}
#input-area {
padding: 16px;
display: grid;
grid-gap: 16px;
grid-template-columns: auto 1fr;
justify-content: baseline;
align-items: center;
border-bottom: 1px solid var(--border);
> label {
color: var(--color);
}
> input {
color: var(--color);
padding: 8px;
background-color: var(--contentBg);
border: 1px solid var(--border);
min-width: 0;
font-size: 1em;
}
.checkbox-field {
grid-column: 1 / span 2;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: center;
cursor: pointer;
&:hover,
&:focus {
text-decoration: underline;
text-decoration-color: var(--main);
}
> input[type="checkbox"] {
margin-right: 8px;
}
}
}
#button-area {
display: flex;
flex-flow: row nowrap;
padding: 16px;
justify-content: center;
a {
color: var(--color);
text-transform: uppercase;
text-align: center;
font-weight: 600;
cursor: default;
&.button {
cursor: pointer;
&:hover,
&:focus {
color: var(--main);
}
}
}
}
}
}
#main-scene {
min-height: 100%;
min-height: 100dvh;
padding-top: 60px;
padding-left: 60px;
background-color: var(--bg);
#main-sidebar {
top: 0;
left: 0;
width: 60px;
height: 100%;
height: 100dvh;
position: fixed;
display: flex;
flex-flow: column nowrap;
background-color: var(--sidebarBg);
z-index: 1;
a {
flex-shrink: 0;
display: block;
width: 60px;
line-height: 60px;
text-align: center;
font-size: 1em;
color: var(--colorSidebar);
&.active {
cursor: default;
color: var(--colorSidebar);
background-color: var(--main);
}
&:hover,
&:focus {
color: var(--main);
background-color: var(--sidebarHoverBg);
}
}
}
.page-header {
top: 0px;
left: 60px;
right: 0px;
height: 60px;
position: fixed;
color: var(--color);
background-color: var(--headerBg);
border-bottom: 1px solid var(--border);
padding: 0 16px;
z-index: 10;
}
h1.page-header {
line-height: 60px;
font-size: 1.3em;
font-weight: 600;
}
div.page-header {
display: flex;
flex-flow: row nowrap;
align-items: center;
p {
flex: 1 0;
font-size: 1.3em;
font-weight: 600;
line-height: 60px;
color: var(--color);
}
input[type="text"] {
flex: 1 0;
min-width: 0;
margin-right: 8px;
font-size: 1.1em;
font-weight: 500;
line-height: 59px;
color: var(--color);
background-color: var(--contentBg);
&::placeholder {
color: var(--colorLink);
}
}
a {
display: block;
width: 24px;
line-height: 24px;
color: var(--colorLink);
text-align: center;
&:not(:last-child) {
margin-right: 8px;
}
&:hover {
color: var(--main);
}
}
}
.loading-overlay {
display: flex;
flex-flow: column nowrap;
align-items: center;
justify-content: center;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
width: 100%;
width: 100dvw;
height: 100%;
height: 100dvh;
z-index: 10001;
background-color: rgba(0, 0, 0, 0.6);
i {
color: var(--colorSidebar);
font-size: 4em;
text-align: center;
width: 80px;
line-height: 80px;
position: absolute;
}
}
@media (max-width: 600px) {
padding-top: 50px;
padding-left: 0;
padding-bottom: 50px;
#main-sidebar {
top: auto;
right: 0;
bottom: 0;
width: 100%;
width: 100dvw;
height: 50px;
flex-flow: row nowrap;
border-top: 1px solid var(--border);
.spacer {
display: none;
}
a {
width: auto;
flex: 1 0;
line-height: 50px;
&:hover,
&:focus {
color: var(--colorSidebar);
background-color: var(--main);
}
}
}
.page-header {
left: 0;
height: 50px;
}
h1.page-header {
text-align: center;
font-size: 1em;
line-height: 50px;
text-transform: uppercase;
}
div.page-header {
flex-flow: row wrap;
p {
flex: 1 0;
font-size: 1em;
font-weight: 500;
line-height: 3em;
padding: 0;
}
input[type="text"] {
flex: 1 0;
font-size: 1em;
font-weight: 500;
line-height: 3em;
}
a {
display: block;
width: 24px;
line-height: 100%;
}
}
}
}
#content-scene {
padding: 20px;
display: flex;
color: var(--color);
background-color: var(--bg);
flex-flow: column nowrap;
align-items: center;
#header {
width: 100%;
padding: 20px;
max-width: 840px;
margin-bottom: 16px;
background-color: var(--contentBg);
border: 1px solid var(--border);
display: flex;
flex-flow: column;
align-items: center;
#title {
padding: 8px 0;
grid-column-start: 1;
grid-column-end: -1;
font-size: 36px;
font-weight: 700;
word-break: break-word;
hyphens: none;
text-align: center;
}
}
#content {
width: 100%;
padding: 20px;
max-width: 840px;
background-color: var(--contentBg);
border: 1px solid var(--border);
* {
font-size: 18px;
line-height: 180%;
&:not(:last-child) {
margin-bottom: 20px;
}
}
a {
color: var(--color);
text-decoration: underline;
&:hover,
&:focus {
color: var(--main);
}
}
pre,
code {
overflow: auto;
border: 1px solid var(--border);
font-family: "Ubuntu Mono", "Courier New", Courier, monospace;
font-size: 16px;
}
pre {
padding: 8px;
> code {
border: 0;
}
}
ol,
ul {
padding-left: 16px;
}
img {
height: auto;
max-width: 100%;
}
table {
border: 1px solid var(--border);
border-collapse: collapse;
tr,
th,
td {
border: 1px solid var(--border);
}
}
}
}
#page-home {
> .empty-message {
max-width: 400px;
font-size: 1em;
background-color: var(--contentBg);
border: 1px solid var(--border);
padding: 16px;
margin: 16px;
color: var(--errorColor);
}
#edit-box {
background-color: var(--selectedBg);
border-bottom: 1px solid var(--main);
}
#bookmarks-grid {
display: grid;
grid-template-rows: min-content;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
grid-gap: 16px;
padding: 16px;
overflow: auto;
.bookmark {
align-self: start;
}
.pagination-box {
grid-column-end: -1;
grid-column-start: 1;
display: flex;
flex-flow: row nowrap;
align-self: start;
a {
padding: 8px;
color: var(--colorLink);
&:hover,
&:focus {
color: var(--main);
}
}
input {
width: 40px;
padding: 8px;
text-align: center;
font-size: 0.9em;
color: var(--color);
border: 1px solid var(--border);
background-color: var(--contentBg);
margin: 0 8px;
}
p {
font-size: 0.9em;
color: var(--colorLink);
line-height: 37px;
font-weight: 600;
&:last-of-type::before {
content: "/";
margin-right: 8px;
}
}
}
&.list {
grid-gap: 0;
padding-bottom: 0;
grid-template-columns: minmax(0, 1000px);
.pagination-box {
padding: 16px 0;
&:first-child {
padding-top: 0;
}
}
@media (max-width: 600px) {
padding: 16px 0 0;
.pagination-box {
padding: 16px;
}
}
}
}
#dialog-tags {
.custom-dialog-body {
grid-template-columns: repeat(2, minmax(0, 1fr));
@media (max-width: 600px) {
grid-template-columns: minmax(0, 1fr);
}
a {
font-size: 1em;
color: var(--color);
span {
&:last-child {
font-size: 1em;
color: var(--colorLink);
margin-left: 4px;
&::before {
content: "(";
margin-right: 2px;
}
&::after {
content: ")";
margin-left: 2px;
}
}
}
&:hover,
&:focus {
color: var(--main);
}
}
}
}
}
#page-setting {
min-height: 0;
max-height: 100%;
display: flex;
flex-flow: column nowrap;
.setting-container {
padding: 8px;
display: flex;
overflow: auto;
flex-flow: column nowrap;
flex: 1 0;
&::after {
content: "";
display: block;
min-height: 1px;
}
details.setting-group {
margin: 8px;
display: block;
max-width: 350px;
color: var(--color);
background-color: var(--contentBg);
border: 1px solid var(--border);
@media (max-width: 600px) {
max-width: 100%;
}
summary {
list-style: none;
font-weight: 600;
width: 100%;
padding: 12px 8px;
font-size: 1.1em;
cursor: pointer;
&:hover {
color: var(--main);
}
&::-webkit-details-marker {
display: none;
}
&::after {
content: "+";
margin-left: 8px;
font-weight: 600;
}
}
&[open] summary {
border-bottom: 1px solid var(--border);
&::after {
content: "-" !important;
}
}
ul {
list-style: none;
li {
padding: 4px 8px;
color: var(--color);
display: flex;
flex-flow: row nowrap;
align-items: center;
}
}
div.setting-group-footer {
padding: 4px 8px;
display: flex;
flex-flow: column nowrap;
align-items: flex-end;
border-top: 1px solid var(--border);
> a {
text-transform: uppercase;
padding: 8px 4px;
font-size: 0.9em;
font-weight: 600;
&:hover {
color: var(--main);
}
&:focus {
outline: none;
color: var(--main);
border-bottom: 1px dashed var(--main);
}
}
}
}
}
#setting-display,
#setting-bookmarks {
display: flex;
flex-flow: column nowrap;
&[open] {
padding-bottom: 8px;
summary {
margin-bottom: 8px;
}
}
label {
padding: 4px 8px;
color: var(--color);
display: flex;
flex-flow: row nowrap;
align-items: center;
cursor: pointer;
&:hover,
&:focus {
text-decoration: underline;
text-decoration-color: var(--main);
}
> input[type="checkbox"] {
margin-right: 8px;
}
}
}
#setting-accounts {
summary {
margin-bottom: 0;
}
ul {
list-style: none;
li {
padding: 8px;
display: flex;
flex-flow: row nowrap;
align-items: center;
&:not(:last-child) {
border-bottom: 1px solid var(--border);
}
p {
font-size: 1em;
color: var(--color);
flex: 1 0;
span {
color: var(--colorLink);
}
}
a {
margin-left: 8px;
color: var(--colorLink);
&:hover {
color: var(--main);
}
}
}
}
}
#setting-system-info {
ul {
padding-top: 4px;
padding-bottom: 4px;
li {
span {
margin-left: 8px;
}
}
}
}
}