Skip to content

Commit

Permalink
feat: First version of light theme + improved css variables usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Divelix committed May 14, 2024
1 parent 5c4880b commit 14561db
Show file tree
Hide file tree
Showing 21 changed files with 124 additions and 156 deletions.
84 changes: 52 additions & 32 deletions src/assets/base.css
Original file line number Diff line number Diff line change
@@ -1,61 +1,81 @@
:root {
--c-light-0: #ffffff;
--c-light-1: #f8f8f8;
--c-light-2: #f2f2f2;
--c-light-1: #eeeeee;
--c-light-t: rgba(235, 235, 235, 0.64);

--c-dark-0: #000000;
--c-dark-1: #181818;
--c-dark-2: #222222;
--c-dark-3: #282828;
--c-dark-4: #333333;
--c-dark-5: #555555;
--c-dark-t: rgba(84, 84, 84, 0.65);

--c-indigo: #2c3e50;
--c-error: #ff0000;

--c-divider-light-1: rgba(60, 60, 60, 0.29);
--c-divider-light-2: rgba(60, 60, 60, 0.12);
--c-divider-dark-1: rgba(84, 84, 84, 0.65);
--c-divider-dark-2: rgba(84, 84, 84, 0.48);

--c-text-light-1: var(--c-indigo);
--c-text-light-2: rgba(60, 60, 60, 0.66);
--c-text-dark-1: var(--c-light-0);
--c-text-dark-2: rgba(235, 235, 235, 0.64);
--c-x: #ff0000;
--c-y: #00ff00;
--c-z: #0000ff;
--c-x-t: #ff000077;
--c-y-t: #00ff0077;
--c-z-t: #0000ff77;

--quat-bg-alpha: 0.3;
--c-bg-quat-x: rgba(255, 0, 0, var(--quat-bg-alpha));
--c-bg-quat-y: rgba(0, 255, 0, var(--quat-bg-alpha));
--c-bg-quat-z: rgba(0, 0, 255, var(--quat-bg-alpha));
--c-bg-quat-w: rgba(255, 255, 0, var(--quat-bg-alpha));

--c-bg-btn: #282828;
--c-bg-btn-hover: #333;
--c-bg-btn-active: #555;

--cont-border-radius: 20px;
}

/* semantic color variables for this project */
:root {
--color-background: var(--c-dark-1);
--color-background-soft: var(--c-dark-2);
--color-background-mute: var(--c-dark-3);
--c-text-main: var(--c-dark-t);
--c-text-accent: var(--c-dark-0);

--c-bg-main: var(--c-light-1);
--c-bg-accent: var(--c-light-2);
--c-bg-canvas: var(--c-light-2);

--color-border: var(--c-divider-dark-2);
--color-border-hover: var(--c-divider-dark-1);
--c-selection: var(--c-light-1);
--c-bg-tooltip: var(--c-light-0);
--c-text-tooltip: var(--c-dark-0);

--color-heading: var(--c-text-dark-1);
--color-text: var(--c-text-dark-2);
--c-btn-border: var(--c-light-t);
--c-btn-bg: var(--c-light-3);
--c-btn-bg-hover: var(--c-light-4);
--c-btn-bg-active: var(--c-light-5);
--c-table-bg: var(--c-light-3);
--c-table-header: var(--c-light-4);
--c-table-border: var(--c-light-t);
--c-svg: var(--c-dark-t);
--c-svg-hover: var(--c-dark-0);
}

.dark {
--color-background: var(--c-light-0);
--color-background-soft: var(--c-light-1);
--color-background-mute: var(--c-light-2);
--c-text-main: var(--c-light-t);
--c-text-accent: var(--c-light-0);

--c-bg-main: var(--c-dark-1);
--c-bg-accent: var(--c-dark-2);
--c-bg-canvas: var(--c-dark-2);

--c-selection: var(--c-dark-0);
--c-bg-tooltip: var(--c-dark-0);
--c-text-tooltip: var(--c-light-0);

--c-btn-border: var(--c-dark-t);
--c-btn-bg: var(--c-dark-3);
--c-btn-bg-hover: var(--c-dark-4);
--c-btn-bg-active: var(--c-dark-5);

--color-border: var(--c-divider-light-2);
--color-border-hover: var(--c-divider-light-1);
--c-table-bg: var(--c-dark-3);
--c-table-header: var(--c-dark-4);
--c-table-border: var(--c-dark-t);

--color-heading: var(--c-text-light-1);
--color-text: var(--c-text-light-1);
--c-svg: var(--c-light-t);
--c-svg-hover: var(--c-light-0);
}

*,
Expand All @@ -67,8 +87,8 @@
}

body {
color: var(--color-text);
background: var(--color-background);
color: var(--c-text-main);
background: var(--c-bg-main);
transition:
color 0.5s,
background-color 0.5s;
Expand Down
7 changes: 3 additions & 4 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ h2 {
}

::selection {
background-color: black;
background-color: var(--c-selection);
}

.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}

