Browse Source

Sweet juicy svg cursor

infinite
A.Olokhtonov 2 years ago
parent
commit
ad9cded350
  1. 2
      client/default.css
  2. 50
      client/icons/cursor.svg
  3. 2
      client/index.js
  4. 3
      client/webgl_geometry.js
  5. 6
      client/webgl_shaders.js

2
client/default.css

@ -31,7 +31,7 @@ canvas { @@ -31,7 +31,7 @@ canvas {
width: 100%;
height: 100%;
display: block;
cursor: crosshair;
cursor: url('icons/cursor.svg') 7 7, crosshair;
}
canvas.movemode {

50
client/icons/cursor.svg

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="3.7139902mm"
height="3.7139902mm"
viewBox="0 0 3.7139902 3.7139902"
version="1.1"
id="svg5"
sodipodi:docname="cursor.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="38.057741"
inkscape:cx="6.358759"
inkscape:cy="8.5659315"
inkscape:window-width="2558"
inkscape:window-height="1412"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-133.51747,-126.4196)">
<circle
style="fill:none;stroke:#000000;stroke-width:0.3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path236"
cy="128.2766"
cx="135.37447"
r="1.6" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

2
client/index.js

@ -11,7 +11,7 @@ const config = { @@ -11,7 +11,7 @@ const config = {
buffer_first_touchmoves: 5,
debug_print: true,
min_zoom: 0.05,
max_zoom: 100.0,
max_zoom: 10.0,
initial_offline_timeout: 1000,
default_color: 0x00,
default_width: 8,

3
client/webgl_geometry.js

@ -3,6 +3,9 @@ function push_point(s, x, y, u, v, r, g, b, type) { @@ -3,6 +3,9 @@ function push_point(s, x, y, u, v, r, g, b, type) {
ser_f32(s, y);
ser_f32(s, u);
ser_f32(s, v);
// ser_u8(s, Math.floor(Math.random() * 255));
// ser_u8(s, Math.floor(Math.random() * 255));
// ser_u8(s, Math.floor(Math.random() * 255));
ser_u8(s, r);
ser_u8(s, g);
ser_u8(s, b);

6
client/webgl_shaders.js

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
const stroke_vs_src = `
attribute float a_type;
attribute vec2 a_pos;
attribute vec2 a_texcoord;
attribute vec3 a_color;
attribute vec2 a_pos;
attribute vec2 a_texcoord;
attribute vec3 a_color;
uniform vec2 u_scale;
uniform vec2 u_res;

Loading…
Cancel
Save