Skip to content

Instantly share code, notes, and snippets.

@tstelzer
Created September 14, 2019 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstelzer/fe3bc0a287adf22b3f57408f8e3c77e6 to your computer and use it in GitHub Desktop.
Save tstelzer/fe3bc0a287adf22b3f57408f8e3c77e6 to your computer and use it in GitHub Desktop.
intro-web-programming
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="description">
<meta name="author" content="Timm Stelzer">
<link rel="stylesheet" href="./styles.css">
<title>A Dungeons and Dragons Character Sheet</title>
</head>
<body>
<main>
<h1>D&D<br />Adventures<br />League</h1>
<div class='layout-container'>
<form>
<input name="character-name" type="text" placeholder="Bob">
<label for="character-name">Character Name</label>
</form>
<form>
<select id="class">
<option value="rogue">Rogue</option>
<option value="cleric">Cleric</option>
<option value="barbarian">Barbarian</option>
</select>
<label for="class">Class</label>
</form>
<form>
<input name="level" type="number" placeholder="1">
<label for="level">Level</label>
</form>
<form>
<input name="alignment" type="text" placeholder="True Neutral">
<label for="alignment">Alignment</label>
</form>
<form>
<input type="checkbox">
<input type="number">
<label>Acrobatics</label>
</form>
</div>
</main>
<script src="./index.js"></script>
</body>
</html>
let yourName = 'Benni';
let characterLabel = document.querySelectorAll('form')[2].children[1];
let characterLevelInput = document.querySelectorAll('form')[2].children[0]
characterLabel.innerText = "Character Level";
characterLevelInput.addEventListener('change', ({target: {value}}) => {
let theCurrentValue = value;
console.log('the current value is ' + theCurrentValue);
})
@page {
size: A4;
margin: 0;
}
html {
width: 210mm;
height: 297mm;
margin: 0;
border: 1px solid gray;
}
main {
max-width: 480px;
margin: 0 auto;
display: flex;
justify-content: space-between;
}
h1 {
font-size: 18px;
margin: 10px;
}
input, select {
margin-top: 1rem;
}
select {
width: 100%;
background: white;
color: #5a5a5a;
}
label {
display: block;
color: #5a5a5a;
}
.bg-red { background-color: red; }
.c-yellow { color: yellow; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment