Skip to content

Commit

Permalink
Moved temp styles into the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
bryancasler committed Aug 23, 2024
1 parent 3344c01 commit 0f29cf5
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 10 deletions.
20 changes: 18 additions & 2 deletions dist/engrid.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* ENGRID PAGE TEMPLATE ASSETS
*
* Date: Thursday, August 22, 2024 @ 20:10:48 ET
* Date: Thursday, August 22, 2024 @ 20:40:05 ET
* By: bryancasler
* ENGrid styles: v0.19.1
* ENGrid scripts: v0.19.1
Expand Down Expand Up @@ -8842,13 +8842,29 @@ body[data-engrid-debug]:before{
[data-engrid-theme=engrid-ran3] .engrid-welcome-back-clear{
color:#000;
}
[data-engrid-theme=engrid-ran3] iframe.thank-you-embedded-donate{
[data-engrid-theme=engrid-ran3] iframe.thank-you-page-donation{
left:calc(-1rem + -5px);
margin:calc(1rem + 5px);
outline:5px dashed #395a4c;
outline-offset:1rem;
position:relative;
}
[data-engrid-theme=engrid-ran3] .highlight-style2{
background-color:#eff520;
box-decoration-break:clone;
-webkit-box-decoration-break:clone;
color:#000;
display:inline;
padding:.45rem .45rem .2rem;
}
[data-engrid-theme=engrid-ran3] [data-engrid-theme=engrid-ran3][data-engrid-embedded] .cky-consent-container,[data-engrid-theme=engrid-ran3] [data-engrid-theme=engrid-ran3][data-engrid-embedded] .cky-overlay{
display:none !important;
}
@media screen and (max-width:600px){
[data-engrid-theme=engrid-ran3][data-engrid-embedded=thank-you-page-donation]{
--engrid__body_padding:0 --engrid__body-top_padding: 30px 0 0 --engrid__body-main_padding: 0 0 85px .body-title, .body-top{ > * > *:first-child{ margin-top: 0; } } .body-top{ padding-top: 0; } .body-main{ padding-bottom: 0; } .en__submit button{ margin-bottom: 0; } .en__digitalWallet__container{ display: block !important; } .giveBySelect-Card{ margin-top: 1rem !important; } &[data-conditonally-hide-show-digital-wallet-elements]{ #en__digitalWallet .en__digitalWallet__container{ margin-bottom: 0 !important; } };
}
}

body[data-engrid-page-type=donation][data-engrid-payment-type=paypal]:not([data-engrid-currency-code=USD]) .en__submit,body[data-engrid-page-type=donation][data-engrid-payment-type=paypaltouch]:not([data-engrid-currency-code=USD]) .en__submit,body[data-engrid-page-type=premiumgift][data-engrid-payment-type=paypal]:not([data-engrid-currency-code=USD]) .en__submit,body[data-engrid-page-type=premiumgift][data-engrid-payment-type=paypaltouch]:not([data-engrid-currency-code=USD]) .en__submit,iframe[src*=fluidads]{
display:none;
Expand Down
28 changes: 26 additions & 2 deletions dist/engrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* ENGRID PAGE TEMPLATE ASSETS
*
* Date: Thursday, August 22, 2024 @ 20:10:48 ET
* Date: Thursday, August 22, 2024 @ 20:40:05 ET
* By: bryancasler
* ENGrid styles: v0.19.1
* ENGrid scripts: v0.19.1
Expand Down Expand Up @@ -10760,12 +10760,36 @@ class DataAttributes {

class iFrame {
constructor() {
var _a;

this._form = EnForm.getInstance();
this.logger = new EngridLogger("iFrame", "brown", "gray", "📡");

if (this.inIframe()) {
// Add the data-engrid-embedded attribute when inside an iFrame if it wasn't already added by a script in the Page Template
engrid_ENGrid.setBodyData("embedded", ""); // Fire the resize event
engrid_ENGrid.setBodyData("embedded", ""); // Check if the parent page URL matches the criteria for a thank you page donation

const getParentUrl = () => {
try {
return window.parent.location.href;
} catch (e) {
// If we can't access parent location due to same-origin policy, fall back to referrer
return document.referrer;
}
};

const parentUrl = getParentUrl();
const thankYouPageRegex = /\/page\/\d{2,}($|\?)/;

if (thankYouPageRegex.test(parentUrl)) {
const pageNumber = parseInt(((_a = parentUrl.split('/').pop()) === null || _a === void 0 ? void 0 : _a.split('?')[0]) || '0', 10);

if (pageNumber > 1) {
engrid_ENGrid.setBodyData("embedded", "thank-you-page-donation");
this.logger.log("iFrame Event - Set embedded attribute to thank-you-page-donation");
}
} // Fire the resize event


this.logger.log("iFrame Event - Begin Resizing");
window.addEventListener("load", event => {
Expand Down
4 changes: 2 additions & 2 deletions dist/engrid.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/engrid.min.js

Large diffs are not rendered by default.

61 changes: 59 additions & 2 deletions src/sass/themes/ran3.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1514,11 +1514,68 @@
}

/* Styles the iFrame of the embedded donation page that is displayed on the thank you page */
iframe.thank-you-embedded-donate{
iframe.thank-you-page-donation{
outline: 5px dashed #395a4c;
margin: calc(1rem + 5px);
outline-offset: 1rem;
position: relative;
left: calc(((1rem + 5px)* -1));
}
}

.highlight-style2{
color: #000;
display: inline;
padding: 0.45rem 0.45rem 0.20rem 0.45rem;
box-decoration-break: clone;
-webkit-box-decoration-break: clone;
background-color: #eff520;
}

/* Hide the cookie banned when embedded */
[data-engrid-theme="engrid-ran3"][data-engrid-embedded] .cky-overlay,
[data-engrid-theme="engrid-ran3"][data-engrid-embedded] .cky-consent-container{
display: none !important;
}

/* This are temporary stylings that will be moved into the theme once complete */
&[data-engrid-embedded="thank-you-page-donation"]{
@media screen and (max-width: 600px){

--engrid__body_padding: 0
--engrid__body-top_padding: 30px 0 0
--engrid__body-main_padding: 0 0 85px

.body-title, .body-top{
> * > *:first-child{
margin-top: 0;
}
}

.body-top{
padding-top: 0;
}

.body-main{
padding-bottom: 0;
}

.en__submit button{
margin-bottom: 0;
}

.en__digitalWallet__container{
display: block !important;
}

.giveBySelect-Card{
margin-top: 1rem !important;
}

&[data-conditonally-hide-show-digital-wallet-elements]{
#en__digitalWallet .en__digitalWallet__container{
margin-bottom: 0 !important;
}
}
}
}
}

0 comments on commit 0f29cf5

Please sign in to comment.