Questo sito vi permette di cercare nickname GitHub con un click senza perdere tempo con l'interfaccia leggermente più complessa del sito ufficiale.

CERCA NICKNAME (SITO)

GITHUB REPO

Il sito web è stato creato in HTML, CSS, SCSS e Javascript.
Nel file Javascript ho organizzato gli elementi HTML nell'oggetto elements che corrispondono all'avatar, nick, biografia, data di creazione, attività (numero di repository, follower e following) e info personali come luogo ecc...
fetchUser si occupa di recuperare i dati dell'utente da GitHub tramite una richiesta API (api.github.com), se questa operazione ha successo viene richiamata updateDOM per aggiornare il client altrimenti viene restituito un errore.
updateDOM anche se non l'ho specificato sfrutta elements per inserire i dati corrispondenti nei rispettivi elementi HTML.
Inoltre ho aggiunto diversi eventi per gestire i click, ad esempio il click sulla barra di ricerca e l'invio sulla tastiera. Entrambi richiamano fetchUser con il valore inserito nell'input (barra di ricerca).
Gli altri file CSS e SCSS potete vederli qui sotto o su Github!

Struttura del codice:

- / assets

 - / images
  - favicon e immagini varie (vedi GitHub)

 - / js
  - darkMode.js
  - script.js

 - / scss
  - _ main.scss
  - _ mixins.scss
  - style.scss

 - / styles
  - style.css
  - style.css.map


- index.html

Codice:

Assets

/ js:
darkMode.js:

let darkMode = localStorage.getItem("darkMode");

const colorName = document.querySelector(".colorMode p");
const colorIcon = document.querySelector(".colorMode path");
const originalAttribute = colorIcon.getAttribute("d");

//Social SVG
const socialSvg = document.querySelectorAll(".social__link path");
const websiteSvg = document.querySelector(".social__link:nth-child(3) g");

const enabledarkMode = () => {
  document.body.classList.add("darkMode");

  colorName.textContent = "Light";
  colorIcon.setAttribute(
    "d",
    "M13.545 6.455c-.9-.9-2.17-1.481-3.545-1.481a4.934 4.934 0 00-3.545 1.481c-.9.9-1.481 2.17-1.481 3.545 0 1.376.582 2.646 1.481 3.545.9.9 2.17 1.481 3.545 1.481a4.934 4.934 0 003.545-1.481c.9-.9 1.481-2.17 1.481-3.545a4.934 4.934 0 00-1.481-3.545zM10 3.413a.7.7 0 00.688-.688V.688A.7.7 0 0010 0a.7.7 0 00-.688.688v2.037a.7.7 0 00.688.688zM15.635 5.344l1.455-1.455a.67.67 0 000-.952.67.67 0 00-.952 0l-1.455 1.455a.67.67 0 000 .952c.238.264.66.264.952 0zM19.312 9.312h-2.037a.7.7 0 00-.688.688.7.7 0 00.688.688h2.037A.7.7 0 0020 10a.7.7 0 00-.688-.688zM15.608 14.656a.67.67 0 00-.952 0 .67.67 0 000 .952l1.455 1.455a.67.67 0 00.952 0 .67.67 0 000-.952l-1.455-1.455zM10 16.587a.7.7 0 00-.688.688v2.037A.7.7 0 0010 20a.7.7 0 00.688-.688v-2.037a.7.7 0 00-.688-.688zM4.365 14.656L2.91 16.111a.67.67 0 000 .952.67.67 0 00.952 0l1.455-1.455a.67.67 0 000-.952c-.238-.264-.66-.264-.952 0zM3.413 10a.7.7 0 00-.688-.688H.688A.7.7 0 000 10a.7.7 0 00.688.688h2.037A.7.7 0 003.413 10zM4.365 5.344a.67.67 0 00.952 0 .67.67 0 000-.952L3.862 2.937a.67.67 0 00-.952 0 .67.67 0 000 .952l1.455 1.455z"
  );

  socialSvg.forEach((svg) => {
    svg.style.fill = "#FFF";
  });
  websiteSvg.style.fill = "#FFF";

  localStorage.setItem("darkMode", "enabled");
};

const disableDarkMode = () => {
  document.body.classList.remove("darkMode");

  // Reset styles to default mode
  colorName.textContent = "Dark";
  colorName.style.color = "";
  colorIcon.setAttribute("d", originalAttribute);

  // Reset SVG fills to default
  socialSvg.forEach((svg) => {
    svg.style.removeProperty("fill");
  });
  websiteSvg.style.removeProperty("fill");

  localStorage.setItem("darkMode", null);
};

if (darkMode === "enabled") {
  enabledarkMode();
}

const colorMode = document.querySelector(".colorMode");

colorMode.addEventListener("click", () => {
  darkMode = localStorage.getItem("darkMode");
  if (darkMode !== "enabled") {
    enabledarkMode();
  } else {
    disableDarkMode();
  }
});

script.js:

const elements = {
  avatar: {
    container: document.querySelector(".left"),
    image: document.createElement("img")
  },
  nameAndLogin: {
    container: document.querySelector(".middle"),
    name: document.createElement("h1"),
    login: document.createElement("h2")
  },
  bio: {
    container: document.querySelector(".bio"),
    paragraph: document.createElement("p")
  },
  creationDate: {
    container: document.querySelector(".right"),
    paragraph: document.createElement("p")
  },
  activity: {
    repos: {
      container: document.querySelector(".activity__data:nth-child(1)"),
      count: document.createElement("h4")
    },
    followers: {
      container: document.querySelector(".activity__data:nth-child(2)"),
      count: document.createElement("h4")
    },
    following: {
      container: document.querySelector(".activity__data:nth-child(3)"),
      count: document.createElement("h4")
    }
  },
  social: {
    city: {
      container: document.querySelector(".social__link:nth-child(1)"),
      info: document.createElement("p"),
      svg: document.querySelector(".social__link:nth-child(1) path")
    },
    twitter: {
      container: document.querySelector(".social__link:nth-child(2)"),
      account: document.createElement("a"),
      svg: document.querySelector(".social__link:nth-child(2) path")
    },
    website: {
      container: document.querySelector(".social__link:nth-child(3)"),
      link: document.createElement("a"),
      svg: document.querySelector(".social__link:nth-child(3) g")
    },
    company: {
      container: document.querySelector(".social__link:nth-child(4)"),
      name: document.createElement("a"),
      svg: document.querySelector(".social__link:nth-child(4) path")
    }
  },
  errorMessage: document.querySelector(".error")
};

async function fetchUser(username) {
  elements.errorMessage.style.display = "none";

  try {
    const response = await fetch(`https://api.github.com/users/${username}`);
    const parsedResponse = await response.json();

    if (!response.ok) {
      return (elements.errorMessage.style.display = "block");
    }

    return updateDOM(parsedResponse);
  } catch (err) {
    return console.log(err);
  }
}

