forked from nostr/nostrweb
feed: update feed colors and spacing
- font: use regular font and smaller font size on mobile - made publish button smaller on mobile - add borders between notes and increase card spacing - changed background colors of cards and nav
parent
5e61dcef0c
commit
36ba582dd4
|
@ -173,7 +173,7 @@ export const renderProfile = (id: string) => {
|
||||||
if (h1) {
|
if (h1) {
|
||||||
h1.textContent = profile.name;
|
h1.textContent = profile.name;
|
||||||
} else {
|
} else {
|
||||||
header.prepend(elem('h1', {}, profile.name));
|
header.append(elem('h1', {}, profile.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -1,13 +1,14 @@
|
||||||
/* https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Media_objects */
|
/* https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Media_objects */
|
||||||
.mbox {
|
.mbox {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
border-bottom: 1px solid var(--bgcolor-nav);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
/* margin-bottom: 1rem; */
|
/* margin-bottom: 1rem; */
|
||||||
max-width: var(--content-width);
|
max-width: var(--content-width);
|
||||||
padding: 0 0 0 var(--gap-half);
|
padding: var(--gap-half) var(--gap-half) 0 var(--gap-half);
|
||||||
}
|
}
|
||||||
.mbox:last-child {
|
.mbox:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
@ -42,6 +43,7 @@
|
||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
|
padding-bottom: var(--gap-half);
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
.mbox-body div a {
|
.mbox-body div a {
|
||||||
|
@ -52,11 +54,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.mbox-header {
|
.mbox-header {
|
||||||
|
align-items: start;
|
||||||
|
display: flex;
|
||||||
|
gap: var(--gap-quarter);
|
||||||
|
justify-content: space-between;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
min-height: 1.8rem;
|
||||||
}
|
}
|
||||||
.mbox-header a {
|
.mbox-header a {
|
||||||
font-size: var(--font-small);
|
font-size: var(--font-small);
|
||||||
}
|
}
|
||||||
|
.mbox-header small {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.mbox-kind0-name {
|
.mbox-kind0-name {
|
||||||
color: var(--color);
|
color: var(--color);
|
||||||
|
@ -83,19 +93,17 @@
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
}
|
}
|
||||||
.mbox .mbox {
|
.mbox .mbox {
|
||||||
|
border-bottom: none;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.mbox .buttons {
|
|
||||||
margin-top: .2rem;
|
|
||||||
}
|
|
||||||
.mbox button:not(#publish) {
|
.mbox button:not(#publish) {
|
||||||
--bg-color: none;
|
--bg-color: none;
|
||||||
--border-color: none;
|
--border-color: none;
|
||||||
}
|
}
|
||||||
.mbox button img + small {
|
.mbox button img + small:not(:empty) {
|
||||||
padding-left: .5rem;
|
padding-left: .5rem;
|
||||||
}
|
}
|
||||||
.mbox-replies {
|
.mbox-replies {
|
||||||
|
@ -208,10 +216,14 @@
|
||||||
.mbox-replies .mbox .mbox .mbox-body {
|
.mbox-replies .mbox .mbox .mbox-body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
font-size: var(--font-small);
|
|
||||||
padding-bottom: var(--gap-half);
|
padding-bottom: var(--gap-half);
|
||||||
padding-top: var(--gap-eight);
|
padding-top: var(--gap-eight);
|
||||||
}
|
}
|
||||||
|
@media (orientation: portrait) {
|
||||||
|
.mbox-replies .mbox .mbox .mbox-body {
|
||||||
|
font-size: var(--font-small);
|
||||||
|
}
|
||||||
|
}
|
||||||
.mbox-replies .mbox .mbox .mbox-header a:last-of-type::after {
|
.mbox-replies .mbox .mbox .mbox-header a:last-of-type::after {
|
||||||
content: " ";
|
content: " ";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
|
@ -104,8 +104,8 @@ textarea:focus {
|
||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
gap: var(--gap);
|
gap: var(--gap);
|
||||||
justify-content: start;
|
justify-content: start;
|
||||||
margin-top: var(--gap-half);
|
margin: .6rem 0;
|
||||||
min-height: 3.2rem;
|
min-height: 2.2rem;
|
||||||
}
|
}
|
||||||
form .buttons,
|
form .buttons,
|
||||||
.form .buttons,
|
.form .buttons,
|
||||||
|
|
|
@ -24,6 +24,11 @@
|
||||||
--profileimg-size-half: 2rem;
|
--profileimg-size-half: 2rem;
|
||||||
--profileimg-size-quarter: 1rem;
|
--profileimg-size-quarter: 1rem;
|
||||||
}
|
}
|
||||||
|
@media (orientation: portrait) {
|
||||||
|
:root {
|
||||||
|
--content-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
::selection {
|
::selection {
|
||||||
background: #ff79f9;
|
background: #ff79f9;
|
||||||
|
@ -36,6 +41,9 @@
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
html {
|
html {
|
||||||
|
--color: rgb(93, 93, 93);
|
||||||
|
--color-accent: rgb(16, 93, 176);
|
||||||
|
--color-danger: #0e0e0e;
|
||||||
--bgcolor: #fff;
|
--bgcolor: #fff;
|
||||||
--bgcolor-nav: gainsboro;
|
--bgcolor-nav: gainsboro;
|
||||||
--bgcolor-accent: #7badfc;
|
--bgcolor-accent: #7badfc;
|
||||||
|
@ -43,24 +51,21 @@
|
||||||
--bgcolor-danger-input: rgba(255 255 255 / .85);
|
--bgcolor-danger-input: rgba(255 255 255 / .85);
|
||||||
--bgcolor-inactive: #bababa;
|
--bgcolor-inactive: #bababa;
|
||||||
--bgcolor-textinput: #fff;
|
--bgcolor-textinput: #fff;
|
||||||
--color: rgb(68 68 68);
|
|
||||||
--color-accent: rgb(16, 93, 176);
|
|
||||||
--color-danger: #0e0e0e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
html {
|
html {
|
||||||
--bgcolor: #191919;
|
|
||||||
--bgcolor-nav: darkslateblue;
|
|
||||||
--bgcolor-accent: rgb(16, 93, 176);
|
|
||||||
--bgcolor-danger: rgb(169, 0, 0);
|
|
||||||
--bgcolor-danger-input: rgba(0 0 0 / .5);
|
|
||||||
--bgcolor-inactive: #434343;
|
|
||||||
--bgcolor-textinput: #0e0e0e;
|
|
||||||
--color: #e3e3e3;
|
--color: #e3e3e3;
|
||||||
--color-accent: #828282;
|
--color-accent: #828282;
|
||||||
--color-danger: #e3e3e3;
|
--color-danger: #e3e3e3;
|
||||||
|
--bgcolor: #101010;
|
||||||
|
--bgcolor-nav: rgb(31, 22, 51);
|
||||||
|
--bgcolor-accent: rgb(16, 93, 176);
|
||||||
|
--bgcolor-danger: rgb(169, 0, 0);
|
||||||
|
--bgcolor-danger-input: rgba(0 0 0 / .5);
|
||||||
|
--bgcolor-inactive: #202122;
|
||||||
|
--bgcolor-textinput: #0e0e0e;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
@ -81,9 +86,15 @@ body {
|
||||||
background-color: var(--bgcolor);
|
background-color: var(--bgcolor);
|
||||||
color: var(--color);
|
color: var(--color);
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
line-height: 1.313;
|
line-height: 1.375;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
@media (orientation: portrait) {
|
||||||
|
body {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
@ -98,7 +109,7 @@ button,
|
||||||
input,
|
input,
|
||||||
select,
|
select,
|
||||||
textarea {
|
textarea {
|
||||||
font-family: monospace;
|
font-family: sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
small,
|
small,
|
||||||
|
|
|
@ -109,7 +109,6 @@ nav button {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin-inline: auto;
|
margin-inline: auto;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: var(--gap-half) 0 0 0;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
main .content {
|
main .content {
|
||||||
|
@ -127,6 +126,33 @@ nav a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content > header {
|
.content h1 {
|
||||||
padding: 3rem 3rem 3rem calc(var(--profileimg-size) + var(--gap));
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero {
|
||||||
|
--extra-space: calc(var(--profileimg-size) + var(--gap-half));
|
||||||
|
border-bottom: 1px solid var(--bgcolor-nav);
|
||||||
|
padding: var(--gap-half);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero h1 {
|
||||||
|
padding-left: var(--extra-space);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero small {
|
||||||
|
color: var(--color-accent);
|
||||||
|
font-size: 1.1rem;
|
||||||
|
display: block;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow: clip;
|
||||||
|
text-align: center;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
@media (min-width: 64ch) {
|
||||||
|
.hero small {
|
||||||
|
padding-left: var(--extra-space);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,10 @@
|
||||||
}
|
}
|
||||||
@media (orientation: portrait) {
|
@media (orientation: portrait) {
|
||||||
#bubble {
|
#bubble {
|
||||||
bottom: calc(4 * var(--gap));
|
bottom: 7rem;
|
||||||
right: var(--gap);
|
right: 3rem;
|
||||||
|
height: 7rem;
|
||||||
|
width: 7rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#bubble svg {
|
#bubble svg {
|
||||||
|
|
|
@ -145,7 +145,7 @@ export const elemCanvas = (text: string) => {
|
||||||
const color = `#${text.slice(0, 6)}`;
|
const color = `#${text.slice(0, 6)}`;
|
||||||
context.fillStyle = color;
|
context.fillStyle = color;
|
||||||
context.fillRect(0, 0, 80, 80);
|
context.fillRect(0, 0, 80, 80);
|
||||||
context.fillStyle = '#111';
|
context.fillStyle = '#202122';
|
||||||
context.fillRect(0, 50, 80, 32);
|
context.fillRect(0, 50, 80, 32);
|
||||||
context.font = 'bold 18px monospace';
|
context.font = 'bold 18px monospace';
|
||||||
if (color === '#000000') {
|
if (color === '#000000') {
|
||||||
|
|
|
@ -57,7 +57,7 @@ const createContainer = (
|
||||||
const dom: DOMMap = {};
|
const dom: DOMMap = {};
|
||||||
switch (options.type) {
|
switch (options.type) {
|
||||||
case 'profile':
|
case 'profile':
|
||||||
const header = elem('header', {},
|
const header = elem('header', {className: 'hero'},
|
||||||
elem('small', {}, route)
|
elem('small', {}, route)
|
||||||
);
|
);
|
||||||
dom[options.id] = header;
|
dom[options.id] = header;
|
||||||
|
|
Loading…
Reference in New Issue