Glassmorphism!

Or however it's called, basically all semi-transparent elements are now blurred, see https://daudix.codeberg.page to see why I did this (if this change is still live ofc)
This commit is contained in:
daudix
2024-02-15 23:02:46 +03:00
parent 049cfb7b63
commit 592a486148
7 changed files with 61 additions and 16 deletions

View File

@ -7,8 +7,11 @@
} }
.inline-button { .inline-button {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--fg-muted-1); background-color: var(--fg-muted-1);
border-radius: var(--rounded-corner); border-radius: var(--rounded-corner);
box-shadow: var(--edge-highlight);
color: var(--fg-color); color: var(--fg-color);
display: inline-block; display: inline-block;
font-size: 0.9rem; font-size: 0.9rem;
@ -26,11 +29,17 @@
} }
&.colored { &.colored {
color: var(--primary-color); -webkit-backdrop-filter: unset;
backdrop-filter: unset;
background-color: transparent; background-color: transparent;
box-shadow: none;
color: var(--primary-color);
&:hover { &:hover {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--primary-color-alpha); background-color: var(--primary-color-alpha);
box-shadow: var(--edge-highlight);
} }
} }
} }

View File

@ -30,24 +30,26 @@ section#comments {
width: 4rem; width: 4rem;
.avatar { .avatar {
-webkit-backdrop-filter: var(--blur);
all: unset; all: unset;
backdrop-filter: var(--blur);
background-color: var(--fg-muted-1); background-color: var(--fg-muted-1);
background-position: 50%; background-position: 50%;
background-size: cover; background-size: cover;
border-radius: var(--rounded-corner); border-radius: var(--rounded-corner);
box-shadow: var(--shadow); box-shadow: var(--edge-highlight), var(--shadow);
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
transition: var(--transition); transition: var(--transition);
width: 100%; width: 100%;
&:hover { &:hover {
box-shadow: var(--shadow-raised); box-shadow: var(--edge-highlight), var(--shadow-raised);
transform: rotate(10deg) scale(1.1); transform: rotate(10deg) scale(1.1);
} }
&:active { &:active {
box-shadow: var(--shadow); box-shadow: var(--edge-highlight), var(--shadow);
transform: scale(var(--active)); transform: scale(var(--active));
} }
} }
@ -61,8 +63,11 @@ section#comments {
grid-area: name; grid-area: name;
.instance { .instance {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--fg-muted-1); background-color: var(--fg-muted-1);
border-radius: 999px; border-radius: 999px;
box-shadow: var(--edge-highlight);
color: var(--fg-color); color: var(--fg-color);
font-size: 0.8rem; font-size: 0.8rem;
padding: 0.25rem 0.75rem; padding: 0.25rem 0.75rem;
@ -79,11 +84,17 @@ section#comments {
} }
&.op { &.op {
-webkit-backdrop-filter: unset;
backdrop-filter: unset;
background-color: transparent; background-color: transparent;
box-shadow: none;
color: var(--primary-color); color: var(--primary-color);
&:hover { &:hover {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--primary-color-alpha); background-color: var(--primary-color-alpha);
box-shadow: var(--edge-highlight);
} }
&::before { &::before {
@ -131,7 +142,10 @@ section#comments {
transition: var(--transition); transition: var(--transition);
&:hover { &:hover {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--red-bg); background-color: var(--red-bg);
box-shadow: var(--edge-highlight);
text-decoration: none; text-decoration: none;
} }

View File

@ -182,13 +182,15 @@ abbr {
} }
aside { aside {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--primary-color-alpha); background-color: var(--primary-color-alpha);
border-radius: var(--rounded-corner); border-radius: var(--rounded-corner);
box-shadow: var(--shadow); box-shadow: var(--shadow);
width: 30%;
padding: 1rem;
margin-inline-start: 1rem;
float: right; float: right;
margin-inline-start: 1rem;
padding: 1rem;
width: 30%;
@media only screen and (max-width: 720px) { @media only screen and (max-width: 720px) {
& { & {
@ -207,10 +209,12 @@ kbd {
} }
code:not(pre code) { code:not(pre code) {
padding: 0.125rem 0.375rem; -webkit-backdrop-filter: var(--blur);
border-radius: var(--rounded-corner-small); backdrop-filter: var(--blur);
background-color: var(--fg-muted-2); background-color: var(--fg-muted-2);
border-radius: var(--rounded-corner-small);
color: var(--red-fg); color: var(--red-fg);
padding: 0.125rem 0.375rem;
} }
pre { pre {
@ -253,6 +257,8 @@ pre {
} }
kbd { kbd {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--fg-muted-2); background-color: var(--fg-muted-2);
border-radius: var(--rounded-corner-small); border-radius: var(--rounded-corner-small);
box-shadow: inset 0 -2px 0 var(--fg-muted-2), 0 -1px 0 var(--fg-muted-3); box-shadow: inset 0 -2px 0 var(--fg-muted-2), 0 -1px 0 var(--fg-muted-3);
@ -262,6 +268,7 @@ kbd {
line-height: normal; line-height: normal;
padding: 0.125rem 0.375rem; padding: 0.125rem 0.375rem;
transition: var(--transition); transition: var(--transition);
// Small nice thingy, keys can be pressed! // Small nice thingy, keys can be pressed!
&:active { &:active {
background-color: var(--fg-muted-3); background-color: var(--fg-muted-3);
@ -271,10 +278,12 @@ kbd {
} }
mark { mark {
padding: 0.125rem 0.375rem; -webkit-backdrop-filter: var(--blur);
border-radius: var(--rounded-corner-small); backdrop-filter: var(--blur);
background-color: var(--primary-color-alpha); background-color: var(--primary-color-alpha);
border-radius: var(--rounded-corner-small);
color: var(--primary-color); color: var(--primary-color);
padding: 0.125rem 0.375rem;
} }
figcaption { figcaption {
@ -285,6 +294,8 @@ figcaption {
} }
details { details {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--fg-muted-1); background-color: var(--fg-muted-1);
border-radius: var(--rounded-corner); border-radius: var(--rounded-corner);
box-shadow: var(--shadow); box-shadow: var(--shadow);
@ -314,10 +325,14 @@ table {
tr { tr {
&:nth-child(even) { &:nth-child(even) {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--fg-muted-1); background-color: var(--fg-muted-1);
} }
th { th {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--fg-muted-2); background-color: var(--fg-muted-2);
} }
} }

View File

@ -1,14 +1,13 @@
#site-nav { #site-nav {
-webkit-backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: var(--blur);
backdrop-filter: saturate(180%) blur(10px); backdrop-filter: var(--blur);
background-color: var(--nav-bg); background-color: var(--nav-bg);
border-radius: 26px; border-radius: 26px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), box-shadow: var(--edge-highlight), 0px 12px 24px -16px rgba(0, 0, 0, 0.5);
0px 12px 24px -16px rgba(0, 0, 0, 0.5);
margin: 1rem auto; margin: 1rem auto;
max-width: min(calc(var(--content-width) + 10rem), 90%);
position: sticky; position: sticky;
top: 1rem; top: 1rem;
max-width: min(calc(var(--content-width) + 10rem), 90%);
z-index: 999; z-index: 999;
nav { nav {

View File

@ -2,6 +2,9 @@
margin: 1rem 0 1rem; margin: 1rem 0 1rem;
padding: 1rem 1rem 0.5rem 1rem; padding: 1rem 1rem 0.5rem 1rem;
border-radius: var(--rounded-corner); border-radius: var(--rounded-corner);
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
box-shadow: var(--edge-highlight), var(--shadow);
* { * {
margin: 0; margin: 0;

View File

@ -14,8 +14,11 @@
} }
.tag { .tag {
-webkit-backdrop-filter: var(--blur);
backdrop-filter: var(--blur);
background-color: var(--fg-muted-1); background-color: var(--fg-muted-1);
border-radius: 999px; border-radius: 999px;
box-shadow: var(--edge-highlight);
color: var(--fg-color); color: var(--fg-color);
padding: 0.25rem 0.75rem; padding: 0.25rem 0.75rem;
text-decoration: none; text-decoration: none;

View File

@ -26,7 +26,9 @@
rgba(255, 255, 255, 0.8) rgba(255, 255, 255, 0.8)
), ),
var(--primary-color); var(--primary-color);
--blur: saturate(180%) blur(10px);
--content-width: 720px; --content-width: 720px;
--edge-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1);
--font-monospace: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, --font-monospace: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
Consolas, "DejaVu Sans Mono", monospace; Consolas, "DejaVu Sans Mono", monospace;
--font-serif: Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", --font-serif: Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif",