-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(list): add overview and a little bit of styling
- Loading branch information
patrickjahr
committed
Apr 5, 2024
1 parent
c6cfee1
commit a256638
Showing
24 changed files
with
270 additions
and
16 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
import { Route } from '@angular/router'; | ||
|
||
export const appRoutes: Route[] = []; | ||
export const appRoutes: Route[] = [ | ||
{ | ||
path: '', | ||
pathMatch: 'full', | ||
redirectTo: 'overview', | ||
}, | ||
{ | ||
path: 'overview', | ||
loadComponent: () => | ||
import('./pages/overview/overview.component').then( | ||
(m) => m.OverviewComponent | ||
), | ||
}, | ||
// TODO: Add routes for the other samples | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
padding: 1rem; | ||
border: 1px solid; | ||
background: rgb(255, 255, 255); | ||
color: rgb(0, 0, 0); | ||
border-radius: 8px; | ||
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px; | ||
} | ||
|
||
.sk-title { | ||
font-size: 1.2rem; | ||
line-height: 2rem; | ||
width: 100%; | ||
border-bottom: 1px rgb(0, 0, 0) solid; | ||
} | ||
|
||
.sk-actions { | ||
display: flex; | ||
justify-content: flex-end; | ||
gap: 1rem; | ||
|
||
a { | ||
-webkit-appearance: none; | ||
text-decoration: none; | ||
padding: 0.5rem 1rem; | ||
border-radius: 100svh; | ||
background: rgb(252, 0, 84); | ||
color: rgb(255, 255, 255); | ||
transition: background 0.3s ease-in-out; | ||
|
||
@media (hover) { | ||
&:hover { | ||
background: rgba(255, 0, 84, 0.6); | ||
} | ||
} | ||
|
||
&:active { | ||
background: rgba(255, 0, 84, 0.8); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="sk-title">{{ label() }}</div> | ||
<ng-content></ng-content> | ||
<div class="sk-actions"> | ||
<a [routerLink]="link()">View Component</a> | ||
</div> |
21 changes: 21 additions & 0 deletions
21
apps/demo-app/src/app/components/card/card.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { CardComponent } from './card.component'; | ||
|
||
describe('CardComponent', () => { | ||
let component: CardComponent; | ||
let fixture: ComponentFixture<CardComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [CardComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(CardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { RouterLink } from '@angular/router'; | ||
|
||
@Component({ | ||
selector: 'app-card', | ||
standalone: true, | ||
imports: [CommonModule, RouterLink], | ||
templateUrl: './card.component.html', | ||
styleUrl: './card.component.css', | ||
}) | ||
export class CardComponent { | ||
link = input.required<string>(); | ||
label = input.required<string>(); | ||
} |
4 changes: 4 additions & 0 deletions
4
apps/demo-app/src/app/components/top-bar/top-bar.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<img src="../../../assets/qupaya_logo_small.png" alt=""> | ||
<div class="sk-container"> | ||
<ng-content></ng-content> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
apps/demo-app/src/app/components/top-bar/top-bar.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:host { | ||
|
||
display: flex; | ||
align-items: center; | ||
gap: 1rem; | ||
padding: 0 1rem; | ||
height: var(--sk-top-bar-height); | ||
} | ||
|
||
.sk-container { | ||
flex: 1; | ||
} | ||
|
||
img { | ||
justify-self: flex-start; | ||
height: 42px; | ||
} |
21 changes: 21 additions & 0 deletions
21
apps/demo-app/src/app/components/top-bar/top-bar.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { TopBarComponent } from './top-bar.component'; | ||
|
||
describe('TopBarComponent', () => { | ||
let component: TopBarComponent; | ||
let fixture: ComponentFixture<TopBarComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [TopBarComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(TopBarComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
apps/demo-app/src/app/components/top-bar/top-bar.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-top-bar', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './top-bar.component.html', | ||
styleUrl: './top-bar.component.scss', | ||
}) | ||
export class TopBarComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.sk-content { | ||
width: 100%; | ||
max-width: max(400px, 70vw); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="sk-content"> | ||
<app-top-bar> | ||
ng-sketch from qupaya :-) | ||
</app-top-bar> | ||
<router-outlet></router-outlet> | ||
</div> |
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
apps/demo-app/src/app/app.component.ts → ...mo-app/src/app/pages/app/app.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { Component } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
import { SketchComponent } from '@qupaya/sketch'; | ||
import { TopBarComponent } from '../../components/top-bar/top-bar.component'; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [RouterModule, SketchComponent], | ||
imports: [RouterModule, SketchComponent, TopBarComponent], | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrl: './app.component.css', | ||
}) | ||
export class AppComponent { | ||
} | ||
export class AppComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
:host { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); | ||
gap: 1rem; | ||
padding: 1rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<app-card label="ListComponent" link="/list-sample/1"> | ||
<span>Lorem ipsum dolor...</span> | ||
</app-card> | ||
<app-card label="WidgetComponent" link="/widget-sample/1"> | ||
<span>Lorem ipsum dolor...</span> | ||
</app-card> | ||
|
21 changes: 21 additions & 0 deletions
21
apps/demo-app/src/app/pages/overview/overview.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { OverviewComponent } from './overview.component'; | ||
|
||
describe('OverviewComponent', () => { | ||
let component: OverviewComponent; | ||
let fixture: ComponentFixture<OverviewComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [OverviewComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(OverviewComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
apps/demo-app/src/app/pages/overview/overview.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { RouterLink } from '@angular/router'; | ||
import { CardComponent } from '../../components/card/card.component'; | ||
|
||
@Component({ | ||
selector: 'app-overview', | ||
standalone: true, | ||
imports: [CommonModule, RouterLink, CardComponent], | ||
templateUrl: './overview.component.html', | ||
styleUrl: './overview.component.css', | ||
}) | ||
export class OverviewComponent {} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>sketch</title> | ||
<base href="/" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico" /> | ||
</head> | ||
<body> | ||
<app-root></app-root> | ||
</body> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>sketch</title> | ||
<base href="/" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet"> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico" /> | ||
</head> | ||
<body> | ||
<app-root></app-root> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
/* You can add global styles to this file, and also import other style files */ | ||
:root { | ||
--sk-top-bar-height: 84px; | ||
--sk-font-family: Montserrat, 'Helevetika Neue', sans-serif; | ||
} | ||
|
||
* { | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
html, body { | ||
font-family: var(--sk-font-family); | ||
color: rgb(255, 255, 255); | ||
background: rgb(59, 61, 64); | ||
background: linear-gradient(149deg, rgba(59, 61, 64, 1) 0%, rgba(252, 0, 84, 1) 100%); | ||
background-repeat: no-repeat; | ||
height: 100svh; | ||
overflow: hidden; | ||
} |