forked from ampproject/ampstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added <amp-consent> stuff for GDPR (ampproject#824)
* Added <amp-consent> stuff for GDPR * Removed no-longer-relevant comment * Refactored CSS and HTML to use basscss and to better match the rest of the site. * Added ampstart-consent-content class Used CSS variables where it seemed consistent to do so * Even more things replaced with rem's and CSS vars * Use .ampstart-card class for the box shadow instead of custom CSS * Use default spacing and font variables instead of custom, even when it tweaks the design a little. Also, we won't need the super-small device size rule.
- Loading branch information
1 parent
785a3b0
commit 845b596
Showing
14 changed files
with
116 additions
and
4 deletions.
There are no files selected for viewing
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,63 @@ | ||
@keyframes slideUp { | ||
0% { | ||
transform: translateY(100%); | ||
opacity: 0.5; | ||
} | ||
100% { | ||
transform: translateY(0); | ||
opacity: 1; | ||
} | ||
} | ||
|
||
amp-consent { | ||
background: var(--color-white); | ||
animation: .5s ease-out 0s 1 slideUp; | ||
} | ||
|
||
amp-consent .ampstart-btn { | ||
width: 9.5rem; | ||
} | ||
|
||
.ampstart-consent-popup p a { | ||
color: #b60845; | ||
} | ||
|
||
/* phones */ | ||
@media (--breakpoint-xs) { | ||
amp-consent a.ampstart-consent-close-btn { | ||
font-size: var(--h3); | ||
top: 15px; | ||
right: 13px; | ||
} | ||
|
||
.ampstart-consent-content { | ||
flex-flow: column wrap; | ||
align-items: center; | ||
margin: var(--space-1) var(--space-2) var(--space-1) var(--space-1); | ||
} | ||
|
||
.ampstart-consent-popup p { | ||
padding: 0 var(--space-1); | ||
margin: 0 0 var(--space-1); | ||
} | ||
} | ||
|
||
/* tablets and desktop */ | ||
@media (--breakpoint-sm) { | ||
.ampstart-consent-popup a.ampstart-consent-close-btn { | ||
font-size: var(--h3); | ||
left: 2.5rem; | ||
} | ||
|
||
.ampstart-consent-content { | ||
flex-flow: row; | ||
height: 6.25rem; | ||
margin: 0 var(--space-4); | ||
} | ||
|
||
.ampstart-consent-popup p { | ||
max-width: 41.25rem; | ||
padding: 0 var(--space-2) 0 var(--space-4); | ||
margin: 0; | ||
} | ||
} |
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,32 @@ | ||
<amp-geo layout="nodisplay"> | ||
<script type="application/json"> | ||
{ | ||
"ISOCountryGroups": { | ||
"eu": ["at", "be", "bg", "ch", "cy", "cz", "dk", "de", "ee", "el", "es", "fi", "fr", "hr", "ie", "is", "it", "li", "lv", "lt", "lu", "hu", "mt", "nl", "no", "pl", "pt", "ro", "si", "sk", "se", "uk"] | ||
} | ||
} | ||
</script> | ||
</amp-geo> | ||
|
||
<amp-consent id="consent" class="ampstart-card" layout="nodisplay"> | ||
<script type="application/json"> | ||
{ | ||
"consents": { | ||
"eu": { | ||
"promptIfUnknownForGeoGroup": "eu", | ||
"promptUI": "consent-popup" | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<div id="consent-popup" class="ampstart-consent-popup"> | ||
<div class="ampstart-consent-content flex items-center justify-center"> | ||
<a href="#" on="tap:consent.dismiss" class="ampstart-consent-close-btn absolute text-decoration-none" role="button" tabindex="0">✕</a> | ||
<p class="h5 line-height-2"> | ||
We use cookies to understand how you use our site and to improve your experience. By continuing to use our site, you accept our <a href="https://policies.google.com/technologies/cookies" class="text-decoration-none">use of cookies</a> and <a href="https://policies.google.com/privacy" class="text-decoration-none">privacy policy</a>. | ||
</p> | ||
<a class="ampstart-btn ampstart-btn-secondary caps text-decoration-none inline-block center" on="tap:consent.accept" class="button text-label" role="button" tabindex="1">OK</a> | ||
</div> | ||
</div> | ||
</amp-consent> |
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
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
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
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
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
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
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
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
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
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
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
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