Przeglądaj źródła

Implementing new API with domain name

Md Mozahidur Rahman 1 rok temu
rodzic
commit
4a529519af
4 zmienionych plików z 118 dodań i 96 usunięć
  1. 13 1
      css/theme-styles.css
  2. 97 94
      js/theme-settings.js
  3. 1 1
      page-template/page-conference.php
  4. 7 0
      single-faculty.php

+ 13 - 1
css/theme-styles.css

@@ -1655,4 +1655,16 @@ body.archive aside#secondary{
 .paper-details .paper-tags .tag {
   margin: 2px;
   display: inline-block;
-}
+}
+
+/* Pickers Styling--------------------------------- */
+.pickers{
+  position: fixed;
+  right: 0px;
+  z-index: 1000;
+  top: 300px;
+  width: 50px;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}

+ 97 - 94
js/theme-settings.js

@@ -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();
+      });
+    }
+  });
+}

+ 1 - 1
page-template/page-conference.php

@@ -184,7 +184,7 @@ get_header(); ?>
             redirect: 'follow'
         };
 
-        fetch("http://103.109.52.3/webapi/api/EmployeeJournal", requestOptions)
+        fetch("https://ucamapi.uiu.ac.bd/api/EmployeeConference", requestOptions)
             .then(response => response.text())
             .then(result => console.log(result))
             .catch(error => console.log('error', error));

+ 7 - 0
single-faculty.php

@@ -246,6 +246,13 @@ get_header(); ?>
 
 <?php endwhile; // end of the loop.
 ?>
+<div class="pickers">
+	<span class="color-picker"></span>
+	<span class="color-picker2"></span>
+	<span class="color-picker3"></span>
+	<span class="color-picker4"></span>
+</div>
+
 <style>
 	header {
 		margin: 0px !important;