Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweak: cfx-ui: placeholder mods page
Yes, this should be on a separate branch, but I don't trust my ability in keeping infinite WIP branches clean enough.
- Loading branch information
1 parent
4c2ea59
commit 99850db
Showing
23 changed files
with
484 additions
and
5 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>mod-detail works!</p> |
Empty file.
25 changes: 25 additions & 0 deletions
25
ext/cfx-ui/src/app/mods/mod-detail/mod-detail.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ModDetailComponent } from './mod-detail.component'; | ||
|
||
describe('ModDetailComponent', () => { | ||
let component: ModDetailComponent; | ||
let fixture: ComponentFixture<ModDetailComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ ModDetailComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ModDetailComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
ext/cfx-ui/src/app/mods/mod-detail/mod-detail.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,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-mod-detail', | ||
templateUrl: './mod-detail.component.html', | ||
styleUrls: ['./mod-detail.component.scss'] | ||
}) | ||
export class ModDetailComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
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,30 @@ | ||
<div class="mod-item" | ||
[class.enabled]="mod.enabled || mod.downloadState == 'available'" | ||
[class.downloading]="mod.downloadState == 'downloading'" | ||
[class.installed]="mod.downloadState == 'installed'"> | ||
<figure><img [src]="mod.iconUri"></figure> | ||
|
||
<div> | ||
<h1>{{mod.displayName}}</h1> | ||
<h2>by {{mod.authorName}}</h2> | ||
</div> | ||
|
||
<span class="icons"> | ||
<span aria-label="Available" data-balloon-pos="left" *ngIf="mod.downloadState == 'available'"> | ||
<i class="fas fa-download"></i> | ||
</span> | ||
<span *ngIf="mod.downloadState == 'downloading'" aria-label="Downloading (42%)" data-balloon-pos="left"> | ||
<i class="fas fa-sync"></i> | ||
</span> | ||
<span *ngIf="mod.downloadState == 'installed' && mod.enabled" aria-label="Installed" data-balloon-pos="left"> | ||
<i class="fas fa-check"></i> | ||
</span> | ||
<span *ngIf="mod.downloadState == 'installed' && !mod.enabled" aria-label="Disabled" data-balloon-pos="left"> | ||
<i class="fas fa-times"></i> | ||
</span> | ||
</span> | ||
|
||
<span class="size">{{ mod.sizeBytes | filesize }}</span> | ||
|
||
<progress [value]="mod.progress"></progress> | ||
</div> |
100 changes: 100 additions & 0 deletions
100
ext/cfx-ui/src/app/mods/mod-item/mod-item.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,100 @@ | ||
@import "variables"; | ||
|
||
$modItemHeight: 9vh; | ||
|
||
.mod-item { | ||
overflow: hidden; | ||
height: $modItemHeight; | ||
position: relative; | ||
|
||
transition: background-color 0.2s; | ||
|
||
@include theme() using ($theme) { | ||
background-color: rgba(gtv($theme, bgColour), .5); | ||
}; | ||
|
||
&:hover { | ||
@include theme() using ($theme) { | ||
background-color: rgba(gtv($theme, bgColour), 1); | ||
}; | ||
} | ||
|
||
margin-top: $padding / 3; | ||
display: flex; | ||
|
||
figure { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
|
||
img { | ||
width: $modItemHeight; | ||
} | ||
} | ||
|
||
&:not(.enabled) figure img { | ||
opacity: .6; | ||
} | ||
|
||
&>div { | ||
padding: $padding; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
|
||
h1 { | ||
font-weight: normal; | ||
font-size: $fontSize * 1.4; | ||
} | ||
|
||
h2 { | ||
font-weight: normal; | ||
font-size: $fontSize * 1.1; | ||
} | ||
} | ||
|
||
span.size { | ||
position: absolute; | ||
bottom: $padding; | ||
right: $padding; | ||
|
||
font-size: $fontSize * 0.6; | ||
} | ||
|
||
span.icons { | ||
position: absolute; | ||
top: $padding; | ||
right: $padding; | ||
|
||
font-size: $fontSize * 0.6; | ||
|
||
span { | ||
padding-left: $padding; | ||
} | ||
} | ||
|
||
progress { | ||
display: none; | ||
appearance: none; | ||
|
||
z-index: 999; | ||
|
||
position: absolute; | ||
bottom: 0px; | ||
width: 100%; | ||
height: 3px; | ||
|
||
&::-webkit-progress-value { | ||
@include theme() using ($theme) { | ||
background-color: rgba(gtv($theme, greenyColour), 1); | ||
box-shadow: rgba(gtv($theme, greenyColour), .8) 0px 0px 8px; | ||
}; | ||
} | ||
} | ||
|
||
&.downloading { | ||
progress { | ||
display: block; | ||
} | ||
} | ||
} |
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,18 @@ | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { ModInfo } from '../mods.service'; | ||
|
||
@Component({ | ||
selector: 'app-mod-item', | ||
templateUrl: './mod-item.component.html', | ||
styleUrls: ['./mod-item.component.scss'] | ||
}) | ||
export class ModItemComponent implements OnInit { | ||
@Input() | ||
mod: ModInfo; | ||
|
||
constructor() { } | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
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,2 @@ | ||
<app-mods-list [source]="installedMods" [searchPlaceholder]="'Search installed mods...'"></app-mods-list> | ||
<app-mods-list [source]="availableMods" [searchPlaceholder]="'Search available mods...'"></app-mods-list> |
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,14 @@ | ||
@import "variables"; | ||
|
||
:host { | ||
display: flex; | ||
|
||
justify-content: space-between; | ||
|
||
@include appContent; | ||
} | ||
|
||
app-mods-list { | ||
width: 50%; | ||
padding: $padding; | ||
} |
Oops, something went wrong.