messenger/test.html
sairaj mote 8e4c1ca9a6 v0.25.73
Fix (user): issue with touch and hold where even after moving finger it would register long press

Fix (user): default selected color wouldn't show up when app first loaded
2021-02-05 18:42:39 +05:30

39 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/main.min.css">
</head>
<body data-theme="dark">
<script src="scripts/components.js"></script>
<script src="scripts/script.js"></script>
<color-grid id="color_grid"></color-grid>
<sm-input id="my_input"></sm-input>
<script>
const colors = ['#ff0000', '#ff7500', '#ffa500', '#ff0465', '#ff0048', '#ff0040', '#ff00d4']
const themeSelector = document.getElementById('color_grid')
themeSelector.colors = colors
document.addEventListener('colorselected', e => {
const color = e.detail.value
localStorage.setItem("color", color);
document.body.style.setProperty('--accent-color', color);
})
const myInput = document.getElementById('my_input')
myInput.addEventListener('keydown', function(e) {
if(e.key.match(/[0-9]/)){
if(this.value.trim().length < 6){
console.log('type more')
}
else{
e.preventDefault()
console.log('stop')
}
}
})
</script>
</body>
</html>