function updateDOM(data) {
  const { avatar, nameAndLogin, bio, creationDate, activity, social } = elements;

  avatar.image.src = data.avatar_url;
  avatar.image.alt = "Profile avatar";
  avatar.container.appendChild(avatar.image);

  nameAndLogin.name.innerText = data.name;
  nameAndLogin.login.innerText = `@${data.login}`;
  nameAndLogin.container.appendChild(nameAndLogin.name);
  nameAndLogin.container.appendChild(nameAndLogin.login);

  // Bio
  if (data.bio === null) {
    bio.paragraph.innerText = "This profile has no bio";
    bio.paragraph.style.opacity = 0.5;
  } else {
    bio.paragraph.style.opacity = 1;
    bio.paragraph.innerText = data.bio;
  }
  bio.container.appendChild(bio.paragraph);

  // Creation date
  const joinDate = new Date(data.created_at);
  const months = [
    "Jan", "Feb", "Mar", "Apr", "May", "Jun",
    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
  ];
  const dateFormat = `${joinDate.getDate()} ${months[joinDate.getMonth()]} ${joinDate.getFullYear()}`;
  creationDate.paragraph.innerText = `Joined ${dateFormat}`;
  creationDate.container.appendChild(creationDate.paragraph);

  // Activity
  activity.repos.count.innerText = data.public_repos;
  activity.repos.container.appendChild(activity.repos.count);

  activity.followers.count.innerText = data.followers;
  activity.followers.container.appendChild(activity.followers.count);

  activity.following.count.innerText = data.following;
  activity.following.container.appendChild(activity.following.count);

  // Social
  const { city, twitter, website, company } = social;

  city.info.innerText = data.location || "Not Available";
  city.info.style.opacity = data.location ? 1 : 0.5;
  city.svg.style.opacity = data.location ? 1 : 0.5;
  city.container.appendChild(city.info);

  twitter.account.innerText = data.twitter_username || "Not Available";
  twitter.account.style.opacity = data.twitter_username ? 1 : 0.5;
  twitter.svg.style.opacity = data.twitter_username ? 1 : 0.5;
  twitter.account.href = data.twitter_username ? `https://twitter.com/${data.twitter_username}` : "#";
  twitter.account.target = "_blank";
  twitter.container.appendChild(twitter.account);

  website.link.innerText = data.blog ? data.blog.split("/")[2].split(".app")[0] : "Not Available";
  website.link.style.opacity = data.blog ? 1 : 0.5;
  website.svg.style.opacity = data.blog ? 1 : 0.5;
  website.link.href = data.blog || "#";
  website.link.target = "_blank";
  website.container.appendChild(website.link);

  company.name.innerText = data.company || "Not Available";
  company.name.style.opacity = data.company ? 1 : 0.5;
  company.svg.style.opacity = data.company ? 1 : 0.5;
  company.name.href = data.company ? `https://github.com/${data.company.split("@")[1]}` : "#";
  company.name.target = "_blank";
  company.container.appendChild(company.name);
}

window.onload = () => fetchUser("samueleex");

const searchBtn = document.querySelector("button");
const input = document.getElementById("textInput");

searchBtn.addEventListener("click", () => fetchUser(input.value));

input.addEventListener("keypress", (e) => {
  if (e.key === "Enter") {
    fetchUser(input.value);
  }
});

/ scss:
_main.scss:

@import url("https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap");

:root {
  --font: "Space Mono", monospace;

  --background: rgb(246, 248, 255);
  --component-background: rgb(254, 254, 254);

  --title: rgb(43, 52, 66);
  --text: rgb(75, 106, 155);
  --third: rgb(105, 124, 154);

  --white: rgb(255, 255, 255);

  --shadow: 0 4px 4px rgba(0, 0, 0, 25%);
  --bigShadow: 0 16px 30px -10px rgba(70, 96, 187, 20%);
  --colorMode: rgb(43, 52, 66);

  //Unchanged Colors
  --secondary: rgb(0, 121, 255);
  --btn-hover: rgb(96, 171, 255);
  --error: rgb(247, 70, 70);
}

.darkMode {
  --background: rgb(20, 29, 47);
  --component-background: rgb(30, 42, 71);

  --title: rgb(255, 255, 255);
  --text: rgb(255, 255, 255);
  --third: rgb(255, 255, 255);

  --shadow: "none";
  --bigShadow: "none";
  --colorMode: rgb(144, 164, 212);
}

*,
::before,
::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  @include flex(center);
  flex-direction: column;
  min-height: 100vh;
  margin: auto 20%;
  font-family: var(--font);
  background-color: var(--background);
}

h1 {
  @include fontStyle(var(--title), bold, 26px, 38px);
}

h2 {
  @include fontStyle(var(--secondary), normal, 16px, 24px);
}

h3 {
  @include fontStyle(var(--text), normal, 13px, 20px);
}

h4 {
  @include fontStyle(var(--title), bold, 22px, 33px);
}

p {
  @include fontStyle(none, normal, 15px, 25px);
}

a {
  @include fontStyle(var(--text), normal, 15px, 25px);
}

@media all and (max-width: 1200px) {
  body {
    margin: 20px 10%;
  }
}

