Browse Source

Long touch to open color picker details

ssao
A.Olokhtonov 10 months ago
parent
commit
7555de10bf
  1. 1
      client/default.css
  2. 32
      client/index.html
  3. 23
      client/tools.js

1
client/default.css

@ -164,7 +164,6 @@ canvas.mousemoving { @@ -164,7 +164,6 @@ canvas.mousemoving {
transition: var(--transform-amimate);
transform: translateX(calc(-100% + 2 * var(--gap) + 24px));
cursor: pointer;
overflow: hidden;
}
.pallete .color-major.extended {

32
client/index.html

@ -7,22 +7,22 @@ @@ -7,22 +7,22 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="shortcut icon" href="icons/favicon.svg" id="favicon">
<link rel="stylesheet" type="text/css" href="default.css?v=69">
<script type="text/javascript" src="aux.js?v=69"></script>
<script type="text/javascript" src="heapify.js?v=69"></script>
<script type="text/javascript" src="bvh.js?v=69"></script>
<script type="text/javascript" src="math.js?v=69"></script>
<script type="text/javascript" src="tools.js?v=69"></script>
<script type="text/javascript" src="webgl_geometry.js?v=69"></script>
<script type="text/javascript" src="webgl_shaders.js?v=69"></script>
<script type="text/javascript" src="webgl_listeners.js?v=69"></script>
<script type="text/javascript" src="webgl_draw.js?v=69"></script>
<script type="text/javascript" src="index.js?v=69"></script>
<script type="text/javascript" src="client_send.js?v=69"></script>
<script type="text/javascript" src="client_recv.js?v=69"></script>
<script type="text/javascript" src="websocket.js?v=69"></script>
<link rel="stylesheet" type="text/css" href="default.css?v=71">
<script type="text/javascript" src="aux.js?v=71"></script>
<script type="text/javascript" src="heapify.js?v=71"></script>
<script type="text/javascript" src="bvh.js?v=71"></script>
<script type="text/javascript" src="math.js?v=71"></script>
<script type="text/javascript" src="tools.js?v=71"></script>
<script type="text/javascript" src="webgl_geometry.js?v=71"></script>
<script type="text/javascript" src="webgl_shaders.js?v=71"></script>
<script type="text/javascript" src="webgl_listeners.js?v=71"></script>
<script type="text/javascript" src="webgl_draw.js?v=71"></script>
<script type="text/javascript" src="index.js?v=71"></script>
<script type="text/javascript" src="client_send.js?v=71"></script>
<script type="text/javascript" src="client_recv.js?v=71"></script>
<script type="text/javascript" src="websocket.js?v=71"></script>
</head>
<body>
<div class="main">

23
client/tools.js

@ -115,6 +115,29 @@ function init_tools(state) { @@ -115,6 +115,29 @@ function init_tools(state) {
tools.forEach((item) => { item.addEventListener('click', () => switch_tool(state, item)); });
color_groups.forEach((item) => {
item.setAttribute('data-last-color', item.lastElementChild.getAttribute('data-color'));
let longtouch_timer = null;
item.addEventListener('touchstart', (e) => {
longtouch_timer = setTimeout(() => {
extend_major_color(state, item);
}, 500);
});
item.addEventListener('touchmove', (e) => {
if (longtouch_timer) {
clearTimeout(longtouch_timer);
}
longtouch_timer = null;
});
item.addEventListener('touchend', (e) => {
if (longtouch_timer) {
clearTimeout(longtouch_timer);
}
longtouch_timer = null;
});
item.addEventListener('click', (e) => {
if (e.ctrlKey) {
extend_major_color(state, item);

Loading…
Cancel
Save