Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set up about tab, UI adjustments #30

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/assets/scss/App.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import "./vars";

.App {
padding: 10px;
box-sizing: border-box;
font-family: "Montserrat", sans-serif;
font-size: 12px;
Expand All @@ -22,22 +21,31 @@
align-items: center;
margin-bottom: 7px;
margin-top: 7px;
&.location-picker-label {
margin-top: 12px;
}
&.latitude {
margin-bottom:12px;
}
}

.tab-content {
//display: none; would be easier, but it somehow Seasons 3D view doesn't initialize itself properly
// display: none; would be easier, but it somehow Seasons 3D view doesn't initialize itself properly
// when display: none; is used.
visibility: hidden;
width: 0;
height: 0;
position: absolute;
padding: 3px;
border-top: 1px solid #777777;
padding-left: 9px $edge-padding $edge-padding $edge-padding;

// note each .tab-content is a wrapper for tab.location, tab.simulation, tab.about
// eahc of which maintain their own static layout widths
// this is 100% wide to cover the space affored by CODAP window whose width can change
&.active {
background-color: white;
visibility: visible;
width: auto;
height: auto;
width: 100%;
height: 100%;
}
}
}
1 change: 1 addition & 0 deletions src/assets/scss/about-tab.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "./vars.scss";
81 changes: 41 additions & 40 deletions src/assets/scss/header.scss
Original file line number Diff line number Diff line change
@@ -1,64 +1,65 @@
@import "./vars.scss";

.header {
p {
margin: 0;
}

.info-icon {
position: absolute;
top: 7px;
right: 7px;
}

.plugin-info-popup {
display: flex;
transform: translateX(-50px);
position: absolute;
background-color: white;
box-shadow: 0px 2px 4px rgba(silver, 0.4);
padding: 10px;
border-radius: 4px;
border: 1.5px solid rgba($codap-teal, 0.3);
width: 150px;
top: 30px;
right: -20px;
&.hidden {
display: none;
}
}
}
$tab-height: 26px;
$general-tab-width: 80px;
$location-tab-width: 74px;
$simulation-tab-width: 88px;
$about-tab-width: 60px;

.tab-container {
display: flex;
background-color: white;
padding-top:$edge-padding + 4px;
padding-left: $edge-padding;
padding-right: $edge-padding;
width: 100%;
margin-bottom: 0;
position: relative;
z-index: 1;
justify-content: flex-start;
border-bottom:1px solid #222;
height: $tab-height;
display: flex;

.tab {
flex: 0 0 auto;
position: absolute;
text-align: center;
padding: 10px 20px;
padding: 4px $tab-padding;
cursor: pointer;
color: #666;
border: 1px solid $codap-teal;
border-bottom: none;
color: #222;
border: 1px solid #222;
margin-right: -1px;
position: relative;
border-radius: 8px 8px 0 0;
background-color: #e9e9e9;
border-radius: 4px 4px 0 0;
display:inline-block;
bottom:-1px;
background-color: #f0f0f0;

&.active {
background-color: white;
color: $codap-teal;
border-bottom: 1px solid white;
z-index: 2;
font-weight: bold;
z-index: 3;
height: 18px;
}

&:hover:not(.active) {
background-color: #e0e0e0;
}

&.location {
left: $edge-padding;
}

&.simulation {
left: $edge-padding + $location-tab-width;
&.disabled {
color: silver;
}
}

&.about {
left: $edge-padding + $location-tab-width + $simulation-tab-width;
&.active {
left: $edge-padding + $location-tab-width + $simulation-tab-width - 1px;
}
}
}
}
9 changes: 5 additions & 4 deletions src/assets/scss/location-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@

.location-picker-label {
position: relative;
margin-top:6px;
.location-icon {
position: absolute;
left: 4px;
top: 26px;
top: 27px;
z-index: 1;
}
}

