<commit_before><!DOCTYPE html> <!-- HTML5 -->
<html>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster">
<head>
	<title>Dælenenga Gravity-kalkulator</title>
	<link rel="apple-touch-icon" sizes="114x114" href="gravity/images/icon.png"/>
	<style>
		.w3-lobster {
		  font-family: "Lobster", serif;
		}
		/*Slider formatting*/
		input[type=range] {
			width: 90%; /* Specific width is required for Firefox. */
		}
		input[type=number] {
			width: 50%; /* Specific width is required for Firefox. */
			border: 2px solid teal;
    		border-radius: 4px;
		}
	</style>
	
	<script> 
	function x() {
		document.getElementById('g').value = ((1000 +
			(
				375*parseFloat(document.getElementById('dme').value) +
				270*parseFloat(document.getElementById('lme').value)
			) /
			parseFloat(document.getElementById('vol').value)
			+
			parseFloat(document.getElementById('eff').value) * 
			(
				296*parseFloat(document.getElementById('basis').value) + 
				270*parseFloat(document.getElementById('spes').value)
			) /
			(
				100*parseFloat(document.getElementById('vol').value)
			)
		)/1000).toFixed(3);
	};
	
	function f() {
		
		//var m = $('#m').val();
		
		document.getElementById('m').value = (
			parseFloat(document.getElementById('basis').value) +
			parseFloat(document.getElementById('spes').value) +
			parseFloat(document.getElementById('lme').value) +
			parseFloat(document.getElementById('dme').value) 
		).toFixed(2);
	};
	
	function p() {
		document.getElementById('pbasis').value = ((100*parseFloat(document.getElementById('basis').value)) / document.getElementById('m').value).toFixed(0);
		document.getElementById('pspes').value = ((100*parseFloat(document.getElementById('spes').value)) / document.getElementById('m').value).toFixed(0);
		document.getElementById('plme').value = ((100*parseFloat(document.getElementById('lme').value)) / document.getElementById('m').value).toFixed(0);
		document.getElementById('pdme').value = ((100*parseFloat(document.getElementById('dme').value)) / document.getElementById('m').value).toFixed(0);
	};

	function imp() {
		document.getElementById('lbbasis').value = (parseFloat(document.getElementById('basis').value) * 2.2046).toFixed(1);
		document.getElementById('lbspes').value = (parseFloat(document.getElementById('spes').value) * 2.2046).toFixed(1);
		document.getElementById('lblme').value = (parseFloat(document.getElementById('lme').value) * 2.2046).toFixed(1);
		document.getElementById('lbdme').value = (parseFloat(document.getElementById('dme').value) * 2.2046).toFixed(1);
		document.getElementById('lbtot').value = (parseFloat(document.getElementById('m').value) * 2.2046).toFixed(1);
		document.getElementById('galvol').value = (parseFloat(document.getElementById('vol').value) / 3.7854).toFixed(1);
	};
	
	function fabv() {
		var fg = document.getElementById("fginput").value;
		var og = document.getElementById('g').value;
		var carbo = parseFloat(document.getElementById('carboinput').value);
		/* Simple formula: */
		/* document.getElementById('abv').value = ((og-fg)*131.25).toFixed(1); */
		/* Advanced formula, more accurate for higher abv: */
		document.getElementById('abv').value = ((76.08 * (og-fg) / (1.775-og)) * (fg / 0.794)).toFixed(2);
		var abvx = parseFloat(document.getElementById('abv').value);
		document.getElementById('abvtot').value = (abvx + (carbo / 17.0)).toFixed(2);
	};	

	function temp() {
		var cx = document.getElementById("myRange").value;
		document.getElementById("ctemp").innerHTML = (cx*1 + 0).toFixed(1);
		var fx = (cx*1.8 + 32.0).toFixed(1);
		document.getElementById("ftemp").innerHTML = fx;
	};
	</script>
</head>

<body onload="f(),x(),p(),imp(),fabv(),temp()" class="w3-light-grey">


<!-- <img src="gravity/images/icon.png" align="left"> -->
<div class="w3-container w3-lobster w3-teal w3-xxlarge">
	Dælenenga gravity-kalkulator
</div>

