|
@@ -134,115 +134,118 @@ function closeNav() {
|
|
|
document.getElementById("myNav").style.height = "0%";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//profile
|
|
|
+const facultyProfile = document.querySelector("body.single-faculty");
|
|
|
|
|
|
-window.addEventListener("resize", showSidebarOptions)
|
|
|
-
|
|
|
-const biosTitle = document.querySelectorAll('h2.m-text')
|
|
|
-const list = document.querySelector('ul.profile-choices')
|
|
|
-const bios = document.querySelectorAll('.desc-block')
|
|
|
-
|
|
|
-
|
|
|
-if(window.innerWidth < 600) {
|
|
|
- bios.forEach( el => el.classList.remove('.desc-block-hidden'))
|
|
|
-}
|
|
|
-else {
|
|
|
- biosTitle.forEach((el, index) => {
|
|
|
- console.log(el.textContent)
|
|
|
- let text = '<li onclick="displaydetails('+ index +')"><a >' + el.textContent + '</a></li>'
|
|
|
- list.insertAdjacentHTML("beforeend", text )
|
|
|
- })
|
|
|
-
|
|
|
- bios.forEach(el => el.classList.add('desc-block-hidden'))
|
|
|
- bios[0].classList.remove('desc-block-hidden')
|
|
|
+if (facultyProfile) {
|
|
|
+ window.addEventListener("resize", showSidebarOptions);
|
|
|
|
|
|
- let listItem = document.querySelectorAll('ul.profile-choices>li')
|
|
|
- listItem[0].classList.add('desc-active')
|
|
|
+ const biosTitle = document.querySelectorAll("h2.m-text");
|
|
|
+ const list = document.querySelector("ul.profile-choices");
|
|
|
+ const bios = document.querySelectorAll(".desc-block");
|
|
|
|
|
|
-}
|
|
|
+ if (window.innerWidth < 600) {
|
|
|
+ bios.forEach((el) => el.classList.remove(".desc-block-hidden"));
|
|
|
+ } else {
|
|
|
+ biosTitle.forEach((el, index) => {
|
|
|
+ console.log(el.textContent);
|
|
|
+ let text =
|
|
|
+ '<li onclick="displaydetails(' +
|
|
|
+ index +
|
|
|
+ ')"><a >' +
|
|
|
+ el.textContent +
|
|
|
+ "</a></li>";
|
|
|
+ list.insertAdjacentHTML("beforeend", text);
|
|
|
+ });
|
|
|
|
|
|
+ bios.forEach((el) => el.classList.add("desc-block-hidden"));
|
|
|
+ bios[0].classList.remove("desc-block-hidden");
|
|
|
|
|
|
-function displaydetails (i) {
|
|
|
- bios.forEach( el => el.classList.add('desc-block-hidden'))
|
|
|
- bios[i].classList.remove('desc-block-hidden')
|
|
|
+ let listItem = document.querySelectorAll("ul.profile-choices>li");
|
|
|
+ listItem[0].classList.add("desc-active");
|
|
|
+ }
|
|
|
|
|
|
- let listItem = document.querySelectorAll('ul.profile-choices>li')
|
|
|
- listItem.forEach( el => el.classList.remove('desc-active'))
|
|
|
- listItem[i].classList.add('desc-active')
|
|
|
-}
|
|
|
+ function displaydetails(i) {
|
|
|
+ bios.forEach((el) => el.classList.add("desc-block-hidden"));
|
|
|
+ bios[i].classList.remove("desc-block-hidden");
|
|
|
|
|
|
-function showSidebarOptions(){
|
|
|
- console.log(window.innerWidth)
|
|
|
- let windowX = window.matchMedia("(max-width: 600px)")
|
|
|
- if(windowX.matches) {
|
|
|
- bios.forEach( el => el.classList.remove('.desc-block-hidden'))
|
|
|
+ let listItem = document.querySelectorAll("ul.profile-choices>li");
|
|
|
+ listItem.forEach((el) => el.classList.remove("desc-active"));
|
|
|
+ listItem[i].classList.add("desc-active");
|
|
|
}
|
|
|
- else {
|
|
|
- bios.forEach(el => el.classList.add('desc-block-hidden'))
|
|
|
- bios[0].classList.remove('desc-block-hidden')
|
|
|
-
|
|
|
|
|
|
+ function showSidebarOptions() {
|
|
|
+ console.log(window.innerWidth);
|
|
|
+ let windowX = window.matchMedia("(max-width: 600px)");
|
|
|
+ if (windowX.matches) {
|
|
|
+ bios.forEach((el) => el.classList.remove(".desc-block-hidden"));
|
|
|
+ } else {
|
|
|
+ bios.forEach((el) => el.classList.add("desc-block-hidden"));
|
|
|
+ bios[0].classList.remove("desc-block-hidden");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// Simple example, see optional options for more configuration.
|
|
|
-const pickr = Pickr.create({
|
|
|
- el: ".color-picker",
|
|
|
- theme: "nano",
|
|
|
-
|
|
|
- swatches: [
|
|
|
- "rgba(244, 67, 54, 1)",
|
|
|
- "rgba(233, 30, 99, 0.95)",
|
|
|
- "rgba(156, 39, 176, 0.9)",
|
|
|
- "rgba(103, 58, 183, 0.85)",
|
|
|
- "rgba(63, 81, 181, 0.8)",
|
|
|
- "rgba(33, 150, 243, 0.75)",
|
|
|
- "rgba(3, 169, 244, 0.7)",
|
|
|
- "rgba(0, 188, 212, 0.7)",
|
|
|
- "rgba(0, 150, 136, 0.75)",
|
|
|
- "rgba(76, 175, 80, 0.8)",
|
|
|
- "rgba(139, 195, 74, 0.85)",
|
|
|
- "rgba(205, 220, 57, 0.9)",
|
|
|
- "rgba(255, 235, 59, 0.95)",
|
|
|
- "rgba(255, 193, 7, 1)",
|
|
|
- ],
|
|
|
-
|
|
|
- components: {
|
|
|
- // Main components
|
|
|
- preview: true,
|
|
|
- opacity: true,
|
|
|
- hue: true,
|
|
|
-
|
|
|
- // Input / output Options
|
|
|
- interaction: {
|
|
|
- hex: true,
|
|
|
- rgba: false,
|
|
|
- hsla: false,
|
|
|
- hsva: false,
|
|
|
- cmyk: false,
|
|
|
- input: true,
|
|
|
- clear: true,
|
|
|
- save: true,
|
|
|
+const colorPicker = document.querySelector(".pickers");
|
|
|
+
|
|
|
+if (colorPicker) {
|
|
|
+ const pickr = Pickr.create({
|
|
|
+ el: ".color-picker",
|
|
|
+ theme: "nano",
|
|
|
+
|
|
|
+ swatches: [
|
|
|
+ "rgba(244, 67, 54, 1)",
|
|
|
+ "rgba(233, 30, 99, 0.95)",
|
|
|
+ "rgba(156, 39, 176, 0.9)",
|
|
|
+ "rgba(103, 58, 183, 0.85)",
|
|
|
+ "rgba(63, 81, 181, 0.8)",
|
|
|
+ "rgba(33, 150, 243, 0.75)",
|
|
|
+ "rgba(3, 169, 244, 0.7)",
|
|
|
+ "rgba(0, 188, 212, 0.7)",
|
|
|
+ "rgba(0, 150, 136, 0.75)",
|
|
|
+ "rgba(76, 175, 80, 0.8)",
|
|
|
+ "rgba(139, 195, 74, 0.85)",
|
|
|
+ "rgba(205, 220, 57, 0.9)",
|
|
|
+ "rgba(255, 235, 59, 0.95)",
|
|
|
+ "rgba(255, 193, 7, 1)",
|
|
|
+ ],
|
|
|
+
|
|
|
+ components: {
|
|
|
+ // Main components
|
|
|
+ preview: true,
|
|
|
+ opacity: true,
|
|
|
+ hue: true,
|
|
|
+
|
|
|
+ // Input / output Options
|
|
|
+ interaction: {
|
|
|
+ hex: true,
|
|
|
+ rgba: false,
|
|
|
+ hsla: false,
|
|
|
+ hsva: false,
|
|
|
+ cmyk: false,
|
|
|
+ input: true,
|
|
|
+ clear: true,
|
|
|
+ save: true,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
-});
|
|
|
-
|
|
|
-pickr.on("change", (...args) => {
|
|
|
- let color = args[0].toHEXA();
|
|
|
- console.log(args);
|
|
|
- console.log(color.toString());
|
|
|
+ });
|
|
|
|
|
|
- const buttons = document.getElementsByClassName("primary-c");
|
|
|
- for (let i = 0; i < buttons.length; i++) {
|
|
|
- buttons[i].style.backgroundColor = color.toString();
|
|
|
- buttons[i].addEventListener("mouseenter", (e) => {
|
|
|
- buttons[i].style.backgroundColor = "#F68B1F";
|
|
|
- });
|
|
|
+ pickr.on("change", (...args) => {
|
|
|
+ let color = args[0].toHEXA();
|
|
|
+ console.log(args);
|
|
|
+ console.log(color.toString());
|
|
|
|
|
|
- buttons[i].addEventListener("mouseleave", (e) => {
|
|
|
+ const buttons = document.getElementsByClassName("primary-c");
|
|
|
+ for (let i = 0; i < buttons.length; i++) {
|
|
|
buttons[i].style.backgroundColor = color.toString();
|
|
|
- });
|
|
|
- }
|
|
|
-});
|
|
|
+ buttons[i].addEventListener("mouseenter", (e) => {
|
|
|
+ buttons[i].style.backgroundColor = "#F68B1F";
|
|
|
+ });
|
|
|
+
|
|
|
+ buttons[i].addEventListener("mouseleave", (e) => {
|
|
|
+ buttons[i].style.backgroundColor = color.toString();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|