Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
fix(#228): styles draw options and move these right
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Nov 1, 2019
1 parent af83cb0 commit 1a36f68
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 35 deletions.
10 changes: 6 additions & 4 deletions remote/src/app/components/app-draw/app-draw.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
canvas {
position: absolute;
app-draw {
canvas {
position: absolute;

transition-duration: var(--left-offset-transition, 0ms);
transform: translate3d(var(--left-offset, 0px), 0px, 0px);
transition-duration: var(--left-offset-transition, 0ms);
transform: translate3d(var(--left-offset, 0px), 0px, 0px);
}
}
33 changes: 16 additions & 17 deletions remote/src/app/components/app-draw/app-draw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class Pencil implements Drawable {

@Component({
tag: 'app-draw',
styleUrl: 'app-draw.scss',
shadow: true
styleUrl: 'app-draw.scss'
})
export class AppDraw {
@Element() el: HTMLElement;
Expand Down Expand Up @@ -125,7 +124,7 @@ export class AppDraw {

private initContext(): Promise<void> {
return new Promise<void>((resolve) => {
const canvas: HTMLCanvasElement = this.el.shadowRoot.querySelector('canvas');
const canvas: HTMLCanvasElement = this.el.querySelector('canvas');

if (!canvas) {
resolve();
Expand All @@ -141,7 +140,7 @@ export class AppDraw {
@Method()
moveDraw(leftOffset: number, transitionDuration: string): Promise<void> {
return new Promise<void>((resolve) => {
const canvas: HTMLCanvasElement = this.el.shadowRoot.querySelector('canvas');
const canvas: HTMLCanvasElement = this.el.querySelector('canvas');

if (!canvas) {
resolve();
Expand All @@ -159,7 +158,7 @@ export class AppDraw {

private start(): Promise<void> {
return new Promise<void>((resolve) => {
this.canvas = this.el.shadowRoot.querySelector('canvas');
this.canvas = this.el.querySelector('canvas');

if (!this.canvas) {
resolve();
Expand All @@ -181,7 +180,7 @@ export class AppDraw {

private end(): Promise<void> {
return new Promise<void>((resolve) => {
this.canvas = this.el.shadowRoot.querySelector('canvas');
this.canvas = this.el.querySelector('canvas');

if (!this.canvas) {
resolve();
Expand Down Expand Up @@ -325,24 +324,24 @@ export class AppDraw {
render() {

const styleColorPicker = {
color: this.color === 'red' ? 'black' : 'red'
color: this.color
};

return ([
<canvas width={this.canvasWidth} height={this.height}></canvas>,
<ion-fab vertical="bottom" horizontal="start" slot="fixed">
<ion-fab-button onClick={() => this.startStopDrawing()}>
<ion-fab vertical="bottom" horizontal="end" slot="fixed" class="ion-margin">
<ion-fab-button onClick={() => this.startStopDrawing()} color="light">
<ion-icon name="brush"></ion-icon>
</ion-fab-button>
<ion-fab-list side="end">
<ion-fab-list side="start">
{this.renderPencilRubber()}
</ion-fab-list>
<ion-fab-list side="top">
<ion-fab-button color="medium" style={styleColorPicker}
<ion-fab-button color="light"
onClick={(e: UIEvent) => this.switchColor(e)}>
<ion-icon name="color-palette"></ion-icon>
<ion-icon name="color-palette" style={styleColorPicker}></ion-icon>
</ion-fab-button>
<ion-fab-button color="medium" onClick={(e: UIEvent) => this.clear(e)}>
<ion-fab-button color="light" onClick={(e: UIEvent) => this.clear(e)}>
<ion-icon name="trash"></ion-icon>
</ion-fab-button>
</ion-fab-list>
Expand All @@ -353,16 +352,16 @@ export class AppDraw {
private renderPencilRubber() {
if (this.action !== DeckdeckgoDrawAction.PENCIL) {
return (
<ion-fab-button color="medium"
<ion-fab-button color="light"
onClick={(e: UIEvent) => this.switchTool(e, DeckdeckgoDrawAction.PENCIL)}>
<ion-icon name="create"></ion-icon>
<ion-icon name="radio-button-off"></ion-icon>
</ion-fab-button>
);
} else {
return (
<ion-fab-button color="medium"
<ion-fab-button color="light"
onClick={(e: UIEvent) => this.switchTool(e, DeckdeckgoDrawAction.CIRCLE)}>
<ion-icon name="radio-button-off"></ion-icon>
<ion-icon name="create"></ion-icon>
</ion-fab-button>
);
}
Expand Down
9 changes: 1 addition & 8 deletions remote/src/app/pages/app-remote/app-remote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,9 @@ app-remote {

position: relative;

div.floating-slide-title, div.floating-slide-timer {
div.floating-slide-timer {
position: absolute;
top: 4px;
}

div.floating-slide-title {
left: 4px;
}

div.floating-slide-timer {
right: 4px;
}

Expand Down
7 changes: 1 addition & 6 deletions remote/src/app/pages/app-remote/app-remote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,9 @@ export class AppRemote {

private renderSlides() {
return (
this.slides.map((_slideDefinition: DeckdeckgoSlideDefinition, i: number) => {
this.slides.map((_slideDefinition: DeckdeckgoSlideDefinition, _i: number) => {
return <deckgo-slide-title>
<div slot="content" class="ion-padding">
<div class="floating-slide-title">
<ion-chip color="primary">
<ion-label>Slide {i + 1} of {this.slides.length}</ion-label>
</ion-chip>
</div>
<div class="floating-slide-timer">
<app-stopwatch-time></app-stopwatch-time>
</div>
Expand Down

0 comments on commit 1a36f68

Please sign in to comment.