Skip to content

Commit

Permalink
Add preview state for screenshots, and accompanying styles. Clean up …
Browse files Browse the repository at this point in the history
…screenshot sass.
  • Loading branch information
andrewtoups committed Aug 26, 2021
1 parent 9202983 commit 54b6f4d
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 37 deletions.
2 changes: 2 additions & 0 deletions scripts/components/pager/pager.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ define([
self.screenshotMode = ko.observable(false);
self.placementsMode = ko.observable(true);
self.printMode = ko.observable(false);
self.previewMode = ko.observable(false);

self.screenshot = ko.observable();
self.screenshotPlacements = ko.observable();
Expand Down Expand Up @@ -138,6 +139,7 @@ define([
if (key === "screenshot") self.screenshotMode(value === 'true');
if (key === "placements") self.placementsMode(value === 'true');
if (key === "print") self.printMode(value === 'true');
if (key === "preview") self.previewMode(value === 'true');
if (key.includes("Element")) metaKey = key.replace("Element", "");
if (key.includes("Sign")) metaKey = key.replace("Sign", "");
if (typeof birthChart[metaKey] === "undefined") birthChart[metaKey] = {sign: "", element: ""};
Expand Down
2 changes: 1 addition & 1 deletion scripts/components/poem/poem.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<article data-bind="visible: poemData(), event: {keydown: keyDown}, css: {print: vm.printMode()}" tabindex="1" id="poem" class="moon">
<article data-bind="visible: poemData(), event: {keydown: keyDown}" tabindex="1" id="poem" class="moon">
<div class="debug-bday" data-bind="visible: showDebug, if: birthData">
<div data-bind="text: birthDay"></div>
<div data-bind="text: location"></div>
Expand Down
1 change: 1 addition & 0 deletions scripts/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ define([], () => {
const printPreview = params => {
const modes = {
print: true,
preview: true
};
const paramObj = getChartParams(params, modes);
const paramStr = new URLSearchParams(paramObj).toString();
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/paypal.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ define(['api'], api => {

saveOrderData: (params) => {
const modes = {
print: true,
print: true
};
let paramObj = api.getChartParams(params.natalChart, modes);
params.chartParams = new URLSearchParams(paramObj).toString();
Expand Down
74 changes: 40 additions & 34 deletions styles/components/_viewPoem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,6 @@
opacity: .25;
}
}
&.print {
transform: scale(2.4);
.image-region { transform: scale(0.6) };
.image-region > div { transform: scale(1.6) };
&:before, &:after { content: none; }
.icon {opacity: .45; }
.watermark-container { display: none; }
form.active legend { right: 25px; bottom: 8px; }
.image-region > div { top: -13px; }
form {
padding: 1.5rem 1rem;
font-size: 114%;
color: rgb(55,55,55);
}
.signature {
position: fixed;
&.chris {
left: 20.2rem; bottom: 5.2rem;
width: 7rem;
opacity: .6;
}
&.dylan {
left: 14.7rem; bottom: 5rem;
width: 5rem;
opacity: .6;
}
&.toups {
left: 11rem; bottom: 5rem;
width: 3.4rem;
opacity: 0.4;
}
}
}
.image-region > div {
position: relative;
}
Expand All @@ -85,9 +52,48 @@
}
}
}

nav { display: none; }
}
#screenshot .print {
#poem.moon {
transform: scale(2.4);
&:before, &:after { content: none; }
}
&.preview #poem.moon {
transform: scale(1.2);
}
.image-region { transform: scale(0.6); }
.image-region > div {
transform: scale(1.6);
top: -13px;
}
.icon {opacity: .45; }
.watermark-container { display: none; }
form.active legend { right: 25px; bottom: 8px; }
form {
padding: 1.5rem 1rem;
font-size: 114%;
color: rgb(55,55,55);
}
.signature {
position: fixed;
&.chris {
left: 20.2rem; bottom: 5.2rem;
width: 7rem;
opacity: .6;
}
&.dylan {
left: 14.7rem; bottom: 5rem;
width: 5rem;
opacity: .6;
}
&.toups {
left: 11rem; bottom: 5rem;
width: 3.4rem;
opacity: 0.4;
}
}
}
#screenshot .print .image-region {
&.plant-layout {
.icon.primary {
Expand Down
2 changes: 1 addition & 1 deletion viewPoem/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<link rel="stylesheet" href="../styles/viewPoem.css" type="text/css">
</head>
<body>
<main data-bind="css: {screenshot: screenshotMode, 'icons-ready': iconsReady()}">
<main data-bind="css: {screenshot: screenshotMode, 'icons-ready': iconsReady(), print: vm.printMode(), preview: vm.previewMode()}">
<!-- ko foreach: pages -->
<section data-bind="page: $data"></section>
<!-- /ko -->
Expand Down

0 comments on commit 54b6f4d

Please sign in to comment.