@media all and (max-width: 625px) {
  body {
    margin: 30px 24px;
  }

  h1 {
    @include fontStyle(var(--title), bold, 16px, 28px);
  }

  h2 {
    @include fontStyle(var(--secondary), normal, 13px, 15px);
  }

  h3 {
    @include fontStyle(var(--text), normal, 11px, 18px);
  }

  h4 {
    @include fontStyle(var(--title), bold, 16px, 27px);
  }

  p {
    @include fontStyle(none, normal, 13px, 23px);
  }

  a {
    @include fontStyle(var(--text), normal, 13px, 23px);
  }
}

_mixins.scss:

@mixin fontStyle($color, $weight, $size, $height) {
  color: $color;
  font-weight: $weight;
  font-size: $size;
  line-height: $height;
}

@mixin flex($justify) {
  display: flex;
  justify-content: $justify;
  align-items: center;
}

style.scss:

@import "./_mixins";
@import "./_main";

//Header

header {
  @include flex(space-between);
  width: 100%;
  height: 38px;
}

header h1 {
  cursor: pointer;
}

.colorMode {
  @include flex(center);
  gap: 16px;
  cursor: pointer;
  padding: 2px;
  transition: 0.2s;
}

.colorMode p {
  color: var(--third);
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2.5px;
}

.colorMode:hover p,
.colorMode:hover path {
  color: var(--colorMode);
  fill: var(--colorMode);
}

//Search Bar

.searchBar {
  background-color: var(--component-background);
  border-radius: 15px;
  width: 100%;
  height: 69px;
  display: grid;
  grid-template-columns: 34px 1fr 106px;
  margin: 30px 0;
  padding: 9.5px 10px 9.5px 32px;
  box-shadow: var(--shadow);
}

.searchBar img {
  width: 24px;
  height: 24px;
  margin-top: 14px;
}

#textInput {
  font-family: var(--font);
  color: var(--title);
  caret-color: var(--secondary);
  background-color: var(--component-background);
  font-size: 18px;
  border: none;
  width: 100%;
  height: 50px;
}

#textInput:focus {
  outline: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-background-clip: text;
  -webkit-text-fill-color: var(--title);
  box-shadow: inset 0 0 20px 20px var(--component-background);
}

#textInput::placeholder {
  font-family: var(--font);
  color: var(--text);
  font-size: 18px;
  letter-spacing: -1px;
}

.searchBar .error {
  display: none;
  color: var(--error);
  font-size: 15px;
  font-weight: bold;
  margin-top: 13px;
}

.searchBar button {
  color: var(--white);
  background-color: var(--secondary);
  font-size: 16px;
  font-weight: bold;
  width: 100%;
  height: 50px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: 0.2s;
}

.searchBar button:hover {
  background-color: var(--btn-hover);
}

.searchBar button:active {
  transform: scale(0.95);
}

//Search result

#result {
  background-color: var(--component-background);
  border-radius: 15px;
  box-shadow: var(--bigShadow);
  padding: 48px 38px 48px 58px;
  width: 100%;
}

// Top part

.result__top {
  display: grid;
  grid-template-columns: 154px 280px 1fr;
  grid-template-rows: 64px 53px;
}

#result img {
  width: 117px;
  height: 117px;
  clip-path: circle();
}

.middle h2 {
  margin-top: 2px;
}

.bio {
  color: var(--text);
  grid-column: 2/4;
  margin-top: 20px;
}

.right {
  color: var(--third);
  grid-row: 1;
  grid-column: 3;
  margin-top: 8px;
  text-align: end;
}

// Bottom part

.result__bottom {
  display: grid;
  grid-template-rows: 85px 1fr;
  margin-top: 32px;
  margin-left: 154px;
}

.activity {
  background-color: var(--background);
  border-radius: 10px;
  @include flex(none);
  padding: 0 32px;
}

.activity__data {
  margin-right: 25%;
}

.social {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 19px;
  margin-top: 37px;
  color: var(--text);
}

.social__link {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-right: 20px;
}

.social__link a {
  text-decoration: none;
  cursor: pointer;
}

.social__link a:hover {
  text-decoration: underline;
}

