diff --git a/public/assets/js/main.js b/public/assets/js/main.js new file mode 100644 index 0000000..8bf4245 --- /dev/null +++ b/public/assets/js/main.js @@ -0,0 +1,11 @@ +document.addEventListener('DOMContentLoaded', function() { + const isIframe = window.self !== window.top; + + if (isIframe) { + const mainHeader = document.querySelector('.main-header'); + const mainFooter = document.querySelector('.main-footer'); + + mainHeader?.remove(); + mainFooter?.remove(); + } +}); \ No newline at end of file diff --git a/public/assets/styles/style.css b/public/assets/styles/style.css index 8f51a5a..dde04ad 100644 --- a/public/assets/styles/style.css +++ b/public/assets/styles/style.css @@ -626,10 +626,6 @@ video { margin-bottom: 0.5rem; } -.mb-3 { - margin-bottom: 0.75rem; -} - .mb-4 { margin-bottom: 1rem; } @@ -726,10 +722,6 @@ video { max-width: 32rem; } -.max-w-md { - max-width: 28rem; -} - .appearance-none { -webkit-appearance: none; -moz-appearance: none; @@ -887,6 +879,14 @@ video { padding-bottom: 2rem; } +.pb-20 { + padding-bottom: 5rem; +} + +.pt-8 { + padding-top: 2rem; +} + .text-left { text-align: left; } diff --git a/src/common/footer.ejs b/src/common/footer.ejs index a1d2604..aa61755 100644 --- a/src/common/footer.ejs +++ b/src/common/footer.ejs @@ -4,13 +4,5 @@ Download the PSAT extension About Privacy Sandbox - diff --git a/src/common/header.ejs b/src/common/header.ejs index bd8454b..4c8c30f 100644 --- a/src/common/header.ejs +++ b/src/common/header.ejs @@ -9,16 +9,7 @@ - +
diff --git a/src/common/internal-page/footer.ejs b/src/common/internal-page/footer.ejs new file mode 100644 index 0000000..86995c4 --- /dev/null +++ b/src/common/internal-page/footer.ejs @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/common/internal-page/header.ejs b/src/common/internal-page/header.ejs new file mode 100644 index 0000000..d6110dc --- /dev/null +++ b/src/common/internal-page/header.ejs @@ -0,0 +1,7 @@ +
+ <% if (title) { %> +
+

<%= title %>

+
+ <% } %> +
\ No newline at end of file diff --git a/src/demos/chips/analytics-first-party.ejs b/src/demos/chips/analytics-first-party.ejs index b666fed..1951ec2 100644 --- a/src/demos/chips/analytics-first-party.ejs +++ b/src/demos/chips/analytics-first-party.ejs @@ -1,8 +1,6 @@ <%- include(commonPath + '/header.ejs') %> -
-

<%= title %>

-
+ <%- include(commonPath + '/internal-page/header.ejs') %>

Track user interactions using the analytics code provided below:

-
-
+ <%- include(commonPath + '/internal-page/footer.ejs') %> diff --git a/src/demos/chips/analytics-third-party.ejs b/src/demos/chips/analytics-third-party.ejs index eca191a..39b9151 100644 --- a/src/demos/chips/analytics-third-party.ejs +++ b/src/demos/chips/analytics-third-party.ejs @@ -1,8 +1,6 @@ <%- include(commonPath + '/header.ejs') %> -
-

<%= title %>

-
+ <%- include(commonPath + '/internal-page/header.ejs') %>

Track user interactions using the analytics code provided below:

@@ -14,8 +12,7 @@
-
-
+ <%- include(commonPath + '/internal-page/footer.ejs') %> diff --git a/src/demos/chips/index.ejs b/src/demos/chips/index.ejs index fe48fcd..3bc0c14 100644 --- a/src/demos/chips/index.ejs +++ b/src/demos/chips/index.ejs @@ -1,8 +1,6 @@ <%- include(commonPath + '/header.ejs') %> -
-

CHIPS

-
+ <%- include(commonPath + '/internal-page/header.ejs') %>

Cookies Having Independent Partitioned State

-
-
+ <%- include(commonPath + '/internal-page/footer.ejs') %> <%- include(commonPath + '/footer.ejs') %> diff --git a/src/scenarios/analytics/index.ejs b/src/scenarios/analytics/index.ejs index 7fa3320..77b23e1 100644 --- a/src/scenarios/analytics/index.ejs +++ b/src/scenarios/analytics/index.ejs @@ -1,18 +1,15 @@ <%- include(commonPath + '/header.ejs') %> -
-

Analytics

-
-

Here is a button that tracks clicks using a third-party analytics service; check if it works.

+ <%- include(commonPath + '/internal-page/header.ejs') %> +

Here is a button that tracks clicks using a third-party analytics service; check if it works.

-
- -
-
+
+
-
+
+ <%- include(commonPath + '/internal-page/footer.ejs') %> diff --git a/src/scenarios/ecommerce/index.ejs b/src/scenarios/ecommerce/index.ejs index 03cfe3e..a88fb61 100644 --- a/src/scenarios/ecommerce/index.ejs +++ b/src/scenarios/ecommerce/index.ejs @@ -1,13 +1,10 @@ <%- include(commonPath + '/header.ejs') %> -
-

E-Commerce

-
+ <%- include(commonPath + '/internal-page/header.ejs') %>

Here is an embedded Third-Party e-commerce site, check if you can add products to cart.

-
-
+ <%- include(commonPath + '/internal-page/footer.ejs') %> <%- include(commonPath + '/footer.ejs') %> diff --git a/src/scenarios/ecommerce/routes.js b/src/scenarios/ecommerce/routes.js index c7c68c5..4eb9524 100644 --- a/src/scenarios/ecommerce/routes.js +++ b/src/scenarios/ecommerce/routes.js @@ -13,7 +13,9 @@ router.use((req, res, next) => { // Route to serve the home page router.get('/', (req, res) => { // Render the index view (homepage) - res.render(path.join(__dirname,'index')); + res.render(path.join(__dirname,'index'), { + title: 'E-commerce' + }); }); // Route to serve the products page diff --git a/src/scenarios/embedded-video/index.ejs b/src/scenarios/embedded-video/index.ejs index bf4cb88..2b6deb1 100644 --- a/src/scenarios/embedded-video/index.ejs +++ b/src/scenarios/embedded-video/index.ejs @@ -1,8 +1,6 @@ <%- include(commonPath + '/header.ejs') %> -
-

Embedded Video

-
+ <%- include(commonPath + '/internal-page/footer.ejs') %> <%- include(commonPath + '/footer.ejs') %> \ No newline at end of file diff --git a/src/scenarios/payment-gateway/checkout.ejs b/src/scenarios/payment-gateway/checkout.ejs index 67beeec..33efff4 100644 --- a/src/scenarios/payment-gateway/checkout.ejs +++ b/src/scenarios/payment-gateway/checkout.ejs @@ -1,13 +1,10 @@ <%- include(commonPath + '/header.ejs') %> -
-

Checkout

-
+ <%- include(commonPath + '/internal-page/header.ejs') %>

Item: <%= item %> - $<%= price %>

-
-
+ <%- include(commonPath + '/internal-page/footer.ejs') %> <%- include(commonPath + '/footer.ejs') %> diff --git a/src/scenarios/payment-gateway/routes.js b/src/scenarios/payment-gateway/routes.js index 4cbd73e..ceed45b 100644 --- a/src/scenarios/payment-gateway/routes.js +++ b/src/scenarios/payment-gateway/routes.js @@ -5,7 +5,7 @@ const router = express.Router(); router.get( '/', ( req, res ) => { res.render( path.join( __dirname, 'checkout' ), { - title: 'Payment Gateway', + title: 'Checkout', item: "Virtual Badge for testing the site", price: 10, } ); diff --git a/src/scenarios/single-sign-on/login.ejs b/src/scenarios/single-sign-on/login.ejs index e1dc943..6c0423a 100644 --- a/src/scenarios/single-sign-on/login.ejs +++ b/src/scenarios/single-sign-on/login.ejs @@ -1,8 +1,6 @@ <%- include(commonPath + '/header.ejs') %> -
-

Login

-
+ <%- include(commonPath + '/internal-page/header.ejs') %>
@@ -14,7 +12,6 @@
-
-
+ <%- include(commonPath + '/internal-page/footer.ejs') %> <%- include(commonPath + '/footer.ejs') %> diff --git a/src/scenarios/single-sign-on/profile.ejs b/src/scenarios/single-sign-on/profile.ejs index c101154..4921c9f 100644 --- a/src/scenarios/single-sign-on/profile.ejs +++ b/src/scenarios/single-sign-on/profile.ejs @@ -1,13 +1,10 @@ <%- include(commonPath + '/header.ejs') %> -
-
-

Welcome

+ <%- include(commonPath + '/internal-page/header.ejs') %>

You are logged in as <%= email %>

-
-
+ <%- include(commonPath + '/internal-page/footer.ejs') %> <%- include(commonPath + '/footer.ejs') %> diff --git a/src/scenarios/single-sign-on/routes.js b/src/scenarios/single-sign-on/routes.js index 2ef986c..77ac535 100644 --- a/src/scenarios/single-sign-on/routes.js +++ b/src/scenarios/single-sign-on/routes.js @@ -4,14 +4,9 @@ const router = express.Router(); router.get('/', (req, res) => { const email = req.cookies.localemail; - - if (email) { - // User is 'logged in', redirect to profile page - res.redirect('/single-sign-on/profile'); - } else { - // User is not logged in, redirect to sign-in page - res.redirect('/single-sign-on/sign-in'); - } + // User is 'logged in', redirect to profile page or sign-in page + const redirectURL = (email) ? '/single-sign-on/profile' : '/single-sign-on/sign-in'; + res.redirect(redirectURL); }); router.get('/profile', (req, res) => { @@ -20,7 +15,7 @@ router.get('/profile', (req, res) => { const domain = req.get('host'); if (email) { - res.render(path.join(__dirname, 'profile'), { title: 'Single Sign-On for ' + domain, email: email }); + res.render(path.join(__dirname, 'profile'), { title: 'Welcome ' + email, email: email }); } else { res.redirect('/single-sign-on/sign-in'); } diff --git a/src/scenarios/single-sign-on/signin.ejs b/src/scenarios/single-sign-on/signin.ejs index 03ef411..7fb40de 100644 --- a/src/scenarios/single-sign-on/signin.ejs +++ b/src/scenarios/single-sign-on/signin.ejs @@ -1,10 +1,9 @@ <%- include(commonPath + '/header.ejs') %>
-

Single Sign-On

-
+ <%- include(commonPath + '/internal-page/header.ejs') %> -
+ <%- include(commonPath + '/internal-page/footer.ejs') %>