-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcf64ca5ab2d7504fc6f2.js
1 lines (1 loc) · 22.1 KB
/
cf64ca5ab2d7504fc6f2.js
1
!function(){"use strict";const e=document.querySelector(".nav__list"),a=document.querySelector(".burger"),n=n=>{a.classList[n]("burger_active"),e.classList[n]("nav__list_active"),document.body.classList[n]("body_fixed")},o=()=>n("remove"),t=e=>{document.querySelector(".popup__button").classList[e]("popup__button_hover")},s=(e,a)=>`\n\t<li class="popup__item">\n\t\t${e}\n\t\t<span class="popup__span">${a}</span>\n\t</li>\n`,i=[{name:"Jennifer",type:"Dog",breed:"Labrador",description:"Jennifer is a sweet 2 months old Labrador that is patiently waiting to find a new forever home. This girl really enjoys being able to go outside to run and play, but won't hesitate to play up a storm in the house if she has all of her favorite toys.",age:"2 months",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Sophia",type:"Dog",breed:"Shih tzu",description:"Sophia here and I'm looking for my forever home to live out the best years of my life. I am full of energy. Everyday I'm learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"1 month",inoculations:["parvovirus"],diseases:["none"],parasites:["none"]},{name:"Woody",type:"Dog",breed:"Golden Retriever",description:"Woody is a handsome 3 1/2 year old boy. Woody does know basic commands and is a smart pup. Since he is on the stronger side, he will learn a lot from your training. Woody will be happier when he finds a new family that can spend a lot of time with him.",age:"3 years 6 months",inoculations:["adenovirus","distemper"],diseases:["right back leg mobility reduced"],parasites:["none"]},{name:"Scarlett",type:"Dog",breed:"Jack Russell Terrier",description:"Scarlett is a happy, playful girl who will make you laugh and smile. She forms a bond quickly and will make a loyal companion and a wonderful family dog or a good companion for a single individual too since she likes to hang out and be with her human.",age:"3 months",inoculations:["parainfluenza"],diseases:["none"],parasites:["none"]},{name:"Katrine",type:"Cat",breed:"British Shorthair",description:"Katrine is a beautiful girl. She is as soft as the finest velvet with a thick lush fur. Will love you until the last breath she takes as long as you are the one. She is picky about her affection. She loves cuddles and to stretch into your hands for a deeper relaxations.",age:"6 months",inoculations:["panleukopenia"],diseases:["none"],parasites:["none"]},{name:"Timmy",type:"Cat",breed:"British Shorthair",description:"Timmy is an adorable grey british shorthair male. He loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. Timmy has a lot to say and wants a person to share his thoughts with.",age:"2 years 3 months",inoculations:["calicivirus","viral rhinotracheitis"],diseases:["kidney stones"],parasites:["none"]},{name:"Freddie",type:"Cat",breed:"British Shorthair",description:"Freddie is a little shy at first, but very sweet when he warms up. He likes playing with shoe strings and bottle caps. He is quick to learn the rhythms of his human’s daily life. Freddie has bounced around a lot in his life, and is looking to find his forever home.",age:"2 months",inoculations:["rabies"],diseases:["none"],parasites:["none"]},{name:"Charly",type:"Dog",breed:"Jack Russell Terrier",description:"This cute boy, Charly, is three years old and he likes adults and kids. He isn’t fond of many other dogs, so he might do best in a single dog home. Charly has lots of energy, and loves to run and play. We think a fenced yard would make him very happy.",age:"8 years",inoculations:["bordetella bronchiseptica","leptospirosis"],diseases:["deafness","blindness"],parasites:["lice","fleas"]},{name:"Hunter",type:"Dog",breed:"Jack Russell Terrier",description:"This cute gay likes adults and kids. He isn’t fond of many other dogs, so he might do best in a single dog home. He has lots of energy, and loves to run and play. We think a fenced yard would make him very happy.",age:"1 years 5 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Skrull",type:"Dog",breed:"Jack Russell Terrier",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"2 years 3 month",inoculations:["calicivirus"],diseases:["none"],parasites:["none"]},{name:"Pory",type:"Cat",breed:"Pooch",description:"I am a happy, playful girl who will make you laugh and smile. She forms a bond quickly and will make a loyal companion and a wonderful family dog or a good companion for a single individual too since she likes to hang out and be with her human.",age:"1 years 4 month",inoculations:["bordetella "],diseases:["blindness"],parasites:["none"]},{name:"Tanos",type:"Dog",breed:"Chihuahua",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"5 years 4 month",inoculations:["bordetella "],diseases:["blindness"],parasites:["none"]},{name:"Rex",type:"Dog",breed:"German Shepherd",description:"I am a friendly and laid back senior who enjoys chatting and being pet!",age:"1 years 1 month",inoculations:["bordetella","bronchiseptica"],diseases:["blindness"],parasites:["none"]},{name:"Willson",type:"Dog",breed:"Pooch",description:"I am a handsome sweetheart who loves people and melts for chin scratches!",age:"3 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Tor",type:"Dog",breed:"Dalmatian",description:"This cute gay likes adults and kids. He isn’t fond of many other dogs, so he might do best in a single dog home. He has lots of energy, and loves to run and play. We think a fenced yard would make him very happy.",age:"2 years 1 month",inoculations:["none"],diseases:["kidney stones"],parasites:["none"]},{name:"Monna",type:"Cat",breed:"Pooch",description:"I am a handsome sweetheart who loves people and melts for chin scratches!",age:"6 month",inoculations:["none"],diseases:["none"],parasites:["helminth"]},{name:"Donatan",type:"Dog",breed:"Shiba Inu",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"1 years 10 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Koddy",type:"Cat",breed:"Toyger",description:"I am a handsome sweetheart who loves people and melts for chin scratches!",age:"5 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Butty",type:"Dog",breed:"French Bulldog",description:"This cute gay likes adults and kids. He isn’t fond of many other dogs, so he might do best in a single dog home. He has lots of energy, and loves to run and play. We think a fenced yard would make him very happy.",age:"8 month",inoculations:["none"],diseases:["kidney stones"],parasites:["none"]},{name:"July",type:"Dog",breed:"Chihuahua",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"5 years 3 month",inoculations:["viral rhinotracheitis"],diseases:["kidney stones"],parasites:["none"]},{name:"Perry",type:"Dog",breed:"French Bulldog",description:"She is the perfect combination of silly and sweet. She is eager to please, loves her human and dog companions, and believes she is a professional MMA wrestler in her spare time.",age:"1 years 5 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Missy",type:"Dog",breed:"Labrador",description:"He’s mild mannered and really just wants to spend his time outside or laying next to you being pet. He is extremely low energy but has a lot of.",age:"7 month",inoculations:["none"],diseases:["none"],parasites:["lice","fleas"]},{name:"Lolly",type:"Dog",breed:"Pooch",description:"I am a friendly and laid back senior who enjoys chatting and being pet!",age:"2 years 3 month",inoculations:["calicivirus"],diseases:["deafness"],parasites:["lice","fleas"]},{name:"Iron",type:"Dog",breed:"Parson Russell Terrier",description:"This cute gay likes adults and kids. He isn’t fond of many other dogs, so he might do best in a single dog home. He has lots of energy, and loves to run and play. We think a fenced yard would make him very happy.",age:"1 years 5 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Wonder",type:"Dog",breed:"French Bulldog",description:"I am a handsome sweetheart who loves people and melts for chin scratches!",age:"3 years 9 month",inoculations:["none"],diseases:["none"],parasites:["lice","fleas"]},{name:"Molly",type:"Dog",breed:"Spaniel",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"1 years 9 month",inoculations:["none"],diseases:["blindness"],parasites:["fleas"]},{name:"Elton",type:"Dog",breed:"Pooch",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"1 years 9 month",inoculations:["none"],diseases:["blindness"],parasites:["fleas"]},{name:"Cola",type:"Dog",breed:"Brazilian Terrier",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"4 years 4 month",inoculations:["adenovirus"],diseases:["deafness"],parasites:["fleas"]},{name:"Doran",type:"Dog",breed:"German Shepherd",description:"I am a friendly and laid back senior who enjoys chatting and being pet!",age:"2 years 7 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Face",type:"Dog",breed:"Pooch",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"6 years 4 month",inoculations:["none"],diseases:["blindness"],parasites:["none"]},{name:"Fold",type:"Dog",breed:"American Staffordshire Bulldog",description:"I am a friendly and laid back senior who enjoys chatting and being pet!",age:"3 years 2 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Jhon",type:"Dog",breed:"Pooch",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"1 years 2 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Molav",type:"Dog",breed:"French Bulldog",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"1 years 5 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Monika",type:"Dog",breed:"Dachshund",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"3 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Nomad",type:"Dog",breed:"English bulldog",description:"I am a friendly and laid back senior who enjoys chatting and being pet!",age:"1 years 1 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Rikky",type:"Dog",breed:"Pooch",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"5 years 3 month",inoculations:["viral rhinotracheitis"],diseases:["Blindness"],parasites:["none"]},{name:"Rolls",type:"Dog",breed:"Pooch",description:"I am a friendly and laid back senior who enjoys chatting and being pet!",age:"3 years 1 month",inoculations:["viral rhinotracheitis"],diseases:["none"],parasites:["none"]},{name:"Ronny",type:"Dog",breed:"English bulldog",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"4 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Smile",type:"Dog",breed:"Pooch",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"6 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Jessy",type:"Dog",breed:"Tibetan mastiff",description:"I am a friendly and laid back senior who enjoys chatting and being pet!",age:"4 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Poolly",type:"Dog",breed:"Bedlington Terrier",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"9 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Salem",type:"Dog",breed:"Newfoundland",description:"I am loves to play and snuggle. He is neutered and up to date on age appropriate vaccinations. He can be chatty and enjoys being held. I am a lot to say and wants a person to share his thoughts with.",age:"2 years 11 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Spoon",type:"Dog",breed:"American Cocker Spaniel",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"4 years 4 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Yammy",type:"Dog",breed:"Chinese Crested",description:"This cute gay likes adults and kids. He isn’t fond of many other dogs, so he might do best in a single dog home. He has lots of energy, and loves to run and play. We think a fenced yard would make him very happy.",age:"7 years 1 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Blacky",type:"Dog",breed:"Pooch",description:"I am a friendly and laid back senior who enjoys chatting and being pet!",age:"3 years 8 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Bony",type:"Dog",breed:"Bull Terrier",description:"I am here and I am looking for my forever home to live out the best years of my life. I am full of energy. Everyday I am learning new things, like how to walk on a leash, go potty outside, bark and play with toys and I still need some practice.",age:"2 years 11 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Ember",type:"Dog",breed:"Cavalier King Charles Spaniel",description:"This cute gay likes adults and kids. He isn’t fond of many other dogs, so he might do best in a single dog home. He has lots of energy, and loves to run and play. We think a fenced yard would make him very happy.",age:"3 years 8 month",inoculations:["none"],diseases:["none"],parasites:["none"]},{name:"Huskar",type:"Dog",breed:"Husky",description:"I am a friendly and laid back senior who enjoys chatting and being pet!.",age:"1 years 1 month",inoculations:["none"],diseases:["none"],parasites:["none"]}].reduce(((e,a)=>(e[a.name]=a,e)),{}),r=e=>{const a=e.closest("figure").dataset.pet;return(({name:e,type:a,breed:n,description:o,age:t,inoculations:i,diseases:r,parasites:l})=>{const d=`\n\t${s("Age",t)}\n\t${s("Inoculations",i)}\n\t${s("Diseases",r)}\n\t${s("Parasites",l)}\n`;return`\t\n\t${(e=>{const a=`./assets/images/popup/${e}`;return`\n\t\t<picture class="popup__picture">\n\t\t<source\n\t\t\tsrcset="${a}.webp"\n\t\t\ttype="image/webp">\n\t\t<source\n\t\t\tsrcset="${a}.avif"\n\t\t\ttype="image/avif">\n\t\t<img class="popup__picture-image" src="${a}.png", alt="${e}">\n\t\t</picture>`})(e)}\n\t${((e,a,n,o,t)=>`\t\t\n<div class="popup__content">\n\t\t\t<h4 class="popup__title popup__text">${e}</h4>\n\t\t\t<h5 class="popup__breed popup__text">${a} - ${n}</h5>\n\t\t\t<p class="popup__description popup__text">${o}</p>\n\t\t\t<ul class="popup__list">\n\t\t\t\t${t}\n\t\t\t</ul>\n\t\t\t<button class="popup__button"></button>\n\t\t</div>`)(e,a,n,o,d)}\n\t`})(i[a])},l=document.querySelector(".popup_shadow"),d=e=>{document.body.classList[e]("body_popup_fixed"),m.classList[e]("popup_active"),l.classList[e]("popup_shadow-on")},m=document.querySelector(".popup"),p=e=>{const a=e.target;a.classList.contains("pets__images")||(m.innerHTML=r(a),d("add"))},h=e=>{e.target.closest(".burger")&&n("toggle"),e.target.closest(".nav__item")&&o()};let g=1;const y=()=>g,c=e=>g=e;let u;const b=()=>u;var f=[{name:"Katrine",alt:"Cat Katrine",imgName:"pets-katrine"},{name:"Jennifer",alt:"Dog Jennifer",imgName:"pets-jennifer"},{name:"Woody",alt:"Dog Woody",imgName:"pets-woody"},{name:"Sophia",alt:"Dog Sophia",imgName:"pets-sophia"},{name:"Timmy",alt:"Cat Timmy",imgName:"pets-timmy"},{name:"Charly",alt:"Dog Charly",imgName:"pets-charly"},{name:"Scarlett",alt:"Dog Scarlett",imgName:"pets-scarlet"},{name:"Freddie",alt:"Cat Freddie",imgName:"pets-freddie"},{name:"Hunter",alt:"Dog Hunter",imgName:"pets-hunter"},{name:"Skrull",alt:"Dog Skrull",imgName:"pets-skrull"},{name:"Pory",alt:"Cat Pory",imgName:"pets-pory"},{name:"Tanos",alt:"Dog Tanos",imgName:"pets-tanos"},{name:"Rex",alt:"Dog Rex",imgName:"pets-rex"},{name:"Willson",alt:"Dog Willson",imgName:"pets-willson"},{name:"Tor",alt:"Dog Tor",imgName:"pets-tor"},{name:"Monna",alt:"Cat Monna",imgName:"pets-monna"},{name:"Donatan",alt:"Dog Donatan",imgName:"pets-donatan"},{name:"Koddy",alt:"Dog Koddy",imgName:"pets-koddy"},{name:"Butty",alt:"Dog Butty",imgName:"pets-butty"},{name:"July",alt:"Dog July",imgName:"pets-july"},{name:"Perry",alt:"Dog Perry",imgName:"pets-perry"},{name:"Missy",alt:"Dog Missy",imgName:"pets-missy"},{name:"Lolly",alt:"Dog Lolly",imgName:"pets-lolly"},{name:"Iron",alt:"Dog Iron",imgName:"pets-iron"},{name:"Wonder",alt:"Dog Wonder",imgName:"pets-wonder"},{name:"Molly",alt:"Dog Molly",imgName:"pets-molly"},{name:"Elton",alt:"Dog Elton",imgName:"pets-elton"},{name:"Cola",alt:"Dog Cola",imgName:"pets-cola"},{name:"Doran",alt:"Dog Doran",imgName:"pets-doran"},{name:"Face",alt:"Dog Face",imgName:"pets-face"},{name:"Fold",alt:"Dog Fold",imgName:"pets-fold"},{name:"Jhon",alt:"Dog Jhon",imgName:"pets-jhon"},{name:"Molav",alt:"Dog Molav",imgName:"pets-molav"},{name:"Monika",alt:"Dog Monika",imgName:"pets-monika"},{name:"Nomad",alt:"Dog Nomad",imgName:"pets-nomad"},{name:"Rikky",alt:"Dog Rikky",imgName:"pets-rikky"},{name:"Rolls",alt:"Dog Rolls",imgName:"pets-rolls"},{name:"Ronny",alt:"Dog Ronny",imgName:"pets-ronny"},{name:"Smile",alt:"Dog Smile",imgName:"pets-smile"},{name:"Jessy",alt:"Dog Jessy",imgName:"pets-jessy"},{name:"Poolly",alt:"Dog Poolly",imgName:"pets-poolly"},{name:"Salem",alt:"Dog Salem",imgName:"pets-salem"},{name:"Spoon",alt:"Dog Spoon",imgName:"pets-spoon"},{name:"Yammy",alt:"Dog Yammy",imgName:"pets-yammy"},{name:"Blacky",alt:"Dog Blacky",imgName:"pets-blacky"},{name:"Bony",alt:"Dog Bony",imgName:"pets-bony"},{name:"Ember",alt:"Dog Ember",imgName:"pets-ember"},{name:"Huskar",alt:"Dog Huskar",imgName:"pets-huskar"}];const k=document.querySelector(".pets__images"),w=(e,a)=>`\n<source\n\tsrcset="${e}@1x.${a} 1x,${e}@2x.${a} 2x, ${e}@3x.${a} 3x"\n\ttype="image/${a}">\n`,v=e=>{const{name:a,imgName:n,alt:o}=f[e],t=`./assets/images/pets-list/${n}`,s=`\n\t<picture class="pets__images-picture">\n\t\t${w(t,"webp")}\n\t\t${w(t,"avif")}\n\t\t<img class="pets__images-image" src="${t}@1x.png" srcset="${t}@2x.png 2x,\n\t\t${t}@3x.png 3x" alt="${o}">\n\t</picture>\n\t<figcaption>\n\t\t<p class="pets__images-text subtitle-animal">${a}</p >\n\t\t<button class="pets__images-button">Learn more</button>\n\t</figcaption> \n`,i=document.createElement("figure");i.classList.add("pets__images-figure"),i.setAttribute("data-pet",a),i.innerHTML=s,k.append(i)},D=()=>{var e;e=(()=>{const e=window.innerWidth;return e>=1280?8:e>=768?6:e>=0?3:void 0})(),u=e,k.innerHTML="";for(let e=(y()-1)*b();e<y()*b()&&f[e];e++)v(e)},I=document.querySelector(".pets__buttons-item_count"),_=e=>I.textContent=e,N=(...e)=>{e.forEach((e=>{e.classList.remove("pets__buttons-item_enabled"),e.classList.add("pets__buttons-item_disabled"),e.setAttribute("disabled",!0)}))},S=(...e)=>{e.forEach((e=>{e.removeAttribute("disabled"),e.classList.remove("pets__buttons-item_disabled"),e.classList.add("pets__buttons-item_enabled")}))},H=document.querySelector(".left-start"),$=document.querySelector(".left"),T=document.querySelector(".right"),L=document.querySelector(".right-end");let C;const j=()=>C,x=()=>C=Math.ceil(f.length/b()),E={".header":e=>h(e),".pets__images":e=>p(e),".left-start":()=>{c(1),_(y()),N(H,$),S(T,L),D()},".left":()=>{--g,_(y()),S(T,L),1===y()&&N(H,$),D()},".right":()=>{x(),g++,_(y()),S(H,$),y()===j()&&N(T,L),D()},".right-end":()=>{x(),c(j()),_(y()),N(T,L),S(H,$),D()},".popup__button":()=>d("remove")};D(),window.addEventListener("click",(e=>{((e,a)=>{const n=e.target;for(const o in a)if(n.closest(o)){a[o](e);break}})(e,E),(e=>{!a.classList.contains("burger_active")||e.target.closest(".nav__list")||e.target.closest(".burger")||o()})(e),(e=>{e.target.classList.contains("popup_shadow-on")&&d("remove")})(e)})),m.addEventListener("mouseleave",(()=>t("add"))),m.addEventListener("mouseenter",(()=>t("remove"))),window.addEventListener("resize",(()=>{x();let e=Math.min(y(),j());c(e),_(e),1===e?(N(H,$),S(T,L)):e===j()?(S(H,$),N(T,L)):S(H,$,T,L),D()}))}();