@media all and (max-width: 1200px) {
  //Search Bar

  .searchBar {
    grid-template-columns: 34px 1fr 106px;
  }

  //Search result

  #result {
    padding: 40px;
  }

  // Top part

  .result__top {
    grid-template-columns: 154px 1fr;
    grid-template-rows: 77px 40px 1fr;
  }

  .middle {
    margin-top: 12px;
  }

  .middle h2 {
    margin-top: 0;
  }

  .bio {
    grid-column: 1/3;
    margin-top: 24px;
  }

  .right {
    grid-row: 2;
    grid-column: 2;
    margin-top: 4px;
    text-align: start;
  }

  // Bottom part

  .result__bottom {
    margin-left: 0;
  }

  .social {
    margin-top: 30px;
  }

  .social__link {
    margin-right: 0;
  }
}

@media all and (max-width: 625px) {
  //Header
  header h1 {
    font-size: 26px;
  }

  //Search Bar

  .searchBar {
    grid-template-columns: 30px 1fr 84px;
    height: 60px;
    padding: 6.5px 7px 7.5px 16px;
  }

  .searchBar img {
    width: 20px;
    height: 20px;
  }

  #textInput {
    font-size: 13px;
    height: 46px;
  }

  #textInput::placeholder {
    font-size: 13px;
  }

  .searchBar button {
    font-size: 14px;
    height: 46px;
  }

  //Search result

  #result {
    padding: 32px 24px;
  }

  // Top part

  .result__top {
    grid-template-columns: 89px 1fr;
    grid-template-rows: 44px 26px 1fr;
  }

  #result img {
    width: 70px;
    height: 70px;
  }

  .middle {
    margin-top: 0;
  }

  // Bottom part

  .result__bottom {
    margin-top: 23px;
  }

  .activity {
    @include flex(space-between);
    padding: 0 15px;
    text-align: center;
  }

  .activity__data {
    margin-right: 0;
  }

  .social {
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    margin-top: 24px;
  }
}

/ styles:
style.css:

@import url("https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap");

:root {
  --font: "Space Mono", monospace;
  --background: rgb(246, 248, 255);
  --component-background: rgb(254, 254, 254);
  --title: rgb(43, 52, 66);
  --text: rgb(75, 106, 155);
  --third: rgb(105, 124, 154);
  --white: rgb(255, 255, 255);
  --shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  --bigShadow: 0 16px 30px -10px rgba(70, 96, 187, 0.2);
  --colorMode: rgb(43, 52, 66);
  --secondary: rgb(0, 121, 255);
  --btn-hover: rgb(96, 171, 255);
  --error: rgb(247, 70, 70);
}

.darkMode {
  --background: rgb(20, 29, 47);
  --component-background: rgb(30, 42, 71);
  --title: rgb(255, 255, 255);
  --text: rgb(255, 255, 255);
  --third: rgb(255, 255, 255);
  --shadow: none;
  --bigShadow: none;
  --colorMode: rgb(144, 164, 212);
}

*,
::before,
::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
  margin: auto 20%;
  font-family: var(--font);
  background-color: var(--background);
}

h1 {
  color: var(--title);
  font-weight: bold;
  font-size: 26px;
  line-height: 38px;
}

h2 {
  color: var(--secondary);
  font-weight: normal;
  font-size: 16px;
  line-height: 24px;
}

h3 {
  color: var(--text);
  font-weight: normal;
  font-size: 13px;
  line-height: 20px;
}

h4 {
  color: var(--title);
  font-weight: bold;
  font-size: 22px;
  line-height: 33px;
}

p {
  color: var(--text);
  font-weight: normal;
  font-size: 15px;
  line-height: 25px;
}

