diff --git a/README.md b/README.md index 842c9c1..3ea090b 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,4 @@ It is supposed to aid storytellers and allow them to quickly set up and capture [You can try it online!](https://bra1n.github.io/townsquare) -**Todo:** -- add night sheet data to roles.json -- add night sheet view to Grimoire -- add global reminder space -- add LICENSE and finish README (shortcuts) -- (maybe) switch to vectorized SVG token icons -- allow using custom scripts - WORK IN PROGRESS diff --git a/src/App.vue b/src/App.vue index d802c5a..b56231c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,6 +6,7 @@ :players="players" :roles="roles" :zoom="zoom" + @screenshot="takeScreenshot" > + +
+
  • Toggle Grimoire
  • @@ -74,9 +85,11 @@ import Modal from "./components/Modal"; import RoleSelectionModal from "./components/RoleSelectionModal"; import rolesJSON from "./roles"; import editionJSON from "./editions"; +import Screenshot from "./components/Screenshot"; export default { components: { + Screenshot, TownSquare, TownInfo, Modal, @@ -89,6 +102,7 @@ export default { isControlOpen: false, isEditionModalOpen: false, isRoleModalOpen: false, + isScreenshotSuccess: false, players: [], roles: this.getRolesByEdition(), edition: "tb", @@ -96,6 +110,11 @@ export default { }; }, methods: { + takeScreenshot(dimensions = {}) { + this.isControlOpen = false; + this.isScreenshotSuccess = false; + this.$refs.screenshot.capture(dimensions); + }, togglePublic() { this.isPublic = !this.isPublic; this.isControlOpen = false; @@ -266,6 +285,16 @@ ul { height: 100%; } +// success animation +@keyframes greenToWhite { + from { + color: green; + } + to { + color: white; + } +} + // Controls .controls { position: absolute; @@ -275,6 +304,11 @@ ul { padding: 10px; svg { cursor: pointer; + margin-left: 10px; + &.success { + animation: greenToWhite 1s normal forwards; + animation-iteration-count: 1; + } } ul { display: flex; diff --git a/src/components/Player.vue b/src/components/Player.vue index c7c57d3..8124deb 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -1,6 +1,7 @@