Skip to content

Commit

Permalink
improve style
Browse files Browse the repository at this point in the history
  • Loading branch information
bastyen committed Feb 15, 2024
1 parent 6f6adbc commit 487a7c5
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 19 deletions.
13 changes: 11 additions & 2 deletions src/components/grw-app/grw-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class GrwApp {
const parentTrek = state.parentTrekId ? state.parentTrekId : state.currentTrekSteps ? this.currentTrekId : null;
state.currentTrek = null;
this.currentTrekId = event.detail;
state.mode = 'treks';
this.showTrek = true;
this.showTrekMap = false;
const url = new URL(window.location.toString());
Expand All @@ -96,6 +97,7 @@ export class GrwApp {
onParentTrekPress(event: CustomEvent<number>) {
state.currentTrek = null;
this.currentTrekId = event.detail;
state.mode = 'treks';
this.showTrek = true;
this.showTrekMap = false;
const url = new URL(window.location.toString());
Expand All @@ -110,6 +112,7 @@ export class GrwApp {
this.currentTrekId = null;
this.showTrek = false;
this.currentTouristicContentId = event.detail;
state.mode = 'touristicContents';
this.showTouristicContent = true;
this.showTouristicContentMap = false;
const url = new URL(window.location.toString());
Expand All @@ -124,6 +127,8 @@ export class GrwApp {
this.currentTrekId = null;
this.showTrek = false;
this.currentTouristicEventId = event.detail;
``;
state.mode = 'touristicEvents';
this.showTouristicEvent = true;
this.showTouristicEventMap = false;
const url = new URL(window.location.toString());
Expand Down Expand Up @@ -166,14 +171,17 @@ export class GrwApp {
window.history.replaceState({ isInitialHistoryWithDetails: true }, '', url);
state.parentTrekId = parentTrekId ? Number(parentTrekId) : null;
this.currentTrekId = Number(trekParam);
state.mode = 'treks';
this.showTrek = true;
} else if (touristicContentParam) {
window.history.replaceState({ isInitialHistoryWithDetails: true }, '', url);
this.currentTouristicContentId = Number(touristicContentParam);
state.mode = 'touristicContents';
this.showTouristicContent = true;
} else if (touristicEventParam) {
window.history.replaceState({ isInitialHistoryWithDetails: true }, '', url);
this.currentTouristicEventId = Number(touristicEventParam);
state.mode = 'touristicEvents';
this.showTouristicEvent = true;
}
}
Expand Down Expand Up @@ -241,6 +249,7 @@ export class GrwApp {
state.currentTouristicEvent = null;
state.currentTrek = null;
this.currentTrekId = trekParam;
state.mode = 'treks';
this.showTrek = true;
} else if (!trekParam && !touristicContentParam && !touristicEventParam) {
this.onDetailsClose();
Expand Down Expand Up @@ -506,8 +515,8 @@ export class GrwApp {
(this.showTouristicContent && !state.currentTouristicContent) ||
(this.showTouristicEvent && !state.currentTouristicEvent) ||
(!state.treks && state.mode === 'treks' && !this.showTrek) ||
(!state.touristicContents && state.mode === 'touristicContents') ||
(!state.touristicEvents && state.mode === 'touristicEvents')) && (
(!state.touristicContents && state.mode === 'touristicContents' && !this.showTouristicContent) ||
(!state.touristicEvents && state.mode === 'touristicEvents' && !this.showTouristicEvent)) && (
<div class={this.isLargeView ? 'grw-large-view-loader-container' : 'grw-loader-container'}>
<grw-loader exportparts="loader" color-primary-container={this.colorSecondaryContainer} color-on-primary-container={this.colorOnSecondaryContainer}></grw-loader>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/components/grw-extended-fab/grw-extended-fab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
&:hover {
box-shadow: var(--elevation-4);
}
.icon,
.label {
.icon {
font-size: 24px;
margin-right: 8px;
color: var(--fab-color);
Expand Down
1 change: 1 addition & 0 deletions src/components/grw-map/grw-map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
.trek-name,
.touristic-content-name,
.touristic-event-name {
color: var(--color-primary-app);
font-weight: 400;
font-size: 16px;
line-height: 24px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,10 @@
.selected-touristic-content-card {
box-shadow: var(--elevation-2);
}

.touristic-content-category-img {
border-radius: 100%;
padding: 2px;
max-height: 20px;
max-width: 20px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,10 @@ grw-touristic-content-detail {
box-shadow: var(--elevation-1);
cursor: pointer;
}

.touristic-content-category-img {
border-radius: 100%;
padding: 2px;
max-height: 20px;
max-width: 20px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,20 @@ export class GrwTouristicEventDetail {
</div>
</div>
<div part="touristic-event-category-container" class="touristic-event-category-container">
<img
part="touristic-event-category-img"
class="touristic-event-category-img"
/* @ts-ignore */
crossorigin="anonymous"
src={touristicEventType.pictogram}
/>
<div part="touristic-event-category-name" class="touristic-event-category-name">
{touristicEventType.type}
</div>
{touristicEventType && touristicEventType.pictogram && (
<img
part="touristic-event-category-img"
class="touristic-event-category-img"
/* @ts-ignore */
crossorigin="anonymous"
src={touristicEventType.pictogram}
/>
)}
{touristicEventType && touristicEventType.type && (
<div part="touristic-event-category-name" class="touristic-event-category-name">
{touristicEventType.type}
</div>
)}
</div>
<div part="name" class="name">
{state.currentTouristicEvent.name}
Expand Down
14 changes: 11 additions & 3 deletions src/components/grw-trek-card/grw-trek-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
justify-content: center;
padding: 8px 16px;
.trek-name {
color: var(--color-on-surface);
color: var(--color-primary-app);
font-size: 22px;
line-height: 28px;
font-weight: 400;
Expand All @@ -49,11 +49,10 @@
.trek-theme {
background-color: var(--color-secondary-container);
color: var(--color-on-secondary-container);
border-radius: var(--border-radius, 8px);
border-radius: var(--border-radius, 40px);
padding: 8px 16px;
margin: 0px 8px 8px 0px;
box-shadow: var(--elevation-0);
border: 1px solid var(--color-outline);
height: 32px;
gap: 8px;
box-sizing: border-box;
Expand Down Expand Up @@ -161,3 +160,12 @@
.is-current-step {
background-color: var(--color-surface-variant);
}

.practice {
.trek-icon {
border-radius: 100%;
padding: 2px;
max-height: 20px;
max-width: 20px;
}
}
12 changes: 10 additions & 2 deletions src/components/grw-trek-detail/grw-trek-detail.scss
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@ grw-trek-detail {
.theme {
background-color: var(--color-secondary-container);
color: var(--color-on-secondary-container);
border-radius: var(--border-radius, 8px);
border-radius: var(--border-radius, 40px);
padding: 8px 16px;
margin: 0px 8px 8px 0px;
box-shadow: var(--elevation-0);
border: 1px solid var(--color-outline);
height: 32px;
gap: 8px;
box-sizing: border-box;
Expand Down Expand Up @@ -682,3 +681,12 @@ grw-trek-detail {
box-shadow: var(--elevation-1);
cursor: pointer;
}

.practice {
.icon {
border-radius: 100%;
padding: 2px;
max-height: 20px;
max-width: 20px;
}
}

0 comments on commit 487a7c5

Please sign in to comment.