kuronoir

windenbro downloads

Jan 23rd, 2023 (edited)
1,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="UTF-8" />
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7.     <!-- material icons -->
  8.     <link
  9.       href="https://fonts.googleapis.com/icon?family=Material+Icons"
  10.       rel="stylesheet"
  11.     />
  12.     <title>windenbro | downloads</title>
  13.    
  14.     <style>
  15. :root {
  16.   --background: #1b1b1b;
  17.   --card: #282626;
  18.   --accent: #413a3a;
  19.   --text: #b5aea4;
  20.  
  21.   --radius: 5px;
  22. }
  23.  
  24. /* MAIN STYLES */
  25.  
  26. * {
  27.   color: var(--text);
  28.   font-family: sans-serif;
  29.   margin: 0;
  30.   padding: 0;
  31.   box-sizing: border-box;
  32. }
  33.  
  34. html {
  35.   background: var(--background);
  36. }
  37.  
  38. /* NAV STYLES */
  39.  
  40. header {
  41.   background: var(--card);
  42.   position: fixed;
  43.   width: 100%;
  44.   padding: 25px 40px;
  45.   top: 0;
  46.   border-bottom: 1px solid var(--accent);
  47. }
  48.  
  49. header h1 {
  50.   font-weight: bold;
  51.   margin-bottom: 15px;
  52.   display: inline;
  53. }
  54.  
  55. header h1::before {
  56.   position: relative;
  57.   font-family: "Material Icons";
  58.   content: "\E87C";
  59.   border: 1px solid var(--accent);
  60.   padding: 8px;
  61.   border-radius: 5px;
  62.   bottom: -4px;
  63.   margin-right: 10px;
  64. }
  65.  
  66. header span {
  67.   display: inline;
  68.   font-weight: 100;
  69.   margin-left: 10px;
  70. }
  71.  
  72. nav {
  73.   width: 100%;
  74.   position: fixed;
  75.   top: 90px;
  76.   background: var(--card);
  77. }
  78.  
  79. nav ul {
  80.   display: flex;
  81.   align-items: center;
  82.   justify-content: center;
  83.   gap: 40px;
  84. }
  85.  
  86. nav ul li {
  87.   padding: 15px 20px;
  88.   margin: 10px 0;
  89.   border-radius: var(--radius);
  90.   list-style-type: none;
  91. }
  92.  
  93. /* CARDS */
  94.  
  95. #card-container {
  96.   display: flex;
  97.   width: 80vw;
  98.   margin: 0 auto;
  99.   margin-top: 90px;
  100.   flex-wrap: wrap;
  101.   justify-content: center;
  102.   gap: 30px;
  103.   padding: 100px 0;
  104. }
  105.  
  106. .card {
  107.   width: 250px;
  108.   height: 300px;
  109.   margin-bottom: 20px;
  110.   border-radius: var(--radius);
  111. }
  112.  
  113. .card img {
  114.   width: 100%;
  115.   height: 100%;
  116.   object-fit: cover;
  117.   border-radius: var(--radius);
  118.   background: var(--card);
  119.   border: 1px solid var(--accent);
  120.   padding: 5px;
  121.   transition: 0.2s ease-in-out;
  122. }
  123.  
  124. .card img:hover {
  125.   padding: 0px;
  126. }
  127.  
  128. .card h3 {
  129.   text-transform: uppercase;
  130. }
  131.  
  132. /* MISC */
  133.  
  134. .hide {
  135.   display: none;
  136. }
  137.  
  138. .show {
  139.   display: block;
  140. }
  141.  
  142. .active {
  143.   background: var(--accent);
  144. }
  145.     </style>
  146.   </head>
  147.   <body>
  148.     <header>
  149.       <h1>windenbro.</h1>
  150.       <span>[downloads]</span>
  151.     </header>
  152.     <nav>
  153.       <ul>
  154.         <li class="filter-button active" data-filter-attribute="all">All</li>
  155.         <li class="filter-button" data-filter-attribute="cas">CAS</li>
  156.         <li class="filter-button" data-filter-attribute="bb">Build/Buy</li>
  157.         <li class="filter-button" data-filter-attribute="sim">Sims</li>
  158.       </ul>
  159.     </nav>
  160.     <div id="card-container"></div>
  161.     <script>
  162.       const cardData = [
  163.   {
  164.     image: "https://64.media.tumblr.com/460bf95618b6ec0b13eb723e858a29d0/22ff8fa12b561e4a-4a/s400x600/cfd38fcabb4c00f4092c87ef441f2b5b467ea96f.pnj",
  165.     title: "simtimates+",
  166.     link: "/",
  167.     categories: ["cas"],
  168.   },
  169.   {
  170.     image: "https://64.media.tumblr.com/b567b34b54937b5d746978c510a012c4/22ff8fa12b561e4a-b8/s400x600/851b16ac93dee64e6eeafc9eb68d82b4ab80e47c.pnj",
  171.     title: "butch",
  172.     link: "/",
  173.     categories: ["cas"],
  174.   },
  175.   {
  176.     image: "https://64.media.tumblr.com/cbd12b164e250f3f365f35a82447b514/22ff8fa12b561e4a-dd/s400x600/1e471884221e39f8f4cd5e6aad38557f9935c4ad.pnj",
  177.     title: "micro tank",
  178.     link: "/",
  179.     categories: ["cas"],
  180.   },
  181.   {
  182.     image: "https://64.media.tumblr.com/7989cc3b88ccacb8fb105b3b4c3e6efa/22ff8fa12b561e4a-6f/s400x600/93b9868851f6e733f9de1901915adb7b93962ec6.pnj",
  183.     title: "who wears (short) shorts",
  184.     link: "/",
  185.     categories: ["cas"],
  186.   },
  187.   {
  188.     image: "https://64.media.tumblr.com/b2eab2e680056f0666e3c17f35b79eca/22ff8fa12b561e4a-8c/s400x600/13add983d9c2b8bbbe964eadec7036662a4360bb.pnj",
  189.     title: "caleb underwood",
  190.     link: "/",
  191.     categories: ["sim"],
  192.   },
  193.   {
  194.     image: "https://64.media.tumblr.com/8ed6c3c75ee421a301ffb49dee35bd60/22ff8fa12b561e4a-60/s400x600/9c90f9bfadd69ef707c7c2f3147d7cea07aafc26.pnj",
  195.     title: "interlude",
  196.     link: "/",
  197.     categories: ["cas"],
  198.   },
  199. ];
  200.  
  201. const createCards = () => {
  202.   let cardHtml = "";
  203.   cardData.forEach((card) => {
  204.     const categories = card.categories.toString();
  205.     cardHtml += '<div class="card" data-categories="'+ categories +'">' +
  206.             '<a href="' + card.link + '">' +
  207.                 '<img src="'+ card.image +'" alt="' + card.title + '">' +
  208.             '</a>' +
  209.             '<h3>' + card.title + '</h3>' +
  210.         '</div>';
  211.   });
  212.   return cardHtml;
  213. };
  214.  
  215. const appendCards = () => {
  216.   const cardHtmlString = createCards();
  217.   const container = document.querySelector("#card-container");
  218.   container.innerHTML = cardHtmlString;
  219. };
  220.  
  221. const addListenerToFilterButtons = () => {
  222.   const filterButtons = document.querySelectorAll(".filter-button");
  223.  
  224.   filterButtons.forEach((button) => {
  225.     button.addEventListener("click", onFilter);
  226.   });
  227. };
  228.  
  229. const onFilter = (event) => {
  230.   const filterAttr = event.target.dataset.filterAttribute;
  231.   const cardNodes = document.querySelectorAll(".card");
  232.   updateActiveButton(filterAttr);
  233.   if (filterAttr === "all") {
  234.     cardNodes.forEach((node) => {
  235.       node.classList.remove("hide");
  236.     });
  237.   } else {
  238.     cardNodes.forEach((node) => {
  239.       const cardCategories = node.dataset.categories;
  240.       if (!cardCategories.includes(filterAttr)) {
  241.         node.classList.add("hide");
  242.         node.classList.remove("show");
  243.       } else if (cardCategories.includes(filterAttr)) {
  244.         node.classList.remove("hide");
  245.         node.classList.add("show");
  246.       }
  247.     });
  248.   }
  249. };
  250.  
  251. const updateActiveButton = (target) => {
  252.   const filterButtons = document.querySelectorAll(".filter-button");
  253.   filterButtons.forEach((btn) => {
  254.     if (btn.dataset.filterAttribute != target) {
  255.       btn.classList.remove("active");
  256.     } else if (btn.dataset.filterAttribute === target) {
  257.       btn.classList.add("active");
  258.     }
  259.   });
  260. };
  261.  
  262. document.addEventListener("DOMContentLoaded", () => {
  263.   appendCards();
  264.   addListenerToFilterButtons();
  265. });
  266.  
  267.     </script>
  268.   </body>
  269. </html>
  270.  
Advertisement
Add Comment
Please, Sign In to add comment