Skip to content

Commit

Permalink
Finish the load-hide functions for the second tab
Browse files Browse the repository at this point in the history
Add 'customer support' infodisplay on the second tab
  • Loading branch information
amalyakubov committed Jul 18, 2023
1 parent 73e3b3b commit a1f2bec
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 11 deletions.
Binary file added dist/e462cf9c169c920f5351.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 52 additions & 7 deletions dist/main.js

Large diffs are not rendered by default.

42 changes: 40 additions & 2 deletions src/delivery.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { content } from "./append";

export function loadDelivery() {
const FOOTER = document.getElementById('footer');
if (document.getElementById('delivery-text') === null) {
Expand Down Expand Up @@ -30,12 +32,48 @@ export function loadDelivery() {
let label = document.createElement('label');
label.htmlFor = 'adress';
label.innerHTML = 'Delivery adress:';
label.style.fontSize = '35px';
label.style.fontSize = '60px';
label.style.fontWeight = '600';
label.style.color = 'black';
label.style.color = 'white';

let infoContainer = document.createElement('div');
infoContainer.id = 'info-container';
let info = document.createElement('p');
info.style.color = 'white';
infoContainer.appendChild(info);
info.innerHTML = 'If you get the message \'unavailable adress, please contact our customer support team\', please choose one of the following methods of contacting our custom suppoprt.';

let contactContainer = document.createElement('div');
contactContainer.style.display = 'flex';

let email = document.createElement('p');
let phone = document.createElement('p');

email.innerHTML = 'lospollos@customer.com'
phone.innerHTML = '+ 1 505 999 999';

contactContainer.appendChild(email);
contactContainer.appendChild(phone);

contactContainer.style.color = 'white';
contactContainer.style.fontSize = '20px';
contactContainer.style.justifyContent = 'center';
contactContainer.style.gap = '80px';

infoContainer.style.paddingBottom = '100px';
infoContainer.style.margin = '20px';
infoContainer.style.backgroundColor = '#548042';
infoContainer.style.borderRadius = '10px';
infoContainer.style.paddingTop = '20px';

info.style.margin = '20px'
info.style.fontSize = '25px';

inputContainer.appendChild(label);
inputContainer.appendChild(input);
infoContainer.appendChild(contactContainer);
content.appendChild(infoContainer);
div.classList.add('hidden');
}
FOOTER.classList.remove('hidden');
}
Binary file modified src/img/hero-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ const NAVIGATION = function() {
const MENUCONTAINER = document.getElementById('menu-container');
const FOOTER = document.getElementById('footer');
const DELIVERYDIV = document.getElementById('delivery-div');
const INFOCONTAINER = document.getElementById('info-container');

function hideContent() {
WELCOMECONTAINER.classList.add('hidden');
PRODUCTSCONTAINER.classList.add('hidden');
MENUCONTAINER.classList.add('hidden');
FOOTER.classList.add('hidden');
DELIVERYDIV.classList.remove('hidden');
INFOCONTAINER.classList.remove('hidden');
}

function showContent() {
Expand All @@ -24,6 +27,7 @@ const NAVIGATION = function() {
MENUCONTAINER.classList.remove('hidden');
FOOTER.classList.remove('hidden');
DELIVERYDIV.classList.add('hidden');
INFOCONTAINER.classList.add('hidden');
}

function addEventListeners() {
Expand All @@ -37,7 +41,6 @@ const NAVIGATION = function() {

delivery.addEventListener('click', () => {
hideContent();
loadDelivery();
})

about.addEventListener('click', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/pageload.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {content} from "./append";
import { logoAppend } from "./append";
import photo1 from './img/photo-1.jpg'
import { loadDelivery } from "./delivery";

export function pageLoad() {
createNavigationMenu();
Expand All @@ -12,6 +13,7 @@
createMenu();
createAppendFooter();
createDeliveryDiv();
loadDelivery();
}

function displayWelcome() {
Expand Down
2 changes: 1 addition & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ ol {
justify-content: center;
}

#welcome-container.hidden, #products-display.hidden, #menu-container.hidden, #footer.hidden {
#welcome-container.hidden, #products-display.hidden, #menu-container.hidden, #footer.hidden, #delivery-div.hidden, #info-container.hidden {
display: none;
}

Expand Down

0 comments on commit a1f2bec

Please sign in to comment.