a {
  color: var(--text);
  font-weight: normal;
  font-size: 15px;
  line-height: 25px;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media all and (max-width: 1200px) {
  body {
    margin: 20px 10%;
  }
}

@media all and (max-width: 625px) {
  body {
    margin: 30px 24px;
  }

  h1 {
    font-size: 16px;
    line-height: 28px;
  }

  h2 {
    font-size: 13px;
    line-height: 15px;
  }

  h3 {
    font-size: 11px;
    line-height: 18px;
  }

  h4 {
    font-size: 16px;
    line-height: 27px;
  }

  p {
    font-size: 13px;
    line-height: 23px;
  }

  a {
    font-size: 13px;
    line-height: 23px;
  }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 38px;
}

header h1 {
  cursor: pointer;
}

.colorMode {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  padding: 2px;
  transition: 0.2s;
}

.colorMode p {
  color: var(--third);
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2.5px;
}

.colorMode:hover p,
.colorMode:hover path {
  color: var(--colorMode);
  fill: var(--colorMode);
}

.searchBar {
  background-color: var(--component-background);
  border-radius: 15px;
  width: 100%;
  height: 69px;
  display: grid;
  grid-template-columns: 34px 1fr 106px;
  margin: 30px 0;
  padding: 9.5px 10px 9.5px 32px;
  box-shadow: var(--shadow);
}

.searchBar img {
  width: 24px;
  height: 24px;
  margin-top: 14px;
}

#textInput {
  font-family: var(--font);
  color: var(--title);
  caret-color: var(--secondary);
  background-color: var(--component-background);
  font-size: 18px;
  border: none;
  width: 100%;
  height: 50px;
}

#textInput:focus {
  outline: none;
}

#textInput::placeholder {
  font-family: var(--font);
  color: var(--text);
  font-size: 18px;
  letter-spacing: -1px;
}

.searchBar .error {
  display: none;
  color: var(--error);
  font-size: 15px;
  font-weight: bold;
  margin-top: 13px;
}

.searchBar button {
  color: var(--white);
  background-color: var(--secondary);
  font-size: 16px;
  font-weight: bold;
  width: 100%;
  height: 50px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: 0.2s;
}

.searchBar button:hover {
  background-color: var(--btn-hover);
}

.searchBar button:active {
  scale: 0.95;
}

#result {
  background-color: var(--component-background);
  border-radius: 15px;
  box-shadow: var(--bigShadow);
  padding: 48px 38px 48px 58px;
  width: 100%;
}

.result__top {
  display: grid;
  grid-template-columns: 154px 280px 1fr;
  grid-template-rows: 64px 53px;
}

#result img {
  width: 117px;
  height: 117px;
  clip-path: circle();
}

.middle h2 {
  margin-top: 2px;
}

.bio {
  color: var(--text);
  grid-column: 2/4;
  margin-top: 20px;
}

.right {
  color: var(--third);
  grid-row: 1;
  grid-column: 3;
  margin-top: 8px;
  text-align: end;
}

.result__bottom {
  display: grid;
  grid-template-rows: 85px 1fr;
  margin-top: 32px;
  margin-left: 154px;
}

.activity {
  background-color: var(--background);
  border-radius: 10px;
  display: flex;
  justify-content: none;
  align-items: center;
  padding: 0 32px;
}

.activity__data {
  margin-right: 25%;
}

.social {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 19px;
  margin-top: 37px;
  color: var(--text);
}

.social__link {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-right: 20px;
}

.social__link a {
  text-decoration: none;
  cursor: pointer;
}

@media all and (max-width: 1200px) {
  .searchBar {
    grid-template-columns: 34px 1fr 106px;
  }

  #result {
    padding: 40px;
  }

  .result__top {
    grid-template-columns: 154px 1fr;
    grid-template-rows: 77px 40px 1fr;
  }

  .middle {
    margin-top: 12px;
  }

  .middle h2 {
    margin-top: 0;
  }

  .bio {
    grid-column: 1/3;
    margin-top: 24px;
  }

  .right {
    grid-row: 2;
    grid-column: 2;
    margin-top: 4px;
    text-align: start;
  }

  .result__bottom {
    margin-left: 0;
  }

  .social {
    margin-top: 30px;
  }

  .social__link {
    margin-right: 0;
  }
}