.tooltip .tooltiptext {
line-height: 1.2;
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
background-color: var(--c-bg-tooltip);
color: var(--c-text-tooltip);
text-align: center;
padding: 5px 0;
border-radius: 6px;
Expand Down
8 changes: 4 additions & 4 deletions src/components/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ button {
padding: 10px;
border-radius: 20%;
cursor: pointer;
border: 1px solid var(--c-divider-dark-1);
background-color: var(--c-bg-btn);
border: 1px solid var(--c-btn-border);
background-color: var(--c-btn-bg);
}
button:hover {
background-color: var(--c-bg-btn-hover);
background-color: var(--c-btn-bg-hover);
}
button:active {
background-color: var(--c-bg-btn-active);
background-color: var(--c-btn-bg-active);
}
/* Toast animation */
Expand Down
15 changes: 7 additions & 8 deletions src/components/CoordControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ button {
font-size: 24pt;
padding-left: 10px;
padding-right: 10px;
color: #ffffff;
/* text-shadow: 0px 0px 5px #000; */
color: var(--c-text-accent);
border-width: 0px;
cursor: pointer;
}
Expand All @@ -84,26 +83,26 @@ button {
}

.x .label {
background-color: #ff000077;
background-color: var(--c-x-t);
}

.x button {
background-color: #ff0000;
background-color: var(--c-x);
}

.y .label {
background-color: #00ff0077;
background-color: var(--c-y-t);
}

.y button {
background-color: #00ff00;
background-color: var(--c-y);
}

.z .label {
background-color: #0000ff77;
background-color: var(--c-z-t);
}

.z button {
background-color: #0000ff;
background-color: var(--c-z);
}
</style>
18 changes: 9 additions & 9 deletions src/components/Help.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,27 @@ button {
width: 50px;
height: 50px;
padding: 0 15px 0 15px;
border: 1px solid var(--c-divider-dark-1);
background-color: var(--c-bg-btn);
border: 1px solid var(--c-btn-border);
background-color: var(--c-btn-bg);
border-radius: 50%;
cursor: pointer;
z-index: 2;
}
button:hover {
background-color: var(--c-bg-btn-hover);
background-color: var(--c-btn-bg-hover);
}
button:active {
background-color: var(--c-bg-btn-active);
background-color: var(--c-btn-bg-active);
}
.content {
z-index: 1;
top: 15px;
right: 15px;
border: 1px solid var(--c-divider-dark-1);
background-color: var(--c-bg-btn);
border: 1px solid var(--c-table-border);
background-color: var(--c-table-bg);
padding: 0 70px 20px 70px;
display: flex;
flex-direction: column;
Expand All @@ -122,12 +122,12 @@ table {
}
.header-row {
color: white;
background-color: var(--c-bg-btn-hover);
color: var(--c-text-accent);
background-color: var(--c-table-header);
}
td {
border: 1px solid var(--c-divider-dark-1);
border: 1px solid var(--c-table-border);
padding: 10px;
}
</style>
38 changes: 2 additions & 36 deletions src/components/Links.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,45 +30,11 @@ a {
}
svg {
fill: var(--c-text-dark-2);
fill: var(--c-svg);
transition: fill 0.3s;
}
svg:hover {
fill: white;
}
/* a:hover {
background-color: var(--c-bg-btn-hover);
}
a:active {
background-color: var(--c-bg-btn-active);
} */
.content {
z-index: 1;
top: 15px;
right: 15px;
border: 1px solid var(--c-divider-dark-1);
background-color: var(--c-bg-btn);
padding: 0 70px 20px 70px;
display: flex;
flex-direction: column;
}
table {
border-collapse: collapse;
line-height: 1;
}
.header-row {
color: white;
background-color: var(--c-bg-btn-hover);
}
td {
border: 1px solid var(--c-divider-dark-1);
padding: 10px;
fill: var(--c-svg-hover);
}
</style>
17 changes: 8 additions & 9 deletions src/components/Snap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,19 @@ function decSnapDenom() {
.pi {
width: 15px;
height: 15px;
/* margin-bottom: 7px; */
}
hr {
width: 100%;
border: 1px solid var(--c-text-dark-2);
border: 1px solid var(--c-text-main);
}
.active_hr {
border-color: white;
border-color: var(--c-text-accent);
}
.active {
color: white;
color: var(--c-text-accent);
}
.buttons {
Expand All @@ -78,17 +77,17 @@ button {
font-size: 12pt;
border-width: 0px;
cursor: pointer;
color: var(--c-text-dark-2);
border: 1px solid var(--c-divider-dark-1);
background-color: var(--c-bg-btn);
color: var(--c-text-main);
border: 1px solid var(--c-btn-border);
background-color: var(--c-btn-bg);
}
button:hover {
background-color: var(--c-bg-btn-hover);
background-color: var(--c-btn-bg-hover);
}
button:active {
background-color: var(--c-bg-btn-active);
background-color: var(--c-btn-bg-active);
}
.plus {
Expand Down
15 changes: 3 additions & 12 deletions src/components/Vis3D.vue
Original file line number Diff line number Diff line change
Expand Up @@ -415,29 +415,20 @@ span {
}
.x {
color: red
color: var(--c-x)
}
.y {
color: greenyellow
color: var(--c-y)
}
.z {
color: blue
color: var(--c-z)
}
canvas {
width: 500px;
height: 500px;
border-radius: var(--cont-border-radius);
/* width: 300px;
height: 300px; */
}
/* @media screen and (min-aspect-ratio: 1/1) {
canvas {
width: 500px;
height: 500px;
}
} */
</style>
Loading

0 comments on commit 14561db

Please sign in to comment.