-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(svg): add new seat SVG asset and custom seat item classes
Add seat-1.svg to provide a visual representation of a seat. Introduce SeatItemCheck and SeatItemCircle classes to enhance customization and interaction with seat elements in the SVG stage.
- Loading branch information
1 parent
4b86282
commit a446e5d
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
45 changes: 45 additions & 0 deletions
45
src/lib/svg/stage/blocks/block-item/seat/seat-item.custom-check.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,45 @@ | ||
/* | ||
* $project.fileName | ||
* https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE | ||
*/ | ||
|
||
import SvgBase from "@svg/svg.base"; | ||
import {dom} from "@decorator/dom"; | ||
import {SeatItem} from "@svg/stage/blocks/block-item/seat/seat-item.index"; | ||
|
||
@dom({ | ||
tag: "path", | ||
class: "seat-check", | ||
autoGenerate: false | ||
}) | ||
export class SeatItemCheck extends SvgBase { | ||
|
||
constructor(public parent: SeatItem) { | ||
super(parent); | ||
this.attr("d", "M12.9,953.7l-6.3,6.5l-2.9-2.5l-2.1,2.4l4.1,3.5l1.1,1l1.1-1.1l7.3-7.6L12.9,953.7L12.9,953.7z"); | ||
this.attr("fill", this.global.config.style.seat.check_color); | ||
this.attr("transform", "translate(-8,-959.36218)"); | ||
this.attr("pointer-events", "none"); | ||
this.attr("display", "none"); | ||
|
||
return this; | ||
} | ||
|
||
update(): this { | ||
return this; | ||
} | ||
|
||
afterGenerate() { | ||
this.node.style("pointer-events", "none"); | ||
} | ||
|
||
show():this { | ||
this.node.attr("display", "block"); | ||
return this; | ||
} | ||
|
||
hide():this { | ||
this.node.attr("display", "none"); | ||
return this; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/lib/svg/stage/blocks/block-item/seat/seat-item.custom.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,31 @@ | ||
/* | ||
* $project.fileName | ||
* https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE | ||
*/ | ||
|
||
import SvgBase from "@svg/svg.base"; | ||
|
||
import {dom} from "@decorator/dom"; | ||
import {SeatItem} from "./seat-item.index"; | ||
|
||
@dom({ | ||
tag: "circle", | ||
class: "seat-circle", | ||
autoGenerate: false | ||
}) | ||
export class SeatItemCircle extends SvgBase { | ||
|
||
constructor(public parent: SeatItem) { | ||
super(parent); | ||
this.attr("block-id", parent.item.block.id); | ||
this.attr("r", this.global.config.style.seat.radius); | ||
this.attr("fill", this.global.config.style.seat.color); | ||
this.attr("stroke", "rgba(0,0,0,0.3)"); | ||
this.attr("stroke-width", 1); | ||
return this; | ||
} | ||
|
||
update(): this { | ||
return this; | ||
} | ||
} |