<form oninput="f(),x(),p(),imp(),fabv()">
<table id="calctable" cellpadding="1" class="w3-table">
	<thead>
		<tr class="w3-orange">
			<th>Input</th>
			<th>US-mål</th>
			<th>Andel</th>
		</tr>
	</thead>		
	<tr><td><span class="w3-badge w3-teal">kg</span> <label class="w3-label w3-text-teal"><b>Basismalt</b></label><input class="w3-input w3-round" type="number" id="basis" value="5" step="0.5"></td><td>&nbsp;<output id="lbbasis"></output>lb&nbsp;</td><td><output id="pbasis"></output>%</td></tr>
	
	<tr><td><span class="w3-badge w3-teal">kg</span> <label class="w3-label w3-text-teal"><b>Spesialmalt</b></label><input class="w3-input w3-round" type="number" id="spes" value="0.0" step="0.1"></td><td>&nbsp;<output id="lbspes"></output>lb&nbsp;</td><td><output id="pspes"></output>%</td></tr>
	
	<tr><td><span class="w3-badge w3-teal">kg</span> <label class="w3-label w3-text-teal"><b>Sirup/LME</b></label><input class="w3-input w3-round" type="number" id="lme" value="0.0" step="0.5"><td>&nbsp;<output id="lblme"></output>lb&nbsp;</td><td><output id="plme"></output>%</td></tr>
	
	<tr><td><span class="w3-badge w3-teal">kg</span> <label class="w3-label w3-text-teal"><b>Sukker/DME</b></label><input class="w3-input w3-round" type="number" id="dme" value="0.0" step="0.5"></td><td>&nbsp;<output id="lbdme"></output>lb&nbsp;</td><td>
	<output id="pdme"></output>%</td></tr>
	
	<tr><td><span class="w3-badge w3-teal">L</span> <label class="w3-label w3-text-teal"><b>Volum</b></label><input class="w3-input w3-round" type="number" id="vol" value="23"></td><td><output id="galvol"></output>gal&nbsp;</td><td></td></tr>
	
	<tr><td><span class="w3-badge w3-teal">%</span> <label class="w3-label w3-text-teal"><b>Utbytte</b></label><input class="w3-input w3-round" type="number" id="eff" value="75"></td><td></td><td></tr>
	
	<tr><td>Totalt: <output id="m"></output>kg</td><td><output id="lbtot"></output>lb&nbsp;</td></td><td></tr>
	
	<tr class="w3-orange w3-xlarge"><td><b>OG: <output id="g"></output></b></td></td><td><td></td></tr>

	<tr><td colspan="3">&nbsp;</td></tr>

	<tr><td colspan="1"><span class="w3-badge w3-teal">&nbsp;&nbsp;&nbsp;</span> <label class="w3-label w3-text-teal"><b>FG</b></label><input class="w3-input w3-round" type="number" id="fginput" value="1.010" step="0.001">
	</td><td colspan="2">&nbsp;ABV: <output id="abv"></output>%</td></tr>


	<tr><td><span class="w3-badge w3-teal">g/L</span> <label class="w3-label w3-text-teal"><b>Sukker til karbonering</b></label><input class="w3-input w3-round" type="number" id="carboinput" value="6" step="1"></td><td colspan="2">&nbsp;ABV total: <output id="abvtot"></output>%</td></tr>
		<commit_msg>added abv-calc<commit_after><!DOCTYPE html> <!-- HTML5 -->
<html>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster">
<head>
	<title>Dælenenga Gravity-kalkulator</title>
	<link rel="apple-touch-icon" sizes="114x114" href="gravity/images/icon.png"/>
	<style>
		.w3-lobster {
		  font-family: "Lobster", serif;
		}
		/*Slider formatting*/
		input[type=range] {
			width: 90%; /* Specific width is required for Firefox. */
		}
		input[type=number] {
			width: 50%; /* Specific width is required for Firefox. */
			border: 2px solid teal;
    		border-radius: 4px;
		}
	</style>
	
	<script> 
	function x() {
		document.getElementById('g').value = ((1000 +
			(
				375*parseFloat(document.getElementById('dme').value) +
				270*parseFloat(document.getElementById('lme').value)
			) /
			parseFloat(document.getElementById('vol').value)
			+
			parseFloat(document.getElementById('eff').value) * 
			(
				296*parseFloat(document.getElementById('basis').value) + 
				270*parseFloat(document.getElementById('spes').value)
			) /
			(
				100*parseFloat(document.getElementById('vol').value)
			)
		)/1000).toFixed(3);
	};
	
	function f() {
		
		//var m = $('#m').val();
		
		document.getElementById('m').value = (
			parseFloat(document.getElementById('basis').value) +
			parseFloat(document.getElementById('spes').value) +
			parseFloat(document.getElementById('lme').value) +
			parseFloat(document.getElementById('dme').value) 
		).toFixed(2);
	};
	
	function p() {
		document.getElementById('pbasis').value = ((100*parseFloat(document.getElementById('basis').value)) / document.getElementById('m').value).toFixed(0);
		document.getElementById('pspes').value = ((100*parseFloat(document.getElementById('spes').value)) / document.getElementById('m').value).toFixed(0);
		document.getElementById('plme').value = ((100*parseFloat(document.getElementById('lme').value)) / document.getElementById('m').value).toFixed(0);
		document.getElementById('pdme').value = ((100*parseFloat(document.getElementById('dme').value)) / document.getElementById('m').value).toFixed(0);
	};

	function imp() {
		document.getElementById('lbbasis').value = (parseFloat(document.getElementById('basis').value) * 2.2046).toFixed(1);
		document.getElementById('lbspes').value = (parseFloat(document.getElementById('spes').value) * 2.2046).toFixed(1);
		document.getElementById('lblme').value = (parseFloat(document.getElementById('lme').value) * 2.2046).toFixed(1);
		document.getElementById('lbdme').value = (parseFloat(document.getElementById('dme').value) * 2.2046).toFixed(1);
		document.getElementById('lbtot').value = (parseFloat(document.getElementById('m').value) * 2.2046).toFixed(1);
		document.getElementById('galvol').value = (parseFloat(document.getElementById('vol').value) / 3.7854).toFixed(1);
	};
	
	function fabv() {
		var fg = document.getElementById("fginput").value;
		var og = document.getElementById('g').value;
		var carbo = parseFloat(document.getElementById('carboinput').value);
		/* Simple formula: */
		/* document.getElementById('abv').value = ((og-fg)*131.25).toFixed(1); */
		/* Advanced formula, more accurate for higher abv: */
		document.getElementById('abv').value = ((76.08 * (og-fg) / (1.775-og)) * (fg / 0.794)).toFixed(2);
		var abvx = parseFloat(document.getElementById('abv').value);
		document.getElementById('abvtot').value = (abvx + (carbo / 17.0)).toFixed(2);
	};	

	function temp() {
		var cx = document.getElementById("myRange").value;
		document.getElementById("ctemp").innerHTML = (cx*1 + 0).toFixed(1);
		var fx = (cx*1.8 + 32.0).toFixed(1);
		document.getElementById("ftemp").innerHTML = fx;
	};
	</script>