@media all and (max-width: 625px) {
  header h1 {
    font-size: 26px;
  }

  .searchBar {
    grid-template-columns: 30px 1fr 84px;
    height: 60px;
    padding: 6.5px 7px 7.5px 16px;
  }

  .searchBar img {
    width: 20px;
    height: 20px;
  }

  #textInput {
    font-size: 13px;
    height: 46px;
  }

  #textInput::placeholder {
    font-size: 13px;
  }

  .searchBar button {
    font-size: 14px;
    height: 46px;
  }

  #result {
    padding: 32px 24px;
  }

  .result__top {
    grid-template-columns: 89px 1fr;
    grid-template-rows: 44px 26px 1fr;
  }

  #result img {
    width: 70px;
    height: 70px;
  }

  .middle {
    margin-top: 0;
  }

  .result__bottom {
    margin-top: 23px;
  }

  .activity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    text-align: center;
  }

  .activity__data {
    margin-right: 0;
  }

  .social {
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    margin-top: 24px;
  }
}

style.css.map:

vedi GitHub

index.html:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="description" content="GitHub user search app - Search for GitHub users easily with devfinder." />
  <meta name="keywords" content="GitHub, user search, devfinder, search app, GitHub users" />
  <link rel="icon" type="image/png" sizes="32x32" href="./assets/images/favicon-32x32.png" />
  <link href="assets/styles/style.css" rel="stylesheet" />
  <script src="assets/js/script.js" type="module"></script>
  <script src="assets/js/darkMode.js" defer></script>
  <title>GitHub tool</title>
