Skip to content

Commit

Permalink
mobile CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
morandd committed Nov 25, 2024
1 parent 2123fe1 commit f062be5
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 13 deletions.
7 changes: 6 additions & 1 deletion src/components/COGURL.astro
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ function viewCOG() {
pointer-events: auto;
}
}
</style>
@media (max-width: 40rem) {
.cogurl {
display: none;
}
}
</style>
2 changes: 1 addition & 1 deletion src/components/ChoosePalette.astro
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ document.addEventListener('DOMContentLoaded', () => {
<style>
.choosepalette {
display: flex;
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
gap: 1rem;
margin: 0 auto;


input{
Expand Down
12 changes: 10 additions & 2 deletions src/components/Colorbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,32 @@ function updateColorbar() {

#colorbar {
width: 400px;
max-width: 100%;
height: 5px;
background: red;
border-radius: 5px;
border: 1px solid #ccc;
background-color: red;
backdrop-filter: blur(5px);
padding: 10px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: darkslategray;
background-color: var(--nilu-dark-gray);
background-color: darkgray;
font-size: 0.8em;
border-radius: 5px;
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 auto;
div {
mix-blend-mode: difference;
font-size: 1em;
color: whit;
color: white;
}
}
@media (max-width: 40rem) {
#colorbar {
width: 90%;
}
}
</style>
9 changes: 8 additions & 1 deletion src/components/Logos.astro
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,12 @@
fill: red;
}
}
}
}
@media (max-width: 40rem) {
#nilulogo {
left: auto;
right: 0.5rem;
top: 0.5rem;
}
}
</style>
9 changes: 9 additions & 0 deletions src/components/LowerRightCornerUI.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,14 @@ import ChoosePalette from './ChoosePalette.astro';
gap: 0.5rem;
bottom: 1rem;
right: 1rem;
max-width: 100vw;
overflow: auto;
}
@media (max-width: 40rem) {
.lower-right-corner-ui {
width: 100vw;
right: 0;
bottom: 0.5rem;
}
}
</style>
12 changes: 11 additions & 1 deletion src/components/Toaster.astro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ window.newToast = ( message) => {
position: fixed;
right: 1rem;
top: 1rem;
max-width: 40rem;
max-width: min(40rem, 100vw);
display: flex;
flex-direction: column;
gap: 0.5rem;
Expand All @@ -58,5 +58,15 @@ window.newToast = ( message) => {
}
}
}
@media (max-width: 40rem) {
#toaster {
right: 0;
top: 1rem;
width: 100vw;
.toast {
background-color: #eee;
border-radius: 2px;
}
}

</style>
22 changes: 15 additions & 7 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
html {
font-family: 'Inter', 'System-ui', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}


@keyframes shift-right {
0% { transform: translateX(0); }
50% { transform: translateX(1rem); }
100% { transform: translateX(0); }
}

.stactreeview {
/*background-color: color-mix(in srgb, var(--nilu-light-blue), 30% transparent);*/
background-color: transparent;
transition: background-color 0.1s;
summary {

.staclogo {
width: 50px;
height: 50px;
Expand All @@ -29,21 +36,22 @@ html {
background-position: center;
vertical-align: middle;
mix-blend-mode: multiply; /* Set white as transparent */
transform: rotate(0deg);
position: relative;
transition: transform 0.4s ease-in-out;
transform: translateX(0);
&:hover {
transform: rotate(360deg);

/* Play an animaton to shift it right 2rem then back again */
animation: shift-right 0.4s ease-in-out;
}
}
}
&[open] {
background-color: #efefef;
max-height: 100vh;
max-height: 100dvh;
height:100dvh;
}
max-height: 80vh;
width: 20vw;
max-height: 80dvh;
width: max(20vw, 14rem);
padding: 1rem;
overflow: auto;
position: absolute;
Expand Down

0 comments on commit f062be5

Please sign in to comment.