diff --git a/src/app.js b/src/app.js index 2aea56c..e69de29 100644 --- a/src/app.js +++ b/src/app.js @@ -1,36 +0,0 @@ - - -const cookieStorage = { - getItem: (item) => { - const cookies = document.cookie - .split(';') - .map(cookie => cookie.split('=')) - .reduce((acc, [key, value]) => ({ ...acc, [key.trim()]: value }), {}); - return cookies[item]; - }, - setItem: (item, value) => { - document.cookie = `${item}=${value};` - } -} - - -window.onload = () => { - const storageType = cookieStorage; - const consentPropertyName = 'jdc_consent'; - const shouldShowPopup = storageType => !storageType.getItem(consentPropertyName); - const saveToStorage = storageType => storageType.setItem(consentPropertyName, true); - const acceptFn = event => { - saveToStorage(storageType); - consentPopup.classList.add('hidden'); - } - const consentPopup = document.getElementById('consent-popup'); - const acceptBtn = document.getElementById('accept'); - acceptBtn.addEventListener('click', acceptFn); - - if (shouldShowPopup(storageType)) { - setTimeout(() => { - consentPopup.classList.remove('hidden'); - }, 2000); - } - -}; \ No newline at end of file diff --git a/src/img/hero.jpg b/src/img/hero.jpg deleted file mode 100644 index 5f343c2..0000000 Binary files a/src/img/hero.jpg and /dev/null differ diff --git a/src/index.html b/src/index.html index a4c059b..de09f77 100644 --- a/src/index.html +++ b/src/index.html @@ -4,41 +4,8 @@ Consent Popup Test - - - -
-

Some Web Company

- -
-
-
-

We are Some Web Company

-

Lorem ipsum, dolor sit amet consectetur adipisicing elit. Vel, impedit! Ea incidunt amet quam nostrum numquam cum magnam! Dolore quis laborum cum neque rerum vero eveniet laudantium excepturi nemo alias?

-
-
-

Find out more about what we do...

- -
-
- + \ No newline at end of file diff --git a/src/style.scss b/src/style.scss deleted file mode 100644 index 4be760c..0000000 --- a/src/style.scss +++ /dev/null @@ -1,89 +0,0 @@ -@import '../node_modules/normalize.css/normalize.css'; -@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto&display=swap'); - -body { - font-family: 'Roboto', sans-serif;} - -section { - &.hero { - background-image: linear-gradient(270deg, rgba(0,0,0,0.38559173669467783) 0%, rgba(0,0,0,0) 78%), url('img/hero.jpg'); - background-size: cover; - background-position: 0 -200px ; - height: 600px; - display: flex; - padding: 2rem 6rem; - } -} - -header { - display: flex; - align-items: center; - justify-content: space-between; - padding: 1rem 8rem; - - h1 { - font-family: 'Bebas Neue', cursive; - margin: 0; - text-transform: uppercase; - } - - nav { - ul { - list-style-type: none; - display: flex; - li { - margin: 0 1rem; - a { - color: #000; - text-transform: uppercase; - text-decoration: none; - padding: .5rem 1rem; - border-radius: 1rem; - transition: all .8s ease; - - &:hover { - background-color: #000; - color: #fff; - } - } - } - } - - - } -} - -.info { - flex: 2; - padding: 2rem; -} -.cta { - flex: 1; - margin-top: 2rem; - padding: 2rem; - height: 100px; - background-color: rgba(255, 255, 255, 0.8); - text-align: center; - - button { - color: #fff; - padding: .5rem 1rem; - background-color: #000; - border: 0; - outline: 0; - } -} - -#consent-popup { - position: fixed; - bottom: 0; - left: 0; - right: 0; - padding: 2rem 8rem; - background-color: #fff; - transition: opacity 1s ease; - - &.hidden { - opacity: 0; - } -} \ No newline at end of file