</head>
<body>
  <header>
    <h1>GitHub tool, cerca un nickname!</h1>
    <div class="colorMode">
      <p>Dark</p>
      <svg width="20" height="20" xmlns="http://www.w3.org/2000/svg">
        <path d="M19.513 11.397a.701.701 0 00-.588.128 7.496 7.496 0 01-2.276 1.336 7.101 7.101 0 01-2.583.462 7.505 7.505 0 01-5.32-2.209 7.568 7.568 0 01-2.199-5.342c0-.873.154-1.72.41-2.49a6.904 6.904 0 011.227-2.21.657.657 0 00-.102-.924.701.701 0 00-.589-.128C5.32.61 3.427 1.92 2.072 3.666A10.158 10.158 0 000 9.83c0 2.8 1.125 5.342 2.967 7.19a10.025 10.025 0 007.16 2.98c2.353 0 4.527-.822 6.266-2.183a10.13 10.13 0 003.58-5.624.623.623 0 00-.46-.796z" fill="var(--third)" fill-rule="nonzero" />
      </svg>
    </div>
  </header>
  <main>
    <div class="searchBar">
      <img src="assets/images/icon-search.svg" alt="Search icon" />
      <label for="textInput">
        <input type="text" id="textInput" name="textInput" maxlength="25" placeholder="Cerca il nickname..." />
      </label>
      <button>Cerca</button>
      <p class="error">No results</p>
    </div>
    <section id="result">
      <div class="result__top">
        <div class="left"></div>
        <div class="middle"></div>
        <div class="bio"></div>
        <div class="right"></div>
      </div>
      <div class="result__bottom">
        <div class="activity">
          <div class="activity__data">
            <h3>Repos</h3>
          </div>
          <div class="activity__data">
            <h3>Followers</h3>
          </div>
          <div class="activity__data">
            <h3>Following</h3>
          </div>
        </div>
        <div class="social">
          <div class="social__link">
            <svg height="20" width="20" xmlns="http://www.w3.org/2000/svg">
              <path d="M12.797 3.425C11.584 1.33 9.427.05 7.03.002a7.483 7.483 0 00-.308 0C4.325.05 2.17 1.33.955 3.425a6.963 6.963 0 00-.09 6.88l4.959 9.077.007.012c.218.38.609.606 1.045.606.437 0 .828-.226 1.046-.606l.007-.012 4.96-9.077a6.963 6.963 0 00-.092-6.88zm-5.92 5.638c-1.552 0-2.813-1.262-2.813-2.813s1.261-2.812 2.812-2.812S9.69 4.699 9.69 6.25 8.427 9.063 6.876 9.063z" fill="#4b6a9b" />
            </svg>
          </div>
          <div class="social__link">
            <svg height="18" width="20" xmlns="http://www.w3.org/2000/svg">
              <path d="M20 2.799a8.549 8.549 0 01-2.363.647 4.077 4.077 0 001.804-2.266 8.194 8.194 0 01-2.6.993A4.099 4.099 0 009.75 4.977c0 .324.027.637.095.934-3.409-.166-6.425-1.8-8.452-4.288a4.128 4.128 0 00-.56 2.072c0 1.42.73 2.679 1.82 3.408A4.05 4.05 0 01.8 6.598v.045a4.119 4.119 0 003.285 4.028 4.092 4.092 0 01-1.075.135c-.263 0-.528-.015-.776-.07.531 1.624 2.038 2.818 3.831 2.857A8.239 8.239 0 01.981 15.34 7.68 7.68 0 010 15.285a11.543 11.543 0 006.29 1.84c7.545 0 11.67-6.25 11.67-11.667 0-.182-.006-.357-.015-.53A8.18 8.18 0 0020 2.798z" fill="#4b6a9b" />
            </svg>
          </div>
          <div class="social__link">
            <svg height="20" width="20" xmlns="http://www.w3.org/2000/svg">
              <g fill="#4b6a9b">
                <path d="M7.404 5.012c-2.355 2.437-1.841 6.482.857 8.273.089.06.207.048.283-.027.568-.555 1.049-1.093 1.47-1.776a.213.213 0 00-.084-.3A2.743 2.743 0 018.878 10.1a2.64 2.64 0 01-.223-1.803c.168-.815 1.043-1.573 1.711-2.274l-.004-.002 2.504-2.555a2.568 2.568 0 013.648-.019 2.6 2.6 0 01.037 3.666l-1.517 1.56a.266.266 0 00-.06.273c.35 1.012.435 2.44.201 3.519-.006.03.031.05.053.028l3.228-3.295c2.062-2.105 2.044-5.531-.04-7.615a5.416 5.416 0 00-7.691.04L7.417 4.998l-.013.014z" />
                <path d="M13.439 13.75a.401.401 0 00.006-.003c.659-1.204.788-2.586.48-3.933l-.002.002-.001-.001a5.434 5.434 0 00-2.19-3.124.3.3 0 00-.333.015c-.553.448-1.095 1.021-1.452 1.754a.243.243 0 00.096.317c.415.24.79.593 1.04 1.061h.001c.196.33.388.958.263 1.632-.116.894-1.019 1.714-1.736 2.453-.546.559-1.935 1.974-2.49 2.542a2.6 2.6 0 01-3.666.037 2.6 2.6 0 01-.038-3.666l1.521-1.564A.266.266 0 005 11.004c-.338-1.036-.43-2.432-.217-3.51.006-.03-.031-.049-.053-.027l-3.179 3.245c-2.083 2.126-2.066 5.588.04 7.693 2.125 2.083 5.57 2.048 7.653-.078.723-.81 3.821-3.678 4.195-4.577z" />
              </g>
            </svg>
          </div>
          <div class="social__link">
            <svg height="20" width="20" xmlns="http://www.w3.org/2000/svg">
              <g fill="#4b6a9b">
                <path d="M10.858 1.558L1.7.167A1.477 1.477 0 00.517.492 1.49 1.49 0 000 1.608v17.559c0 .458.375.833.833.833h2.709v-4.375c0-.808.65-1.458 1.458-1.458h2.083c.809 0 1.459.65 1.459 1.458V20h3.541V3a1.46 1.46 0 00-1.225-1.442zM4.583 12.292h-1.25a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm0-2.5h-1.25a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm0-2.5h-1.25a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm0-2.5h-1.25a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm4.167 7.5H7.5a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm0-2.5H7.5a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm0-2.5H7.5a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm0-2.5H7.5a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zM18.85 9.035l-5.933-1.242V20h5.625A1.46 1.46 0 0020 18.542V10.46c0-.688-.47-1.274-1.15-1.425zM16.875 17.5h-1.25a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm0-2.5h-1.25a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25zm0-2.5h-1.25a.625.625 0 010-1.25h1.25a.625.625 0 010 1.25z" />
              </g>
            </svg>
          </div>
        </div>
      </div>
    </section>
  </main>
</body>
</html>

Powered by: FreeFlarum.
(remove this footer)