</head>

<body onload="f(),x(),p(),imp(),fabv(),temp()" class="w3-light-grey">


<!-- <img src="gravity/images/icon.png" align="left"> -->
<div class="w3-container w3-lobster w3-teal w3-xxlarge">
	Dælenenga gravity-kalkulator
</div>

<form oninput="f(),x(),p(),imp(),fabv()">
<table id="calctable" cellpadding="1" class="w3-table">
	<thead>
		<tr class="w3-orange">
			<th>Input</th>
			<th>US-mål</th>
			<th>Andel</th>
		</tr>
	</thead>		
	<tr><td><span class="w3-badge w3-teal">kg</span> <label class="w3-label w3-text-teal"><b>Basismalt</b></label><input class="w3-input w3-round" type="number" id="basis" value="5" step="0.5"></td><td>&nbsp;<output id="lbbasis"></output>lb&nbsp;</td><td><output id="pbasis"></output>%</td></tr>
	
	<tr><td><span class="w3-badge w3-teal">kg</span> <label class="w3-label w3-text-teal"><b>Spesialmalt</b></label><input class="w3-input w3-round" type="number" id="spes" value="0.0" step="0.1"></td><td>&nbsp;<output id="lbspes"></output>lb&nbsp;</td><td><output id="pspes"></output>%</td></tr>
	
	<tr><td><span class="w3-badge w3-teal">kg</span> <label class="w3-label w3-text-teal"><b>Sirup/LME</b></label><input class="w3-input w3-round" type="number" id="lme" value="0.0" step="0.5"><td>&nbsp;<output id="lblme"></output>lb&nbsp;</td><td><output id="plme"></output>%</td></tr>
	
	<tr><td><span class="w3-badge w3-teal">kg</span> <label class="w3-label w3-text-teal"><b>Sukker/DME</b></label><input class="w3-input w3-round" type="number" id="dme" value="0.0" step="0.5"></td><td>&nbsp;<output id="lbdme"></output>lb&nbsp;</td><td>
	<output id="pdme"></output>%</td></tr>
	
	<tr><td><span class="w3-badge w3-teal">L</span> <label class="w3-label w3-text-teal"><b>Volum</b></label><input class="w3-input w3-round" type="number" id="vol" value="23"></td><td><output id="galvol"></output>gal&nbsp;</td><td></td></tr>
	
	<tr><td><span class="w3-badge w3-teal">%</span> <label class="w3-label w3-text-teal"><b>Utbytte</b></label><input class="w3-input w3-round" type="number" id="eff" value="75"></td><td></td><td></tr>
	
	<tr><td>Totalt: <output id="m"></output>kg</td><td><output id="lbtot"></output>lb&nbsp;</td></td><td></tr>
	
	<tr class="w3-orange w3-xlarge"><td><b>OG: <output id="g"></output></b></td></td><td><td></td></tr>

	<tr><td colspan="3">&nbsp;</td></tr>

	<tr><td colspan="1"><span class="w3-badge w3-teal">&nbsp;&nbsp;&nbsp;</span> <label class="w3-label w3-text-teal"><b>FG</b></label><input class="w3-input w3-round" type="number" id="fginput" value="1.010" step="0.001">
	</td><td colspan="2">ABV: <output id="abv"></output>%</td></tr>


	<tr><td><span class="w3-badge w3-teal">g/L</span> <label class="w3-label w3-text-teal"><b>Sukker til karbonering</b></label><input class="w3-input w3-round" type="number" id="carboinput" value="6" step="1"></td><td colspan="2">ABV total: <output id="abvtot"></output>%</td></tr>
		
{'fraction_non_alphanumeric': 0.2399249530956848, 'fraction_numerical': 0.0325703564727955, 'mean_word_length': 5.619970193740685, 'pattern_counts': {'":': 0, '<': 395, '<?xml version=': 0, '>': 395, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5847277', 'n_tokens_mistral': 5269, 'n_tokens_neox': 4803, 'n_words': 635}