A web-based drawing app
git clone git://soophie.de/outline
34
socket.broadcast.emit('cursor', data);35
});36
socket.on('disconnect', function() {37
if(client[socket]) {38
socket.broadcast.emit('cursor', {39
quit: true,40
uuid: client[socket].uuid41
});42
}43
delete client[socket];44
});45
});46
io.on('disconnect', function(socket) {47
if(client[socket]) {48
socket.broadcast.emit('cursor', {49
quit: true,50
uuid: client[socket].uuid51
});52
delete client[socket];42
});43
});44
io.on('disconnect', function(socket) {45
socket.broadcast.emit('cursor', {46
quit: true,47
uuid: client[socket].uuid48
});49
delete client[socket];53
}54
});
4175
bottom: 0;4176
z-index: 99;4177
}4178
.wrapper {4179
width: 100vw;4180
height: 100vh;4181
position: fixed;4182
top: 0;4183
left: 0;4184
right: 0;4185
bottom: 0;4186
display: flex;4187
justify-content: center;4188
align-items: center;4189
background: rgba(0, 0, 0, 0.1);4190
z-index: 99999;4191
user-select: none;4192
}4193
.modal {4194
background: white;4195
width: 400px;4196
border-radius: 6px;4197
margin-top: -100px;4198
padding: 20px;4199
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.03);4200
}4201
.modal input.action-uuid,4202
.modal input.action-file {4203
padding: 12px 14px;4204
width: 100%;4205
border: none;4206
background: #FAFAFA;4207
border-radius: 3px;4208
font-size: 16px;4209
user-select: none;4210
}4211
.modal input.action-uuid:hover,4212
.modal input.action-file:hover {4213
background: #F8F8F8;4214
}4215
.modal input.action-uuid:focus,4216
.modal input.action-file:focus {4217
background: #F5F5F5;4218
}4219
.modal .seperator {4220
border-top: 1px solid #F5F5F5;4221
margin: 20px 0;4222
}4223
.modal .align {4224
display: flex;4225
justify-content: space-between;4226
align-items: center;4227
}4228
.modal p {4229
font-size: 18px;4230
letter-spacing: 0.2px;4231
padding-top: 5px;4232
margin-bottom: 25px;4233
}4234
.modal button {4235
padding: 12px 14px;4236
border: none;4237
background: #F8F9FA;4238
border-radius: 3px;4239
font-size: 16px;4240
cursor: pointer;4241
user-select: none;4242
transition: background 0.1s;4243
color: #212121;4244
}4245
.modal button:hover {4246
background: #e9ecef;4247
}4248
.modal button.success {4249
background: #28A745;4250
color: white;4251
}4252
.modal button.success:hover {4253
background: #23923c;4254
}4255
.modal button.danger {4256
background: #DC3545;4257
color: white;4258
}4259
.modal button.danger:hover {4260
background: #d32535;4261
}4262
.modal button.info {4263
background: #007BFF;4264
color: white;4265
}4266
.modal button.info:hover {4267
background: #006fe6;4268
}4269
.modal button.action-join {4270
width: 100%;4271
}4272
.modal button.action-cancel {4273
width: calc(50% - 10px);4274
}4275
.modal button.action-save,4276
.modal button.action-clear,4277
.modal button.action-background,4278
.modal button.action-scaling,4279
.modal button.action-color,4280
.modal button.action-default {4281
width: calc(50% - 10px);4282
}4283
.modal ul.avatar-list {4284
display: flex;4285
flex-wrap: wrap;4286
width: 100%;4287
list-style-type: none;4288
}4289
.modal ul.avatar-list li.avatar {4290
background: #EEE;4291
border-radius: 9999px;4292
border: 5px solid white;4293
margin: 10px;4294
width: 70px;4295
height: 70px;4296
cursor: pointer;4297
transition: border-color 0.1s;4298
}4299
.modal ul.avatar-list li.avatar:hover {4300
border: 5px solid #F8F8F8;4301
}4302
.modal input.action-range {4303
width: calc(100% - 80px);4304
-webkit-appearance: none;4305
background: #F8F8F8;4306
height: 6px;4307
}4308
.modal input.action-range:hover {4309
background: #F5F5F5;4310
}4311
.modal input.action-range:hover::-webkit-slider-thumb {4312
background: #555555;4313
}4314
.modal input.action-range::-webkit-slider-thumb {4315
-webkit-appearance: none;4316
background: #888888;4317
width: 20px;4318
height: 20px;4319
border-radius: 9999px;4320
border: none;4321
cursor: pointer;4322
transition: background 0.1s;4323
}4324
.modal input.action-range::-webkit-slider-runnable-track {4325
-webkit-appearance: none;4326
}4327
.modal .preview {4328
width: 60px;4329
height: 60px;4330
background: #F5F5F5;4331
border-radius: 9999px;4332
display: flex;4333
justify-content: center;4334
align-items: center;4335
}4336
.modal .preview .circle {4337
width: 12px;4338
height: 12px;4339
background: #212121;4340
border-radius: 9999px;4341
}4342
.modal.modal-color {4343
width: 580px;4344
}4345
.modal.modal-color .align {4346
width: calc(100% - 200px);4347
margin-left: 200px;4348
}4349
.modal ul.bucket-list {4350
display: flex;4351
flex-wrap: wrap;4352
width: 100%;4353
list-style-type: none;4354
}4355
.modal ul.bucket-list li.bucket {4356
background: #EEE;4357
border-radius: 9999px;4358
margin: 10px;4359
width: 70px;4360
height: 70px;4361
cursor: pointer;4362
transition: transform 0.2s;4363
box-shadow: 0 0px 8px 2px rgba(0, 0, 0, 0.05);4364
transform: scale(0.9);4365
user-select: none;4366
}4367
.modal ul.bucket-list li.bucket:hover {4368
transition: transform 0.2s;4369
transform: scale(1);4370
}4371
.modal ul.bucket-list li.bucket.focused {4372
transform: scale(1.1);4373
}4374
.modal ul.bucket-list li.bucket::after {4375
position: absolute;4376
bottom: -20%;4377
}4378
.toolbar {4379
position: fixed;4380
left: calc(50% - 360px);4381
bottom: 30px;4382
z-index: 2;4383
display: flex;4384
z-index: 999;4385
}4386
.toolbar .bucket {4387
width: 56px;
4409
display: flex;4410
}4411
.action {4412
user-select: none;4413
position: relative;4414
width: 46px;4415
height: 46px;
4421
position: fixed;4422
margin-right: 8px;4423
}4424
.action i {4425
color: #212121;4426
user-select: none;4427
pointer-events: none;4428
}4429
.action:hover {4430
background: #ECECEC;4431
}4432
.action::after {4433
bottom: -60%;4434
}4228
/* Tooltip */4435
.tooltip {4436
position: relative;4437
display: flex;
4459
border-radius: 4px;4460
font-size: 12px;4461
top: auto;4256
bottom: -90%;4462
bottom: -70%;4463
white-space: nowrap;4464
z-index: 9999;4465
pointer-events: none;
23
<button class="action action-background tooltip" data-title="Background">24
<i class="ico">format_paint</i>25
</button>26
<button class="action action-scaling tooltip" data-title="Scaling">27
<i class="ico">bubble_chart</i>28
</button>29
<button class="action action-clear tooltip" data-title="Clear">30
<i class="ico">delete</i>31
</button>29
<button class="action action-screenshot tooltip" data-title="Screenshot">30
<i class="ico">fullscreen</i>32
<button class="action action-save tooltip" data-title="Save">33
<i class="ico">save</i>34
</button>35
</div>36
</div>37
<div class="wrapper">38
<div class="modal modal-join" style="display: none;">39
<input type="text" class="action-uuid" maxlength="20" spellcheck="false" autocomplete="off" placeholder="Choose a custom name">40
<div class="seperator"></div>41
<ul class="avatar-list">42
<li class="avatar"></li>43
<li class="avatar"></li>44
<li class="avatar"></li>45
<li class="avatar"></li>46
<li class="avatar"></li>47
<li class="avatar"></li>48
<li class="avatar"></li>49
<li class="avatar"></li>50
</ul>51
<div class="seperator"></div>52
<button type="button" class="action-join success">Join</button>53
</div>54
<div class="modal modal-save" style="display: none;">55
<input type="text" class="action-file" maxlength="40" spellcheck="false" autocomplete="off" placeholder="Choose a file name">56
<div class="seperator"></div>57
<div class="align">58
<button type="button" class="action-cancel">Cancel</button>59
<button type="button" class="action-save info">Save</button>60
</div>61
</div>62
<div class="modal modal-clear" style="display: none;">63
<p>Do you want to clear the screen?</p>64
<div class="align">65
<button type="button" class="action-cancel">Cancel</button>66
<button type="button" class="action-clear danger">Clear</button>67
</div>68
</div>69
<div class="modal modal-background" style="display: none;">70
<p>Do you want to change the background?</p>71
<div class="align">72
<button type="button" class="action-cancel">Cancel</button>73
<button type="button" class="action-background info">Change</button>74
</div>75
</div>76
<div class="modal modal-scaling" style="display: none;">77
<div class="align">78
<input type="range" min="1" max="15" value="3" step="0.5" class="action-range">79
<div class="preview">80
<div class="circle"></div>81
</div>82
</div>83
<div class="seperator"></div>84
<div class="align">85
<button type="button" class="action-cancel">Cancel</button>86
<button type="button" class="action-scaling info">Change</button>87
</div>88
</div>89
<div class="modal modal-color" style="display: none;">90
<ul class="bucket-list">91
</ul>92
<div class="seperator"></div>93
<div class="align">94
<button type="button" class="action-default">Reset default</button>95
<button type="button" class="action-color info">Apply</button>96
</div>97
</div>98
</div>99
</body>100
</html>
1
let env = {2
drag: false,3
last: null,4
color: 'black',4
color: '#000000',5
radius: 3,6
bucket: [7
{ name: 'Black', code: '#000000', active: true },
15
{ name: 'Purple', code: '#800080' },16
{ name: 'Bisque', code: '#FFE4C4' }17
],18
colorlist: [19
{ name: 'Pink', code: '#FFC0CB' },20
{ name: 'Violet', code: '#EE82EE' },21
{ name: 'Magenta', code: '#FF00FF' },22
{ name: 'Red', code: '#FF0000' },23
{ name: 'Orange', code: '#D2691E' },24
{ name: 'Gold', code: '#FFD700' },25
{ name: 'Yellow', code: '#FFFF00' },26
{ name: 'Lime', code: '#00FF00' },27
{ name: 'Green', code: '#00FF00' },28
{ name: 'Teal', code: '#008080' },29
{ name: 'Cyan', code: '#00FFFF' },30
{ name: 'Aquamarine', code: '#7FFFD4' },31
{ name: 'Blue', code: '#0000FF' },32
{ name: 'Navy', code: '#000080' },33
{ name: 'Cornsilk', code: '#FFF8DC' },34
{ name: 'Bisque', code: '#FFE4C4' },35
{ name: 'Wheat', code: '#F5DEB3' },36
{ name: 'Tan', code: '#D2B48C' },37
{ name: 'Peru', code: '#CD853F' },38
{ name: 'Olive', code: '#808000' },39
{ name: 'Sinna', code: '#A0522D' },40
{ name: 'Brown', code: '#A52A2A' },41
{ name: 'Maroon', code: '#800000' },42
{ name: 'Silver', code: '#C0C0C0' },43
{ name: 'Black', code: '#000000' },44
{ name: 'White', code: '#FFFFFF' }45
],46
socket: null,47
cursor: { x: 0, y: 0 },48
client: {},21
uuid: window.location.search.substr(6)49
uuid: null,50
name: null51
};53
let canvas;
58
window.addEventListener('load', function(event) {31
console.log(env.uuid);60
open('join');62
canvas = document.querySelector('.canvas');63
canvas.draggable = true;
69
env.bucket.forEach(function(item) {70
let template = document.createElement('template');42
template.innerHTML = `<div class="bucket tooltip up${item.active ? ' focused' : ''}" data-title="${item.name}" style="background: ${item.code}"></div>`;71
template.innerHTML = `<div class="bucket tooltip up${item.active ? ' focused' : ''}" data-title="${item.name}" data-color="${item.code}" style="background: ${item.code}"></div>`;72
document.querySelector('.toolbar').append(template.content.cloneNode(true));73
});75
env.colorlist.forEach(function(item) {76
let template = document.createElement('template');77
template.innerHTML = `<li class="bucket tooltip" data-title="${item.name}" data-color="${item.code}" style="background: ${item.code}"></li>`;78
document.querySelector('.modal.modal-color ul.bucket-list').append(template.content.cloneNode(true));79
});81
canvas.addEventListener('dragstart', function(event) {82
event.preventDefault();83
});
92
env.last = pos;93
}94
});95
canvas.addEventListener('touchmove', function(event) {96
if(env.drag) {97
let pos = { x: event.layerX, y: event.layerY };98
send({ pos: pos, last: env.last });99
draw(pos, env.last, env.radius, env.color);100
env.last = pos;101
}102
});103
canvas.addEventListener('mousedown', function(event) {104
env.drag = true;105
let pos = { x: event.layerX, y: event.layerY };106
send({ pos: pos, last: env.last });107
draw(pos, env.last, env.radius, env.color);108
env.last = pos;109
document.querySelector('.toolbar').style.pointerEvents = 'none';110
sendCursor();111
update();112
});113
canvas.addEventListener('touchstart', function(event) {114
env.drag = true;115
let pos = { x: event.layerX, y: event.layerY };116
send({ pos: pos, last: env.last });117
draw(pos, env.last, env.radius, env.color);118
env.last = pos;119
document.querySelector('.toolbar').style.pointerEvents = 'none';120
sendCursor();121
update();122
});124
document.querySelector('.action-join').addEventListener('click', function(event) {125
env.name = document.querySelector('.action-uuid').value;126
if(env.name.length >= 3 && env.name.length <= 20) {127
env.uuid = env.name + '-' + uuidv4();128
close();129
connect();130
sendCursor();131
}132
});134
document.addEventListener('mouseup', function(event) {135
env.drag = false;136
env.last = null;137
document.querySelector('.toolbar').style.pointerEvents = '';138
});139
document.addEventListener('touchend', function(event) {140
document.querySelector('.toolbar').style.pointerEvents = '';141
env.drag = false;142
env.last = null;143
});144
document.addEventListener('wheel', function(event) {73
if(event.deltaY < 0) {74
env.radius += env.radius < 30 ? 0.5 : 0;75
}76
else {77
env.radius -= env.radius > 0.5 ? 0.5 : 0;145
if(document.querySelector('.wrapper').style.display === 'none') {146
if(event.deltaY < 0) {147
env.radius += env.radius < 15 ? 1 : 0;148
}149
else {150
env.radius -= env.radius > 1 ? 1 : 0;151
}152
sendCursor();153
update();154
}79
sendCursor();80
update();155
});156
document.addEventListener('keydown', function(event) {83
if(event.keyCode >= 48 && event.keyCode <= 57) {84
let index = event.keyCode - 49;85
if(index == -1) {86
index = 9;157
if(document.querySelector('.wrapper').style.display === 'none') {158
if(event.keyCode >= 48 && event.keyCode <= 57) {159
let index = event.keyCode - 49;160
if(index == -1) {161
index = 9;162
}163
Array.from(document.querySelectorAll('.bucket'))164
.forEach(function(item, i) {165
if(index == i) {166
env.color = item.dataset.color;167
item.classList.add('focused');168
}169
else {170
item.classList.remove('focused');171
}172
});173
}88
Array.from(document.querySelectorAll('.bucket'))89
.forEach(function(item, i) {90
if(index == i) {91
env.color = item.style.background;92
item.classList.add('focused');93
}94
else {95
item.classList.remove('focused');96
}97
});174
sendCursor();175
update();176
}177
else {178
if(document.querySelector('.modal.modal-join').style.display === 'none') {179
if(event.keyCode == 27) {180
close();181
}182
}183
}184
});185
document.addEventListener('mousemove', function(event) {186
env.cursor = event.target === canvas ? { x: event.layerX, y: event.layerY } : null;187
sendCursor();188
update();189
});102
document.addEventListener('mousemove', function(event) {190
document.addEventListener('touchmove', function(event) {191
env.cursor = event.target === canvas ? { x: event.layerX, y: event.layerY } : null;192
sendCursor();193
update();
203
Array.from(document.querySelectorAll('div.bucket'))204
.forEach(function(item) {117
item.addEventListener('click', function(event) {118
env.color = item.style.background;205
item.addEventListener('mousedown', function(event) {206
env.color = item.dataset.color;207
Array.from(document.querySelectorAll('.bucket'))208
.forEach(function(_item) {209
if(_item != item) {
214
});215
});129
document.querySelector('button.action-clear')217
document.querySelector('.actions button.action-clear')218
.addEventListener('click', function(event) {219
open('clear');220
});222
document.querySelector('.actions button.action-background')223
.addEventListener('click', function(event) {224
open('background');225
});227
document.querySelector('.actions button.action-save')228
.addEventListener('click', function(event) {229
document.querySelector('input.action-file').value = `outline-image-${uuidv4()}`;230
open('save');231
});233
document.querySelector('.actions button.action-scaling')234
.addEventListener('click', function(event) {235
document.querySelector('.modal input.action-range').value = env.radius;236
let circle = document.querySelector('.modal .circle');237
circle.style.width = env.radius * 4 + 'px';238
circle.style.height = env.radius * 4 + 'px';239
open('scaling');240
});242
document.querySelector('.actions button.action-color')243
.addEventListener('click', function(event) {244
open('color');245
});247
Array.from(document.querySelectorAll('button.action-cancel'))248
.forEach(function(item) {249
item.addEventListener('click', function(event) {250
close();251
});252
});254
document.querySelector('.modal button.action-clear')255
.addEventListener('click', function(event) {256
env.socket.emit('clear');257
g.clearRect(0, 0, window.innerWidth, window.innerHeight);258
close();259
});135
document.querySelector('button.action-background')261
document.querySelector('.modal button.action-background')262
.addEventListener('click', function(event) {263
env.socket.emit('background', env.color);264
g.fillStyle = env.color;265
g.fillRect(0, 0, window.innerWidth, window.innerHeight);266
g.fillStyle = 'black';267
close();268
});270
document.querySelector('.modal button.action-save')271
.addEventListener('click', function(event) {272
let file = document.querySelector('.modal input.action-file').value;273
if(file.length >= 3 && file.length <= 40) {274
let link = document.createElement('a');275
link.style.display = 'none';276
link.download = file;277
link.href = canvas.toDataURL('image/png');278
document.body.appendChild(link);279
link.click();280
close();281
}282
});284
document.querySelector('.modal input.action-range')285
.addEventListener('input', function(event) {286
setTimeout(function() {287
let circle = document.querySelector('.modal .circle');288
circle.style.width = event.target.value * 4 + 'px';289
circle.style.height = event.target.value * 4 + 'px';290
}, 10);291
});293
document.querySelector('.modal button.action-scaling')294
.addEventListener('click', function(event) {295
env.radius = parseInt(document.querySelector('.modal input.action-range').value);296
sendCursor();297
update();298
close();299
});301
document.querySelector('.modal button.action-default')302
.addEventListener('click', function(event) {303
close();304
});306
document.querySelector('.modal button.action-color')307
.addEventListener('click', function(event) {308
close();309
});311
resize();144
connect();145
sendCursor();312
});314
function resize() {315
let ctemp = g.getImageData(0, 0, canvas.width, canvas.height);316
canvas.width = window.innerWidth;317
canvas.height = window.innerHeight;318
g.putImageData(ctemp, 0, 0);319
let otemp = o.getImageData(0, 0, overlay.width, overlay.height);320
overlay.width = window.innerWidth;321
overlay.height = window.innerHeight;322
o.putImageData(otemp, 0, 0);323
}325
function connect() {
343
}344
else {345
env.client[data.uuid] = data;346
setTimeout(function() {347
if(env.client[data.uuid]) {348
let last = env.client[data.uuid];349
if(last.cursor && data.cursor) {350
if(last.cursor.x === data.cursor.x && last.cursor.y === data.cursor.y) {351
delete env.client[data.uuid];352
update();353
}354
}355
}356
}, 10 * 1000);357
}358
update();359
});
403
cursor: env.cursor,404
color: env.color,405
radius: env.radius,225
uuid: env.uuid406
name: env.name407
});408
}409
}
415
o.lineWidth = 4;416
o.beginPath();417
o.arc(env.cursor.x, env.cursor.y, 2 * env.radius, 0, 2 * Math.PI);418
o.strokeStyle = dark(env.color) ? 'black' : 'white';419
o.stroke();420
o.beginPath();421
o.arc(env.cursor.x, env.cursor.y, 2 * env.radius, 0, 2 * Math.PI);
428
o.lineWidth = 4;429
o.beginPath();430
o.arc(client.cursor.x, client.cursor.y, 2 * client.radius, 0, 2 * Math.PI);431
o.strokeStyle = dark(client.color) ? 'black' : 'white';432
o.stroke();433
o.beginPath();434
o.arc(client.cursor.x, client.cursor.y, 2 * client.radius, 0, 2 * Math.PI);435
o.fill();253
o.fillStyle = 'black';436
o.fillStyle = '#212121';437
o.font = '14px Roboto';438
o.textBaseline = 'top';439
o.textAlign = 'left';257
let text = o.measureText(client.uuid);258
o.fillRect(client.cursor.x, client.cursor.y, text.width + 12, 24);440
let text = o.measureText(client.name);441
roundRect(o, client.cursor.x, client.cursor.y, text.width + 12, 22, 4);442
o.fillStyle = 'white';260
o.fillText(client.uuid, client.cursor.x + 6, client.cursor.y + 5);443
o.fillText(client.name, client.cursor.x + 6, client.cursor.y + 5);444
}445
}446
}448
function dark(color) {266
let rgb = parseInt(color.substring(1));267
let r = (rgb >> 16) & 0xff;268
let g = (rgb >> 8) & 0xff;269
let b = (rgb >> 9) & 0xff;270
let luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;271
return luma < 40;449
color = color.substr(1);450
let r = parseInt(color.substr(0, 2), 16);451
let g = parseInt(color.substr(2, 4), 16);452
let b = parseInt(color.substr(4, 6), 16);453
return ((r * 0.299) + (g * 0.587) + (b * 0.114)) > 50;454
}456
function open(modal) {457
document.querySelector('.wrapper').style.display = '';458
document.querySelector(`.modal.modal-${modal}`).style.display = '';459
}461
function close() {462
document.querySelector('.wrapper').style.display = 'none';463
Array.from(document.querySelectorAll('.modal'))464
.forEach(function(item) {465
item.style.display = 'none';466
});467
}469
function uuidv4() {470
return 'xxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {471
let r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);472
return v.toString(16);473
});474
}476
function roundRect(g, x, y, w, h, r) {477
if(w < 2 * r) r = w / 2;478
if(h < 2 * r) r = h / 2;479
g.beginPath();480
g.moveTo(x + r, y);481
g.arcTo(x + w, y, x + w, y + h, r);482
g.arcTo(x + w, y + h, x, y + h, r);483
g.arcTo(x, y + h, x, y, r);484
g.arcTo(x, y, x + w, y, r);485
g.fill();486
}
15
z-index: 99;16
}18
.wrapper {19
width: 100vw;20
height: 100vh;21
position: fixed;22
top: 0;23
left: 0;24
right: 0;25
bottom: 0;26
display: flex;27
justify-content: center;28
align-items: center;29
background: rgba(0, 0, 0, 0.1);30
z-index: 99999;31
user-select: none;32
}34
.modal {35
background: white;36
width: 400px;37
border-radius: 6px;38
margin-top: -100px;39
padding: 20px;40
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.03);42
input.action-uuid,43
input.action-file {44
padding: 12px 14px;45
width: 100%;46
border: none;47
background: #FAFAFA;48
border-radius: 3px;49
font-size: 16px;50
user-select: none;52
&:hover {53
background: #F8F8F8;54
}56
&:focus {57
background: #F5F5F5;58
}59
}61
.seperator {62
border-top: 1px solid #F5F5F5;63
margin: 20px 0;64
}66
.align {67
display: flex;68
justify-content: space-between;69
align-items: center;70
}72
p {73
font-size: 18px;74
letter-spacing: 0.2px;75
padding-top: 5px;76
margin-bottom: 25px;77
}79
button {80
padding: 12px 14px;81
border: none;82
background: #F8F9FA;83
border-radius: 3px;84
font-size: 16px;85
cursor: pointer;86
user-select: none;87
transition: background 0.1s;88
color: #212121;90
&:hover {91
background: lighten(#F8F9FA, -5%);92
}94
&.success {95
background: #28A745;96
color: white;98
&:hover {99
background: lighten(#28A745, -5%);100
}101
}103
&.danger {104
background: #DC3545;105
color: white;107
&:hover {108
background: lighten(#DC3545, -5%);109
}110
}112
&.info {113
background: #007BFF;114
color: white;116
&:hover {117
background: lighten(#007BFF, -5%);118
}119
}120
}122
button.action-join {123
width: 100%;124
}126
button.action-cancel {127
width: calc(50% - 10px);128
}130
button.action-save,131
button.action-clear,132
button.action-background,133
button.action-scaling,134
button.action-color,135
button.action-default {136
width: calc(50% - 10px);137
}139
ul.avatar-list {140
display: flex;141
flex-wrap: wrap;142
width: 100%;143
list-style-type: none;145
li.avatar {146
background: #EEE;147
border-radius: 9999px;148
border: 5px solid white;149
margin: 10px;150
width: 70px;151
height: 70px;152
cursor: pointer;153
transition: border-color 0.1s;155
&:hover {156
border: 5px solid #F8F8F8;157
}158
}159
}161
input.action-range {162
width: calc(100% - 80px);163
-webkit-appearance: none;164
background: #F8F8F8;165
height: 6px;167
&:hover {168
background: #F5F5F5;170
&::-webkit-slider-thumb {171
background: lighten(#888888, -20%);172
}173
}175
&::-webkit-slider-thumb {176
-webkit-appearance: none;177
background: #888888;178
width: 20px;179
height: 20px;180
border-radius: 9999px;181
border: none;182
cursor: pointer;183
transition: background 0.1s;184
}186
&::-webkit-slider-runnable-track {187
-webkit-appearance: none;188
}189
}191
.preview {192
width: 60px;193
height: 60px;194
background: #F5F5F5;195
border-radius: 9999px;196
display: flex;197
justify-content: center;198
align-items: center;200
.circle {201
width: 12px;202
height: 12px;203
background: #212121;204
border-radius: 9999px;205
}206
}208
&.modal-color {209
width: 580px;211
.align {212
width: calc(100% - 200px);213
margin-left: 200px;214
}215
}217
ul.bucket-list {218
display: flex;219
flex-wrap: wrap;220
width: 100%;221
list-style-type: none;223
li.bucket {224
background: #EEE;225
border-radius: 9999px;226
margin: 10px;227
width: 70px;228
height: 70px;229
cursor: pointer;230
transition: transform 0.2s;231
box-shadow: 0 0px 8px 2px rgba(0, 0, 0, 0.05);233
transform: scale(0.9);234
user-select: none;236
&:hover {237
transition: transform 0.2s;238
transform: scale(1);239
}241
&.focused {242
transform: scale(1.1);243
}245
&::after {246
position: absolute;247
bottom: -20%;248
}249
}250
}251
}253
.toolbar {254
position: fixed;255
left: calc(50% - 360px);256
bottom: 30px;257
z-index: 2;258
display: flex;259
z-index: 999;261
.bucket {262
width: 56px;
289
}291
.action {292
user-select: none;293
position: relative;294
width: 46px;295
height: 46px;
301
position: fixed;302
margin-right: 8px;304
i {305
color: #212121;306
user-select: none;307
pointer-events: none;308
}310
&:hover {311
background: #ECECEC;312
}
316
}317
}76
/* Tooltip */319
.tooltip {320
position: relative;321
display: flex;
348
border-radius: 4px;349
font-size: 12px;350
top: auto;109
bottom: -90%;351
bottom: -70%;352
white-space: nowrap;353
z-index: 9999;354
pointer-events: none;