.location-picker {
display:flex;
position: relative;
margin-bottom: 12px;
justify-content: space-between;

input {
padding: 5px;
height: $input-height;
width: 100%;
border-radius: 4px;
border-radius: $input-border-radius;
box-sizing: border-box;
border: 1.5px solid rgba($codap-teal, 0.3);
border: $input-border;
padding-left: 25px;
outline: none;
&:active, &:focus {
Expand Down
72 changes: 49 additions & 23 deletions src/assets/scss/location-tab.scss
Original file line number Diff line number Diff line change
@@ -1,41 +1,64 @@
@import "./vars";

.location-tab {
width: 350px;
padding:10px;
box-sizing: border-box;
width: $location-tab-width;
height: $location-tab-height;
padding: $tab-padding;

.intro {
padding-top: 6px;
padding-bottom: 6px;
}

hr {
width: 100%;
margin: 10px 0;
border: none;
border-top: 1.5px solid rgba($codap-teal, 0.3);
border-top: 1px solid #aaa;
&.light {
border-top: 1px solid $codap-teal-light;
}
&.above-attrs {
margin-top:22px;
margin-bottom:20px;
}
}

.latitude,
.longitude {
justify-content: space-between;
display: flex;
align-items: center;
label {
margin-left: auto;
text-align: right;
margin-right: 10px;
}
input {
width: 250px;
padding: 5px;
border-radius: 4px;
width: 236px;
padding: 7px 8px;
border-radius: $input-border-radius;
box-sizing: border-box;
border: 1.5px solid rgba($codap-teal, 0.3);
border: $input-border;
}
}

.or-container {
box-sizing: border-box;
position: relative;
text-align: left;
padding: $tab-padding 0px;
}

.or {
display: none; // TODO: bring this or element back
display: inline-block;
position: absolute;
top: 11px;
background-color: white;
width: 40px;
padding:0px 10px;
width: 30px;
padding:0px $tab-padding + 4px;
color: $codap-teal;
font-weight: bold;
}

.latitude {
margin-top: 12px;
}

.attributes-selection {
display: flex;
flex-direction: column;
Expand All @@ -49,11 +72,11 @@
display: flex;
flex-wrap: wrap;
width: 100%;
margin-top: 10px;
margin-top: $tab-padding;
gap: 3px;

li.token {
padding: 6px 12px;
padding: 8px $tab-padding;
border-radius: 20px;
cursor: pointer;
transition: background-color 0.3s, color 0.3s;
Expand All @@ -63,16 +86,17 @@

&.on {
background-color: $codap-teal-lightest;
color: $codap-teal;
border: 1px solid $codap-teal;
}

&.off {
background-color: white;
color: #aaa;
border: 1px solid $codap-teal;
}
}
li.token:hover {
background-color: $codap-teal-lightest;
}
}
}

Expand All @@ -81,10 +105,11 @@

button {
background-color: white;
padding: 6px 12px;
font-family: "Montserrat", sans-serif;
font-weight: medium;
padding: 9px 12px;
border-radius: 4px;
margin-left: 10px;
cursor: pointer;
border: 1px solid $codap-teal;
color: $codap-teal;
transition: background-color 0.3s, color 0.3s;
Expand All @@ -98,6 +123,7 @@
&:hover:not(:disabled) {
background-color: $codap-teal-light;
color: white;
cursor: pointer;
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/assets/scss/simulation-tab.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@import "./vars.scss";

.simulation-tab {
padding: $tab-padding;
width: $sim-tab-width;
height: $sim-tab-height;
.get-data-button {
position: relative;
top: -15px;
Expand Down
19 changes: 18 additions & 1 deletion src/assets/scss/vars.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
$codap-teal: #177991;
$codap-teal-light: #72bfca;
$codap-teal-lightest: rgba(114, 191, 202, 0.25);
$codap-teal-lightest: rgba(114, 191, 202, 0.25);
$edge-padding: 4px;

$location-tab-width: 340px;
$location-tab-height: 630px;

$sim-tab-width: 690px;
$sim-tab-height: $location-tab-height;

$about-tab-width: $location-tab-width;
$about-tab-height: $location-tab-height;

$tab-padding: 10px;
$input-height: 32px;
$input-margin: 0 0 12px 8px;
$input-border-radius: 3px;
$input-border: solid 1px rgba(23, 121, 145, 0.75);

Loading
Loading