Keep Calm and Carry On Coding - Solved

In this example below you will see how to do a Keep Calm and Carry On Coding - Solved with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by 101Computing, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright 101Computing ©
  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Keep Calm and Carry On Coding - Solved</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div id="poster" class="poster">
<img id="icon" src="http://www.101computing.net/wp/wp-content/uploads/Keep-calm-and-carry-on-crown.png" width="130">
<p>
<span>Keep</span>
<span>Calm</span>
<span class="and">and</span>
<span class="message" id="message">Carry on Coding</span>
</p>
</div>

<center><input type="button" value="Change Text" onClick="JavaScript: changeText();"></center>

<center><input type="button" value="Blue" onClick="JavaScript: changeColor('#3050D0');"><input type="button" value="Yellow" onClick="JavaScript: changeColor('#CEC110');"><input type="button" value="Orange" onClick="JavaScript: changeColor('#ED3300');"><input type="button" value="Red" onClick="JavaScript: changeColor('#DB0000');"></center>


<center><input type="button" value="Crown Logo" onClick="JavaScript: changePicture('http://www.101computing.net/wp/wp-content/uploads/Keep-calm-and-carry-on-crown.png');"><input type="button" value="HTML Logo" onClick="JavaScript: changePicture('http://www.101computing.net/wp/wp-content/uploads/HTML-icon.png');"><input type="button" value="CSS Logo" onClick="JavaScript: changePicture('http://www.101computing.net/wp/wp-content/uploads/CSS-icon.png');"><input type="button" value="JavaScript Logo" onClick="JavaScript: changePicture('http://www.101computing.net/wp/wp-content/uploads/Javascript-icon.png');"></center>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/101Computing/keep-calm-and-carry-on-coding-solved-XePNOR */
body {
  background-color: #FFFFFF;
  color: #FFFFFF;
  text-align: center;
  font-family: "Gill Sans", "Gill Sans MT", "Arial";
}

.poster {
  background-color: #db0000;
  margin: 10px auto;
  max-width: 350px;
  padding: 30px 10px;
  border: 5px double #FFFFFF;
}

.poster p {
  font-size: 60px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 30px;
  margin-bottom: 0;
}

.poster p span {
  display: block;
}

.poster p span.and {
  font-size: 50%;
}

.poster p span.message {
  font-size: 100%;
}

/*Downloaded from https://www.codeseek.co/101Computing/keep-calm-and-carry-on-coding-solved-XePNOR */
function changeText() {
  var text;
  text=prompt("Type a message (e.g. Carry On):");
  document.getElementById("message").innerHTML=text;
}

function changeColor(colorCode) {
  document.getElementById("poster").style.backgroundColor = colorCode;
}

function changePicture(url) {
  document.getElementById("icon").src = url;
}

Comments