body { background-color: darkslateblue; font-family: Ubuntu; } nav { background-color: none; font-weight: 600; } h1 { margin-top: 2%; color: white; } p1 { color: white; } #logo{ animation: floatLogo 5s ease-in-out infinite; } @keyframes floatLogo{ 0%{ transform: translate(0,0%); } 50%{ transform: translate(0, 10%); } 100%{ transform: translate(0, 0%); } } .darkMode { background-color: black; background: linear-gradient(90deg, rgba(67,67,67,1) 0%, rgba(0,0,0,1) 100%); transition: 1s; } .switch { position: relative; display: inline-block; margin-right: 3vw; width: 45px; height: 20px; border-radius: 20px; transition: 1s; } .switch input { opacity: 0; width: 0; height: 0; } .slider { position: absolute; cursor: pointer; background-color: rgb(225, 255, 255, 0.5); -webkit-transition: 1s; transition: 1s; width: 45px; height: 20px; } .slider:before { position: absolute; content: ""; height: 20px; width: 20px; background-image: url("/img/sun.png"); background-repeat: no-repeat; background-size: 17px 17px; background-position-x: center; background-position-y: center; background-color: ghostwhite; -webkit-transition: 1s; transition: 1s; } input:checked + .slider { background-color: rgba(255, 215, 0, 0.5); color: rgb(255, 196, 0); } input:checked + .slider:before { background-color: rgb(73, 43, 226); background-image: url("/img/moon.png"); background-repeat: no-repeat; background-size: 13px 13px; background-position-x: center; background-position-y: center; -webkit-transition: 1s; transition: 1s; } input:checked + .slider:before { -webkit-transform: translateX(26px); -ms-transform: translateX(26px); transform: translateX(26px); } .slider.round { border-radius: 34px; } .slider.round:before { border-radius: 50%; }