A web-based drawing app
git clone git://soophie.de/outline
1
*{margin:0;padding:0;font-family:Roboto,sans-serif;box-sizing:border-box}:focus,:hover{outline:0}html{position:relative;overflow-x:hidden;min-height:100vh}body{width:100%;font-size:14px;min-height:100vh}img{pointer-events:none;user-select:none}input{-webkit-appearance:none}button{user-select:none;cursor:pointer}.hidden{display:none!important}.ico{font-family:'Material Icons';font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:'liga';user-select:none;pointer-events:none}*{-webkit-tap-highlight-color:transparent}body,html{overflow:hidden}#canvas,#overlay,.controls{position:fixed;top:0;left:0;right:0;bottom:0}#overlay{pointer-events:none}.prime-badge{display:inline-block;margin-top:-1px;margin-left:5px;padding:2px 4px;background:#0372EF;border-radius:2px;font-weight:500;font-size:12px;color:#fff!important}.beta-badge{display:inline-block;margin-top:-1px;margin-left:5px;padding:2px 4px;background:#388E3C;border-radius:2px;font-weight:500;font-size:12px;color:#fff!important}.controls{pointer-events:none}.controls .notification{top:30px;position:fixed;display:flex;justify-content:center;width:100%;opacity:0}.controls .notification p{display:inline-block;padding:10px 24px;border-radius:999px;background:#24292E;color:#fff;opacity:.95;user-select:none;pointer-events:none}.controls .ad{position:fixed;width:400px;height:150px;border-radius:4px;background:#EEE;bottom:40px;right:40px;pointer-events:all}.controls .hotbar{display:flex;position:fixed;left:calc(50% - 216px);bottom:30px;pointer-events:all;z-index:-1}.controls .hotbar .color{margin:6px;width:60px;height:60px;border-radius:30px;background:#EEE;cursor:pointer;transition:transform .2s;transform:scale(.9)}.controls .hotbar .color:not(.active):hover{transform:scale(1)}.controls .hotbar .color.focus{transform:scale(1)}.controls .hotbar .color.active{transform:scale(1.1)}.controls .scale-modal{top:40px;left:calc(50% - 200px);width:400px;height:60px}.controls .scale-modal input[type=range]{-webkit-appearance:none;width:calc(400px - 54px);margin-top:21px;margin-left:27px;height:6px;background:#EEE;border:none;border-radius:4px}.controls .scale-modal input[type=range]::-webkit-slider-runnable-track{-webkit-appearance:none}.controls .scale-modal input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:20px;width:20px;margin-top:0;background:#9E9E9E;border-radius:10px;cursor:pointer}.controls .scale-modal input[type=range]::-webkit-slider-thumb:hover{background:#757575}.controls .clear-modal{top:calc(50% - 75px);left:calc(50% - 200px);width:400px;height:150px;display:grid;padding:30px 10px 10px 10px}.controls .clear-modal .text-clear{font-size:20px;width:380px;height:px;text-align:center;align-items:center}.controls .clear-modal .align{display:flex;margin-top:auto}.controls .clear-modal .align .btn-cancel{width:185px;height:50px;border:none;border-radius:3px;background-color:#F5F5F5;font-size:17px}.controls .clear-modal .align .btn-cancel:hover{background-color:#E0E0E0}.controls .clear-modal .align .btn-apply{width:185px;height:50px;border:none;border-radius:3px;border-color:grey;background-color:#F5F5F5;margin-left:10px;font-size:17px}.controls .clear-modal .align .btn-apply:hover{background-color:#E0E0E0}.controls .toolbar{top:20px;left:20px}.controls .actionbar{top:20px;right:20px}.controls .actionbar,.controls .toolbar{display:flex;position:fixed;pointer-events:all}.controls .actionbar .action,.controls .actionbar .tool,.controls .toolbar .action,.controls .toolbar .tool{width:44px;height:44px;padding:10px;margin-left:8px;border-radius:22px;cursor:pointer}.controls .actionbar .action:hover,.controls .actionbar .tool:hover,.controls .toolbar .action:hover,.controls .toolbar .tool:hover{background:rgba(250,250,250,.95)}.controls .actionbar .action:hover.ripple:not(.active).ripple-active,.controls .actionbar .tool:hover.ripple:not(.active).ripple-active,.controls .toolbar .action:hover.ripple:not(.active).ripple-active,.controls .toolbar .tool:hover.ripple:not(.active).ripple-active{background:rgba(245,245,245,.95)}.controls .actionbar .action:hover.ripple.active.ripple-active,.controls .actionbar .tool:hover.ripple.active.ripple-active,.controls .toolbar .action:hover.ripple.active.ripple-active,.controls .toolbar .tool:hover.ripple.active.ripple-active{background:rgba(233,233,233,.95)}.controls .actionbar .action.active,.controls .actionbar .tool.active,.controls .toolbar .action.active,.controls .toolbar .tool.active{background:rgba(238,238,238,.95)}.controls .actionbar .action i.ico,.controls .actionbar .tool i.ico,.controls .toolbar .action i.ico,.controls .toolbar .tool i.ico{color:#424242}.multiplayer-modal{top:75px;right:120px}.account-modal{top:75px;right:70px}.settings-modal{top:75px;right:20px}.device-modal{top:100px;right:320px}.language-modal{top:100px;right:860px}.settings-modal{top:75px;right:20px}.colors-modal{flex-wrap:wrap;width:425px;max-width:425px;min-width:425px;height:860px;padding:30px!important;top:calc(50% - 430px);left:calc(50% - 212.5px)}.colors-modal .color{margin:6px;width:60px;height:60px;border-radius:30px;background:#EEE;cursor:pointer;transition:transform .2s;transform:scale(.9)}.colors-modal .color:not(.active):hover{transform:scale(1)}.colors-modal .color.active{transform:scale(1.1)}.colors-modal .color.focus{transform:scale(1)}.modal{width:250px;position:fixed;background:#fff;border:1px solid #F1F1F1;border-radius:4px;padding:6px 0;pointer-events:all;overflow:hidden;z-index:-1;display:flex}.modal .main{width:248px;min-width:248px;7max-width:248px}.modal ul.tab-list{width:248px;min-width:248px;max-width:248px}.modal .header{display:flex;margin-bottom:3px}.modal .header .back{margin:10px;margin-top:15px;margin-right:3px;width:36px;height:36px;border-radius:18px;padding:6px;padding-left:5px;cursor:pointer}.modal .header .back i.ico{color:#424242}.modal .header .back:hover{background:#FAFAFA}.modal .header .back.ripple.ripple-active{background:#f5f5f5}.modal .header .info{display:flex;flex-direction:column;margin-top:15px}.modal .header .info p{display:flex;align-items:center;font-weight:500;color:#616161;user-select:none;pointer-events:none}.modal .header .info span{display:block;margin-top:3px;font-size:12px;color:#9E9E9E;user-select:none;pointer-events:none}.modal ul.item-list .separator{margin:6px 0;width:100%;height:1px;background:#F1F1F1}.modal ul.item-list li.caption{padding:2px 15px;padding-top:12px;list-style:none}.modal ul.item-list li.caption p{color:#9E9E9E;user-select:none;pointer-events:none}.modal ul.item-list li.item{display:flex;align-items:center;padding:15px;cursor:pointer}.modal ul.item-list li.item.empty p{display:block;width:100%;color:#9E9E9E;text-align:center;user-select:none;pointer-events:none}.modal ul.item-list li.item:not(.active):not(.inactive):hover{background:#FAFAFA}.modal ul.item-list li.item:not(.active):not(.inactive).ripple.ripple-active{background:#f5f5f5}.modal ul.item-list li.item i.ico{color:#424242;user-select:none;pointer-events:none}.modal ul.item-list li.item i.lang{display:flex;justify-content:center;align-items:center;font-style:normal;font-weight:600;width:24px;height:24px;color:#424242;user-select:none;pointer-events:none}.modal ul.item-list li.item .info{display:flex;flex-direction:column;margin-left:10px;max-width:calc(100% - 24px - 10px)}.modal ul.item-list li.item .info p{display:flex;align-items:center;font-weight:500;color:#616161;user-select:none;pointer-events:none}.modal ul.item-list li.item .info span{display:block;margin-top:3px;font-size:12px;color:#9E9E9E;user-select:none;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.modal ul.item-list li.item.active{background:#EEE}.modal ul.item-list li.item.active.ripple.ripple-active{background:#e9e9e9}.modal ul.item-list li.item.inactive i.ico{color:#9E9E9E}.modal ul.item-list li.item.inactive .info p{color:#9E9E9E}.tooltip{position:relative;display:flex;justify-content:center;align-items:center}.tooltip:hover::before{opacity:.95;transition-delay:.6s}.tooltip:hover::after{opacity:.95;transition-delay:.6s}.tooltip::after{display:flex;opacity:0;content:attr(data-title);justify-content:center;align-items:center;position:absolute;background:#24292E;color:#fff;min-height:24px;padding:0 12px;border-radius:999px;font-size:12px;top:auto;bottom:-70%;white-space:nowrap;z-index:9999;pointer-events:none}.tooltip.up::before{top:calc(-90% + 26px);bottom:auto;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #24292E;border-bottom:none}.tooltip.up::after{top:-60%;bottom:auto}.tooltip.down::before{top:auto;bottom:calc(-90% + 26px);border-left:6px solid transparent;border-right:6px solid transparent;border-top:none;border-bottom:6px solid #24292E}.tooltip.down::after{top:auto;bottom:-60%}1
\ No newline at end of file1
*{margin:0;padding:0;font-family:Roboto,sans-serif;box-sizing:border-box}:focus,:hover{outline:0}html{position:relative;overflow-x:hidden;min-height:100vh}body{width:100%;font-size:14px;min-height:100vh}img{pointer-events:none;user-select:none}input{-webkit-appearance:none}button{user-select:none;cursor:pointer}.hidden{display:none!important}.ico{font-family:'Material Icons';font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:'liga';user-select:none;pointer-events:none}*{-webkit-tap-highlight-color:transparent}body,html{overflow:hidden}#canvas,#overlay,.controls{position:fixed;top:0;left:0;right:0;bottom:0}#overlay{pointer-events:none}.badge{display:inline-block;margin-top:-1px;margin-left:5px;padding:2px 4px;border-radius:2px;font-weight:500;font-size:12px;color:#fff!important}.badge.prime{background:#0372EF}.badge.beta{background:#388E3C}.controls{pointer-events:none}.controls .notification{top:30px;position:fixed;display:flex;justify-content:center;width:100%;opacity:0}.controls .notification p{display:inline-block;padding:10px 24px;border-radius:999px;background:#24292E;color:#fff;opacity:.95;user-select:none;pointer-events:none}.controls .ad{position:fixed;width:400px;height:150px;border-radius:4px;background:#EEE;bottom:40px;right:40px;pointer-events:all}.controls .hotbar{display:flex;position:fixed;left:calc(50% - 216px);bottom:30px;pointer-events:all;z-index:-1}.controls .hotbar .color{margin:6px;width:60px;height:60px;border-radius:30px;background:#EEE;cursor:pointer;transition:transform .2s;transform:scale(.9)}.controls .hotbar .color:not(.active):hover{transform:scale(1)}.controls .hotbar .color.focus{transform:scale(1)}.controls .hotbar .color.active{transform:scale(1.1)}.controls .scale-modal{top:40px;left:calc(50% - 200px);width:400px;height:60px}.controls .scale-modal input[type=range]{-webkit-appearance:none;width:calc(400px - 54px);margin-top:21px;margin-left:27px;height:6px;background:#EEE;border:none;border-radius:4px}.controls .scale-modal input[type=range]::-webkit-slider-runnable-track{-webkit-appearance:none}.controls .scale-modal input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;height:20px;width:20px;margin-top:0;background:#9E9E9E;border-radius:10px;cursor:pointer}.controls .scale-modal input[type=range]::-webkit-slider-thumb:hover{background:#757575}.controls .clear-modal{top:calc(50% - 75px);left:calc(50% - 200px);width:400px;height:150px;display:grid;padding:30px 10px 10px 10px}.controls .clear-modal .text-clear{font-size:20px;width:380px;height:px;text-align:center;align-items:center}.controls .clear-modal .align{display:flex;margin-top:auto}.controls .clear-modal .align .btn-cancel{width:185px;height:50px;border:none;border-radius:3px;background-color:#F5F5F5;font-size:17px}.controls .clear-modal .align .btn-cancel:hover{background-color:#E0E0E0}.controls .clear-modal .align .btn-apply{width:185px;height:50px;border:none;border-radius:3px;border-color:grey;background-color:#F5F5F5;margin-left:10px;font-size:17px}.controls .clear-modal .align .btn-apply:hover{background-color:#E0E0E0}.controls .capture-modal{top:calc(50% - 250px);left:calc(50% - 200px);width:400px;height:500px;display:grid}.controls .capture-modal .text-save{font-size:20px;width:380px;height:px;text-align:center;align-items:center;margin-top:20px}.controls .capture-modal .preview{height:250px;background:#F5F5F5;border:1px solid #f1f1f1;border-radius:3px;margin-top:20px;margin-left:20px;margin-right:20px}.controls .capture-modal .action-file{border-radius:3px;border:2px solid #f1f1f1;height:50px;margin-top:10px;margin-left:20px;margin-right:20px;padding:0 0 0 10px;font-size:15px}.controls .capture-modal .align{display:flex;margin-top:auto;margin-bottom:20px}.controls .capture-modal .align .btn-cancel{width:170px;height:50px;border:none;border-radius:3px;background-color:#F5F5F5;font-size:17px;margin-left:20px}.controls .capture-modal .align .btn-cancel:hover{background-color:#E0E0E0}.controls .capture-modal .align .btn-apply{width:170px;height:50px;border:none;border-radius:3px;border-color:grey;background-color:#F5F5F5;margin-left:20px;font-size:17px}.controls .capture-modal .align .btn-apply:hover{background-color:#E0E0E0}.controls .toolbar{top:20px;left:20px}.controls .actionbar{top:20px;right:20px}.controls .actionbar,.controls .toolbar{display:flex;position:fixed;pointer-events:all}.controls .actionbar .action,.controls .actionbar .tool,.controls .toolbar .action,.controls .toolbar .tool{width:44px;height:44px;padding:10px;margin-left:8px;border-radius:22px;cursor:pointer}.controls .actionbar .action:hover,.controls .actionbar .tool:hover,.controls .toolbar .action:hover,.controls .toolbar .tool:hover{background:rgba(250,250,250,.95)}.controls .actionbar .action:hover.ripple:not(.active).ripple-active,.controls .actionbar .tool:hover.ripple:not(.active).ripple-active,.controls .toolbar .action:hover.ripple:not(.active).ripple-active,.controls .toolbar .tool:hover.ripple:not(.active).ripple-active{background:rgba(245,245,245,.95)}.controls .actionbar .action:hover.ripple.active.ripple-active,.controls .actionbar .tool:hover.ripple.active.ripple-active,.controls .toolbar .action:hover.ripple.active.ripple-active,.controls .toolbar .tool:hover.ripple.active.ripple-active{background:rgba(233,233,233,.95)}.controls .actionbar .action.active,.controls .actionbar .tool.active,.controls .toolbar .action.active,.controls .toolbar .tool.active{background:rgba(238,238,238,.95)}.controls .actionbar .action i.ico,.controls .actionbar .tool i.ico,.controls .toolbar .action i.ico,.controls .toolbar .tool i.ico{color:#424242}.colors-modal{flex-wrap:wrap;min-width:410px;width:410px;max-width:410px;padding:30px!important;top:calc(50% - 421px);left:calc(50% - 205px);display:flex;gap:12px}.colors-modal .color{width:60px;height:60px;border-radius:30px;background:#EEE;cursor:pointer;transition:transform .2s;transform:scale(.9)}.colors-modal .color:not(.active):hover{transform:scale(1)}.colors-modal .color.active{transform:scale(1.1)}.colors-modal .color.focus{transform:scale(1)}.multiplayer-modal{top:75px;right:120px}.account-modal{top:75px;right:70px}.settings-modal{top:75px;right:20px}.device-modal{top:100px;right:320px}.language-modal{top:100px;right:860px}.settings-modal{top:75px;right:20px}.modal{width:250px;position:fixed;background:#fff;border:1px solid #F1F1F1;border-radius:4px;padding:6px 0;pointer-events:all;overflow:hidden;z-index:-1;display:flex}.modal .main{width:248px;min-width:248px;7max-width:248px}.modal ul.tab-list{width:248px;min-width:248px;max-width:248px}.modal .header{display:flex;margin-bottom:3px}.modal .header .back{margin:10px;margin-top:15px;margin-right:3px;width:36px;height:36px;border-radius:18px;padding:6px;padding-left:5px;cursor:pointer}.modal .header .back i.ico{color:#424242}.modal .header .back:hover{background:#FAFAFA}.modal .header .back.ripple.ripple-active{background:#f5f5f5}.modal .header .info{display:flex;flex-direction:column;margin-top:15px}.modal .header .info p{display:flex;align-items:center;font-weight:500;color:#616161;user-select:none;pointer-events:none}.modal .header .info span{display:block;margin-top:3px;font-size:12px;color:#9E9E9E;user-select:none;pointer-events:none}.modal ul.item-list .separator{margin:6px 0;width:100%;height:1px;background:#F1F1F1}.modal ul.item-list li.caption{padding:2px 15px;padding-top:12px;list-style:none}.modal ul.item-list li.caption p{color:#9E9E9E;user-select:none;pointer-events:none}.modal ul.item-list li.item{display:flex;align-items:center;padding:15px;cursor:pointer}.modal ul.item-list li.item.empty p{display:block;width:100%;color:#9E9E9E;text-align:center;user-select:none;pointer-events:none}.modal ul.item-list li.item:not(.active):not(.inactive):hover{background:#FAFAFA}.modal ul.item-list li.item:not(.active):not(.inactive).ripple.ripple-active{background:#f5f5f5}.modal ul.item-list li.item i.ico{color:#424242;user-select:none;pointer-events:none}.modal ul.item-list li.item i.lang{display:flex;justify-content:center;align-items:center;font-style:normal;font-weight:600;width:24px;height:24px;color:#424242;user-select:none;pointer-events:none}.modal ul.item-list li.item .info{display:flex;flex-direction:column;margin-left:10px;max-width:calc(100% - 24px - 10px)}.modal ul.item-list li.item .info p{display:flex;align-items:center;font-weight:500;color:#616161;user-select:none;pointer-events:none}.modal ul.item-list li.item .info span{display:block;margin-top:3px;font-size:12px;color:#9E9E9E;user-select:none;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.modal ul.item-list li.item.active{background:#EEE}.modal ul.item-list li.item.active.ripple.ripple-active{background:#e9e9e9}.modal ul.item-list li.item.inactive i.ico{color:#9E9E9E}.modal ul.item-list li.item.inactive .info p{color:#9E9E9E}.tooltip{position:relative;display:flex;justify-content:center;align-items:center}.tooltip:hover::before{opacity:.95;transition-delay:.6s}.tooltip:hover::after{opacity:.95;transition-delay:.6s}.tooltip::after{display:flex;opacity:0;content:attr(data-title);justify-content:center;align-items:center;position:absolute;background:#24292E;color:#fff;min-height:24px;padding:0 12px;border-radius:999px;font-size:12px;top:auto;bottom:-70%;white-space:nowrap;z-index:9999;pointer-events:none}.tooltip.up::before{top:calc(-90% + 26px);bottom:auto;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #24292E;border-bottom:none}.tooltip.up::after{top:-60%;bottom:auto}.tooltip.down::before{top:auto;bottom:calc(-90% + 26px);border-left:6px solid transparent;border-right:6px solid transparent;border-top:none;border-bottom:6px solid #24292E}.tooltip.down::after{top:auto;bottom:-60%}1
\ No newline at end of file
115
</div>116
<div class="modal scale-modal hidden">117
<input type="range" min="2" max="50" value="14" step="1">118
<div class="modal window"></div>119
</div>120
<div class="modal clear-modal hidden">121
<p class="text-clear">Do you want to clear the screen?</p>
125
</div>126
</div>127
<div class="modal capture-modal hidden">128
<p class="text-save">Do you want to save this screen?</p>129
<div class="preview"></div>130
<input type="text" class="action-file" maxlength="40" spellcheck="false" autocomplete="off" placeholder="Choose a name">131
<div class="align">132
<button class="btn btn-cancel" data-modal="capture" onclick="toggle_modal(this)">No</button>133
<button class="btn btn-apply" onclick="">Yes</button>134
</div>135
</div>136
<div class="modal multiplayer-modal hidden">137
<div class="main">
153
<li class="item ripple inactive">154
<i class="ico">device_hub</i>155
<div class="info">148
<p data-lang="multiplayer.host" data-prime="true">Host<b class="prime-badge">Prime</b></p>156
<p data-lang="multiplayer.host" data-badge="true">Host<b class="badge prime">Prime</b></p>157
<span data-lang="multiplayer.host.info">Host current state as channel</span>158
</div>159
</li>
210
<li class="item ripple inactive">211
<i class="ico">watch_later</i>212
<div class="info">205
<p data-lang="channel.permanent" data-prime="true">Permanent<b class="prime-badge">Prime</b></p>213
<p data-lang="channel.permanent" data-badge="true">Permanent<b class="badge prime">Prime</b></p>214
<span data-lang="channel.permanent.info">Keep channel permanent online</span>215
</div>216
</li>217
<li class="item ripple inactive">218
<i class="ico">verified_user</i>219
<div class="info">212
<p data-lang="channel.roles" data-prime="true">Roles<b class="prime-badge">Prime</b></p>220
<p data-lang="channel.roles" data-badge="true">Roles<b class="badge prime">Prime</b></p>221
<span data-lang="channel.roles.info">Manage user permissions</span>222
</div>223
</li>
231
<li class="item ripple">232
<i class="ico">publish</i>233
<div class="info">226
<p data-lang="account.upgrade" data-prime="true">Upgrade<b class="prime-badge">Get Prime</b></p>234
<p data-lang="account.upgrade" data-badge="true">Upgrade<b class="badge prime">Get Prime</b></p>235
<span data-lang="account.upgrade.info">Unlock all fancy features</span>236
</div>237
</li>
282
<li class="item ripple" data-tab="language" onclick="open_tab(this)">283
<i class="ico">language</i>284
<div class="info">277
<p data-lang="setting.language" data-beta="true">Language<b class="beta-badge">Beta</b></p>285
<p data-lang="setting.language" data-badge="true">Language<b class="badge beta">Beta</b></p>286
<span data-lang="setting.language.info">Choose preferred language</span>287
</div>288
</li>
336
<i class="ico">keyboard_arrow_left</i>337
</div>338
<div class="info">331
<p data-lang="setting.language" data-beta="true">Language<b class="beta-badge">Beta</b></p>339
<p data-lang="setting.language" data-badge="true">Language<b class="badge beta">Beta</b></p>340
<span data-lang="setting.language.info">Choose preferred language</span>341
</div>342
</div>343
<ul class="item-list">336
<li class="item ripple active" data-code="en" onclick="change_language(this)">344
<li class="item ripple active" data-event="change.language" data-code="en">345
<i class="lang">EN</i>346
<div class="info">347
<p>English</p>348
<span data-lang="setting.language.default">Default language</span>349
</div>350
</li>343
<li class="item ripple" data-code="de" onclick="change_language(this)">351
<li class="item ripple" data-event="change.language" data-code="de">352
<i class="lang">DE</i>353
<div class="info">354
<p>Deutsch</p>
367
</div>368
</div>369
<ul class="item-list">362
<li class="item empty inactive">363
<p data-lang="setting.input-device.empty">No devices detected</p>364
</li>365
<li class="item ripple inactive" data-device="mouse" onclick="change_device(this)">370
<li class="item ripple inactive" data-event="change.device" data-code="mouse">371
<i class="ico">mouse</i>372
<div class="info">373
<p data-lang="setting.input-device.mouse">Mouse</p>374
<span data-lang="setting.input-device.default">Default input device</span>375
</div>376
</li>372
<li class="item ripple inactive" data-device="touch" onclick="change_device(this)">377
<li class="item ripple inactive" data-event="change.device" data-code="touch">378
<i class="ico">gesture</i>379
<div class="info">380
<p data-lang="setting.input-device.touch">Touch</p>381
<span data-lang="setting.input-device.touch.info">Finger interaction</span>382
</div>383
</li>379
<li class="item ripple inactive" data-device="pen" onclick="change_device(this)">384
<li class="item ripple inactive" data-event="change.device" data-code="pen">385
<i class="ico">edit</i>386
<div class="info">382
<p data-lang="setting.input-device.pencil" data-prime="true">Pencil<b class="prime-badge">Prime</b></p>387
<p data-lang="setting.input-device.pencil" data-badge="true">Pencil<b class="badge prime">Prime</b></p>388
<span data-lang="setting.input-device.pencil.info">Stylus pen, touch disabled</span>389
</div>390
</li>386
<li class="item ripple inactive" data-device="gamepad" onclick="change_device(this)">391
<li class="item ripple inactive" data-event="change.device" data-code="gamepad">392
<i class="ico">sports_esports</i>393
<div class="info">389
<p data-lang="setting.input-device.gamepad" data-prime="true">Gamepad<b class="prime-badge">Prime</b></p>394
<p data-lang="setting.input-device.gamepad" data-badge="true">Gamepad<b class="badge prime">Prime</b></p>395
<span data-lang="setting.input-device.gamepad.info">Stadia Controller supported</span>396
</div>397
</li>
411
<li class="item ripple inactive">412
<i class="ico">toggle_off</i>413
<div class="info">409
<p data-prime="true">Dark Mode<b class="prime-badge">Prime</b></p>414
<p data-badge="true">Dark Mode<b class="badge prime">Prime</b></p>415
<span data-lang="">More pleasant for your eyes</span>416
</div>417
</li>418
<li class="item ripple inactive">419
<i class="ico">toggle_off</i>420
<div class="info">416
<p data-prime="true">Fading UI<b class="prime-badge">Prime</b></p>421
<p data-badge="true">Fading UI<b class="badge prime">Prime</b></p>422
<span data-lang="">UI fades out while drawing</span>423
</div>424
</li>
1
import { COLORS } from '../constant.js';3
let active;4
let point_list = [];6
let canvas;7
let overlay;8
let memory;10
function init() {11
canvas = document.querySelector('#canvas');12
overlay = document.querySelector('#overlay');13
memory = document.createElement('canvas');14
fit(canvas);15
fit(overlay);16
fit(memory);17
window.addEventListener('resize', function(event) {18
resize(canvas);19
resize(overlay);20
resize(memory);21
});22
}24
function fit(canvas) {25
canvas.width = window.innerWidth;26
canvas.height = window.innerHeight;27
}29
function get(canvas) {30
return canvas.getContext('2d');31
}33
function get_canvas() {34
return canvas;35
}37
function resize(canvas) {38
let g = get(canvas);39
let image_data = g.getImageData(0, 0, canvas.width, canvas.height);40
fit(canvas);41
g.putImageData(image_data, 0, 0);42
}44
function clear() {45
get(canvas).clearRect(0, 0, canvas.width, canvas.height);46
get(memory).clearRect(0, 0, memory.width, memory.height);47
}49
function on_press(event) {50
active = true;51
point_list.push({52
x: event.layerX,53
y: event.layerY54
});55
}57
function on_move(event, state) {58
if(active) {59
get(canvas).clearRect(0, 0, canvas.width, canvas.height);60
get(canvas).drawImage(memory, 0, 0);61
point_list.push({62
x: event.layerX,63
y: event.layerY64
});65
draw_curve(state);66
}67
}69
function on_release(event) {70
if(active) {71
if(event.type === 'pointerup') {72
active = false;73
}74
get(memory).clearRect(0, 0, memory.width, memory.height);75
get(memory).drawImage(canvas, 0, 0);76
point_list = [];77
}78
}80
function draw_curve(state) {81
let g = get(canvas);82
g.lineJoin = 'round';83
g.lineCap = 'round';84
g.lineWidth = 2 * state.radius;85
g.strokeStyle = COLORS[state.color] + 'BB';86
if(point_list.length < 3) {87
return;88
}89
if(point_list.length < 3) {90
g.beginPath();91
g.arc(point_list[0].x + 0.5, point_list[0].y + 0.5, g.lineWidth / 2, 0, Math.PI * 2, !0);92
g.closePath();93
g.fill();94
return;95
}96
g.beginPath();97
g.moveTo(point_list[0].x + 0.5, point_list[0].y + 0.5);98
let i;99
for(i = 1; i < point_list.length - 2; i++) {100
let dx = (point_list[i].x + point_list[i + 1].x);101
let dy = (point_list[i].y + point_list[i + 1].y);102
g.quadraticCurveTo(point_list[i].x + 0.5, point_list[i].y + 0.5, (dx / 2) + 0.5, (dy / 2) + 0.5);103
}104
g.quadraticCurveTo(point_list[i].x + 0.5, point_list[i].y + 0.5, point_list[i + 1].x + 0.5, point_list[i + 1].y + 0.5);105
g.stroke();106
}108
export default {109
init,110
fit,111
get,112
get_canvas,113
resize,114
clear,115
on_press,116
on_move,117
on_release,118
draw_curve119
};
1
const CONTROLLER_PATTERN = {2
0: 'A',3
1: 'B',4
2: 'X',5
3: 'Y',6
4: 'L1',7
5: 'R1',8
6: 'L2',9
7: 'R2',10
8: 'Option',11
9: 'Menu',12
10: 'L3',13
11: 'R3',14
12: 'Up',15
13: 'Down',16
14: 'Left',17
15: 'Right',18
16: 'Power',19
17: 'Assist',20
18: 'Capture'21
};23
let gamepad;24
let on_connect_callback;25
let on_disconnect_callback;27
/**28
Binds gamepad event handler.30
@function init31
@contructor32
*/33
function init() {34
window.addEventListener('gamepadconnected', function(event) {35
gamepad = event.gamepad;36
if(gamepad.vibrationActuator) {37
gamepad.vibrationActuator.playEffect('dual-rumble', {38
startDelay: 0,39
duration: 100,40
weakMagnitude: 1.0,41
strongMagnitude: 1.042
});43
}44
if(on_connect_callback) {45
on_connect_callback(gamepad);46
}47
});48
window.addEventListener('gamepaddisconnected', function() {49
gamepad = null;50
if(on_disconnect_callback) {51
on_disconnect_callback(gamepad);52
}53
});54
}56
/**57
Return controller formatted input.59
@function get60
@return {Object} The formatted input object.61
*/62
function get() {63
let result = {64
button: {},65
axes: {}66
};67
for(let [ id, key ] of Object.entries(CONTROLLER_PATTERN)) {68
if(gamepad.buttons[id]) {69
result.button[key] = gamepad.buttons[id];70
}71
}72
result.axes['Left'] = {73
x: gamepad.axes[0],74
y: gamepad.axes[1]75
};76
result.axes['Right'] = {77
x: gamepad.axes[2],78
y: gamepad.axes[3]79
};80
return result;81
}83
function on_connect(callback) {84
on_connect_callback = callback;85
}87
function on_disconnect(callback) {88
on_disconnect_callback = callback;89
}91
/**92
The callback gets called if a gamepad button was pressed.94
@function on_pressed95
@param {string} key - The input key.96
@callback callback97
*/98
function on_pressed(key, callback) {99
/*100
if(input.button[key]) {101
if(!pressed[key]) {102
pressed[key] = true;103
if(callback) {104
callback();105
}106
}107
}108
else {109
pressed[key] = false;110
}111
*/112
}114
export default { init, get, on_connect, on_disconnect, on_pressed };116
// !!! TODO !!!117
/*118
// cursor visible119
canvas.style.cursor = device === 'mouse' ? 'none' : 'default';120
if(device !== 'gamepad') {121
let pos = arrow_y * 5 + arrow_x;122
if(modal_colors[pos].classList.contains('focus')) {123
modal_colors[pos].classList.remove('focus');124
}125
}126
// navigate colors127
if(device === 'gamepad') {128
let pos = arrow_y * 5 + arrow_x;129
for(let [ i, item ] of Object.entries(modal_colors)) {130
item.classList[parseInt(i) == pos ? 'add' : 'remove']('focus');131
}132
}133
*/135
// !!! TODO !!!136
/*137
let gamepad = navigator.getGamepads()[0];138
if(gamepad) {139
if(device === 'gamepad') {140
if(point.x == null && point.y == null) {141
point.x = parseInt(window.innerWidth / 2);142
point.y = parseInt(window.innerHeight / 2);143
}144
let speed = 4;145
if(pressed['L2'] && !pressed['R2']) {146
speed = 10;147
}148
if(pressed['R2'] && !pressed['L2']) {149
speed = 1;150
}151
// colors152
key_pressed('Option', input, function() {153
toggle_modal(colors_modal);154
});155
// capture156
key_pressed('Capture', input, function() {157
toggle_modal(capture_modal);158
});159
// draw160
key_pressed('A', input, function() {161
last.x = null;162
last.y = null;163
if(!current_modal) {164
left_modal = false;165
}166
});167
// erase168
key_pressed('B', input, function() {169
last.x = null;170
last.y = null;171
if(current_tab) {172
close_tab(current_tab);173
left_modal = true;174
}175
else if(current_modal) {176
toggle_modal(current_modal);177
left_modal = true;178
}179
else {180
left_modal = false;181
}182
});183
// sprint184
key_pressed('L2', input);185
// sneak186
key_pressed('R2', input);187
// clear188
key_pressed('Y', input, function() {189
toggle_modal(clear_modal);190
});191
// radius192
let y = -(input.axes['Right'].y / 2);193
if(y !== 0 && radius + y > 2 && radius + y < 50 + 1) {194
radius += y;195
scale_range.value = radius;196
}197
// lock y198
key_pressed('L3', input, function() {199
lock_y = !lock_y;200
lock_x = false;201
});202
// lock x203
key_pressed('R3', input, function() {204
lock_x = !lock_x;205
lock_y = false;206
});207
// color-wheel left208
key_pressed('L1', input, function() {209
if(index > 0) {210
index--;211
for(let i in colors) {212
if(COLOR_LENGTH > i) {213
colors[i].classList[i == index ? 'add' : 'remove']('active');214
}215
}216
}217
});218
// color-wheel right219
key_pressed('R1', input, function() {220
if(index < COLOR_LENGTH - 1) {221
index++;222
for(let i in colors) {223
if(COLOR_LENGTH > i) {224
colors[i].classList[i == index ? 'add' : 'remove']('active');225
}226
}227
}228
});229
key_pressed('Up', input, function() {230
if(arrow_y > 0) {231
arrow_y--;232
}233
});234
key_pressed('Down', input, function() {235
if(arrow_y < 10) {236
arrow_y++;237
}238
});239
key_pressed('Left', input, function() {240
if(arrow_x > 0) {241
arrow_x--;242
}243
});244
key_pressed('Right', input, function() {245
if(arrow_x < 4) {246
arrow_x++;247
}248
});249
}250
}251
*/
1
const LINE_BREAK_PATTERN = /\r\n|\r|\n/;2
const PROPERTY_PATTERN = /^([\w+.-]+)=([^=]*)$/;4
let lang = {};5
let default_lang;6
let current_lang;8
/**9
Sets the default and current language.11
@function init12
@constructor13
@param {string} code - The locale code;14
*/15
function init(code) {16
default_lang = code;17
current_lang = code;18
}20
/**21
Reads all properties files in the given directory and specified locale code.23
@async24
@function load25
@param {string} path - The path to the locale files.26
@param {string[]} locales - The list containing all locales.27
@return {Object} The locale object.28
*/29
async function load(path, locales) {30
for(let code of locales) {31
let text = await fetch(`${path}/${code}.properties`)32
.then(function(response) {33
if(!response.ok) {34
throw new Error('(404) Not Found');35
}36
return response.text();37
})38
.catch(function(error) {39
console.error(`No properties file found for locale '${code}'!`, error);40
});41
if(text) {42
lang[code] = parse(text);43
}44
}45
}47
/**48
Converts properties text to a locale object.50
@function parse51
@param {string} text - Raw properties text data.52
@return {Object} The locale object.53
*/54
function parse(text) {55
let result = {};56
for(let line of text.split(LINE_BREAK_PATTERN)) {57
let match = PROPERTY_PATTERN.exec(line);58
if(match) {59
result[match[1]] = match[2];60
}61
}62
return result;63
}65
/**66
Returns the locale object by the given locale code.68
@function change69
@return {Object} The locale object.70
*/71
function get() {72
return lang[current_lang];73
}75
/**76
Changes language text from all HTMLElements with the specified datatag.78
@function change79
@param {string} code - The local code.80
*/81
function change(code) {82
if(lang[code]) {83
current_lang = code;84
let elements = document.querySelectorAll('[data-lang]');85
for(let item of elements) {86
let content = lang[code][item.dataset.lang];87
if(content) {88
let type = item.dataset.type || 'content';89
let badge;90
if(item.dataset.badge === 'true') {91
badge = item.querySelector('.badge');92
}93
switch(type) {94
case 'content':95
item.textContent = content;96
if(badge) {97
item.append(badge);98
}99
break;100
case 'tooltip':101
item.dataset.title = content;102
break;103
default:104
break;105
}106
}107
}108
}109
}111
export default { init, load, parse, get, change };
1
const COLORS = {2
0: '#FFCDD2',3
1: '#E57373',4
2: '#F44336',5
3: '#D32F2F',6
4: '#B71C1C',7
5: '#F8BBD0',8
6: '#F06292',9
7: '#E91E63',10
8: '#C2185B',11
9: '#880E4F',12
10: '#E1BEE7',13
11: '#BA68C8',14
12: '#9C27B0',15
13: '#7B1FA2',16
14: '#4A148C',17
15: '#BBDEFB',18
16: '#64B5F6',19
17: '#2196F3',20
18: '#1976D2',21
19: '#0D47A1',22
20: '#B2EBF2',23
21: '#4DD0E1',24
22: '#00BCD4',25
23: '#0097A7',26
24: '#006064',27
25: '#B2DFDB',28
26: '#4DB6AC',29
27: '#009688',30
28: '#00796B',31
29: '#004D40',32
30: '#C8E6C9',33
31: '#81C784',34
32: '#4CAF50',35
33: '#388E3C',36
34: '#1B5E20',37
35: '#FFF9C4',38
36: '#FFF176',39
37: '#FFEB3B',40
38: '#FBC02D',41
39: '#F57F17',42
40: '#FFE0B2',43
41: '#FFB74D',44
42: '#FF9800',45
43: '#F57C00',46
44: '#E65100',47
45: '#D7CCC8',48
46: '#A1887F',49
47: '#795548',50
48: '#5D4037',51
49: '#3E2723',52
50: '#F5F5F5',53
51: '#E0E0E0',54
52: '#9E9E9E',55
53: '#616161',56
54: '#141414'57
};59
export { COLORS };
1
const CONTROLLER_PATTERN = {2
0: 'A',3
1: 'B',4
2: 'X',5
3: 'Y',6
4: 'L1',7
5: 'R1',8
6: 'L2',9
7: 'R2',10
8: 'Option',11
9: 'Menu',12
10: 'L3',13
11: 'R3',14
12: 'Up',15
13: 'Down',16
14: 'Left',17
15: 'Right',18
16: 'Power',19
17: 'Assist',20
18: 'Capture'21
};23
// Stores the pressed buttons24
let pressed = {};26
/**27
Converts controller input into readable input.29
@function read30
@param {Object} gamepad - The gamepad object.31
@return {Object} The formatted input object.32
*/34
function read(gamepad) {35
let result = {36
button: {},37
axes: {}38
};39
for(let [ id, key ] of Object.entries(CONTROLLER_PATTERN)) {40
if(gamepad.buttons[id]) {41
result.button[key] = gamepad.buttons[id].pressed;42
}43
}44
result.axes['Left'] = {45
x: gamepad.axes[0],46
y: gamepad.axes[1]47
};48
result.axes['Right'] = {49
x: gamepad.axes[2],50
y: gamepad.axes[3]51
};52
return result;53
}55
/**56
The callback gets called if a gamepad button was pressed.58
@function key_pressed59
@param {string} key - The input key.60
@param {Object} input - The formatted input object.61
@callback callback62
*/63
function key_pressed(key, input, callback) {64
if(input.button[key]) {65
if(!pressed[key]) {66
pressed[key] = true;67
if(callback) {68
callback();69
}70
}71
}72
else {73
pressed[key] = false;74
}75
}77
export { read, key_pressed };
1
import { uuid } from './util.js';2
import { load } from './locale.js';3
import { read, key_pressed } from './gamepad.js';1
import { COLORS } from './constant.js';2
import { uuid, query, prevent } from './util.js';5
import Ripple from './addon/ripple.js';4
// addons5
import canvas from './addon/canvas.js';6
import locale from './addon/locale.js';7
import gamepad from './addon/gamepad.js';8
import ripple from './addon/ripple.js';7
window.toggle_modal = toggle_modal;8
window.open_tab = open_tab;9
window.close_tab = close_tab;10
window.change_device = change_device;11
window.change_language = change_language;12
window.clear_screen = clear_screen;14
const COLORS = {15
0: '#FFCDD2',16
1: '#E57373',17
2: '#F44336',18
3: '#D32F2F',19
4: '#B71C1C',20
5: '#F8BBD0',21
6: '#F06292',22
7: '#E91E63',23
8: '#C2185B',24
9: '#880E4F',25
10: '#E1BEE7',26
11: '#BA68C8',27
12: '#9C27B0',28
13: '#7B1FA2',29
14: '#4A148C',30
15: '#BBDEFB',31
16: '#64B5F6',32
17: '#2196F3',33
18: '#1976D2',34
19: '#0D47A1',35
20: '#B2EBF2',36
21: '#4DD0E1',37
22: '#00BCD4',38
23: '#0097A7',39
24: '#006064',40
25: '#B2DFDB',41
26: '#4DB6AC',42
27: '#009688',43
28: '#00796B',44
29: '#004D40',45
30: '#C8E6C9',46
31: '#81C784',47
32: '#4CAF50',48
33: '#388E3C',49
34: '#1B5E20',50
35: '#FFF9C4',51
36: '#FFF176',52
37: '#FFEB3B',53
38: '#FBC02D',54
39: '#F57F17',55
40: '#FFE0B2',56
41: '#FFB74D',57
42: '#FF9800',58
43: '#F57C00',59
44: '#E65100',60
45: '#D7CCC8',61
46: '#A1887F',62
47: '#795548',63
48: '#5D4037',64
49: '#3E2723',65
50: '#F5F5F5',66
51: '#E0E0E0',67
52: '#9E9E9E',68
53: '#616161',69
54: '#141414'70
};72
const COLOR = {73
0: '#141414',74
1: '#F44336',75
2: '#2196F3',76
3: '#009688',77
4: '#FFEB3B',78
5: '#9C27B0'10
let state = {11
color: 54,12
color_list: [54, 2, 17, 27, 37, 12],13
radius: 14,14
index: 0,15
device: null,16
device_fallback: null,17
device_list: {18
mouse: false,19
touch: false,20
pen: false,21
gamepad: false22
}23
};81
const COLORS_LENGTH = Object.values(COLORS).length;82
const COLOR_LENGTH = Object.values(COLOR).length;25
let node;84
let LANG;27
// state variables28
let notification_code;29
let left_modal = false;30
let current_modal;31
let current_tab;86
let node;87
let canvas;88
let overlay;89
let g;90
let o;33
// node elements34
let ad;35
let hotbar;36
let toolbar;37
let actionbar;95
let colors;38
let actions;39
let tools;98
let modals;99
let device_options;40
let device_empty;101
let current_modal;102
let current_tab;103
let modal_colors;41
let colors_modal;42
let capture_modal;43
let clear_modal;44
let scale_range;109
let device;110
let devices = {111
mouse: false,112
touch: false,113
pen: false,114
gamepad: false115
};116
let fallback_device;46
window.toggle_modal = toggle_modal;47
window.open_tab = open_tab;48
window.close_tab = close_tab;49
window.clear_screen = clear_screen;118
let lang = 'en';119
let notification_code;51
window.addEventListener('load', init);121
let cache;122
let point;123
let last;124
let start;125
let index = 0;126
let radius = 14;127
let lock_x = false;128
let lock_y = false;129
let draw;130
let erase;131
let arrow_y = 0;132
let arrow_x = 0;133
let left_modal = false;53
function init() {54
canvas.init();55
locale.init('en');56
locale.load('../asset/lang', ['en', 'de']);57
gamepad.init();58
ripple.init();59
// detect gamepad60
gamepad.on_connect(function(gamepad) {61
state.device_list.gamepad = true;62
show_notification('notification.input-device.gamepad.add');63
if(!state.device) {64
state.device = 'gamepad';65
state.device_fallback = 'gamepad';66
}67
update_device_list();68
});69
// gamepad removed70
gamepad.on_disconnect(function(gamepad) {71
state.device_list.gamepad = false;72
show_notification('notification.input-device.gamepad.remove');73
if(state.device === 'gamepad') {74
if(state.device !== state.device_fallback) {75
state.device = state.device_fallback;76
}77
else {78
state.device = null;79
}80
// point = { x: null, y: null };81
// last = { x: null, y: null };82
}83
update_device_list();84
});85
init_custom();135
window.addEventListener('load', init);87
node = query({88
modal_list: { query: '.modal', all: true },89
hotbar_color_list: { query: '.hotbar .color', all: true },90
modal_color_list: { query: '.colors-modal .color', all: true },91
device_list: { query: '.settings-modal .device-tab .item[data-event="change.device"]', all: true }92
});137
async function init() {138
Ripple.init();139
LANG = await load('../asset/lang', ['en', 'de']);140
canvas = document.querySelector('#canvas');141
canvas.width = window.innerWidth;142
canvas.height = window.innerHeight;143
g = canvas.getContext('2d');144
overlay = document.querySelector('#overlay');145
overlay.width = window.innerWidth;146
overlay.height = window.innerHeight;147
o = overlay.getContext('2d');148
window.onresize = function() {149
cache = g.getImageData(0, 0, canvas.width, canvas.height);150
canvas.width = window.innerWidth;151
canvas.height = window.innerHeight;152
g.putImageData(cache, 0, 0);153
cache = o.getImageData(0, 0, overlay.width, overlay.height);154
overlay.width = window.innerWidth;155
overlay.height = window.innerHeight;156
o.putImageData(cache, 0, 0);157
}94
document.addEventListener('touchmove', function(event) {95
let { target } = event;96
if(target !== scale_range) {97
event.preventDefault();98
}99
}, { passive: false });164
device_options = document.querySelectorAll('.settings-modal .device-tab .item[data-device]');165
device_empty = document.querySelector('.settings-modal .device-tab .item.empty');101
device_empty = document.querySelector('.settings-modal .device-tab .item.empty');102
ad = document.querySelector('.controls .ad');103
hotbar = document.querySelector('.controls .hotbar');104
toolbar = document.querySelector('.controls .toolbar');105
actionbar = document.querySelector('.controls .actionbar');171
colors = Array.from(hotbar.querySelectorAll('.color'));106
actions = document.querySelectorAll('.actionbar .action');107
tools = document.querySelectorAll('.toolbar .tool');174
modals = document.querySelectorAll('.modal');175
modal_colors = document.querySelectorAll('.colors-modal .color');108
colors_modal = document.querySelector('.toolbar .tool[data-modal="colors"]');109
capture_modal = document.querySelector('.toolbar .tool[data-modal="capture"]');110
clear_modal = document.querySelector('.toolbar .tool[data-modal="clear"]');111
scale_range = document.querySelector('.scale-modal input[type="range"]');180
for(let i in colors) {181
if(COLOR_LENGTH > i) {182
if(i == index) {183
colors[i].classList.add('active');184
}185
colors[i].style.background = COLOR[i];186
colors[i].addEventListener('pointerdown', function(event) {187
for(let j in colors) {188
if(COLOR_LENGTH > j) {112
for(let i in node.hotbar_color_list) {113
if(Object.keys(state.color_list).length > i) {114
if(i == state.index) {115
node.hotbar_color_list[i].classList.add('active');116
}117
node.hotbar_color_list[i].style.background = COLORS[state.color_list[i]];118
node.hotbar_color_list[i].addEventListener('pointerdown', function(event) {119
state.color = state.color_list[i];120
for(let j in node.hotbar_color_list) {121
if(Object.keys(state.color_list).length > j) {122
if(j == i) {190
index = j;123
state.index = j;124
}192
colors[j].classList[j == i ? 'add' : 'remove']('active');125
node.hotbar_color_list[j].classList[j == i ? 'add' : 'remove']('active');126
}127
}128
});129
}130
}198
for(let i in modal_colors) {199
if(COLORS_LENGTH > i) {200
modal_colors[i].style.background = COLORS[i];131
for(let i in node.modal_color_list) {132
if(Object.keys(COLORS).length > i) {133
node.modal_color_list[i].style.background = COLORS[i];134
node.modal_color_list[i].addEventListener('pointerdown', function(event) {135
state.color = i;136
});137
}138
}203
document.addEventListener('dragstart', function(event) {204
event.preventDefault();205
});206
document.addEventListener('contextmenu', function(event) {207
event.preventDefault();208
});139
document.addEventListener('dragstart', prevent);140
document.addEventListener('contextmenu', prevent);141
scale_range.addEventListener('input', function(event) {210
radius = parseInt(scale_range.value);142
state.radius = parseInt(scale_range.value);143
left_modal = false;212
point.x = parseInt(window.innerWidth / 2);213
point.y = parseInt(window.innerHeight / 2);144
// point.x = parseInt(window.innerWidth / 2);145
// point.y = parseInt(window.innerHeight / 2);146
});147
document.addEventListener('wheel', function(event) {216
if(device !== 'gamepad') {217
let { deltaY } = event;218
let y = deltaY < 0 ? 1 : -1;219
if(radius + y > 2 - 1 && radius + y < 50 + 1) {220
radius += y;221
scale_range.value = radius;148
if(state.device === 'mouse') {149
let y = event.deltaY < 0 ? 1 : -1;150
if(state.radius + y > 2 - 1 && state.radius + y < 50 + 1) {151
state.radius += y;152
scale_range.value = state.radius;153
}154
}155
});156
document.addEventListener('wheel', function(event) {226
if(device !== 'gamepad') {227
let { ctrlKey } = event;228
if(ctrlKey) {157
if(state.device === 'mouse') {158
if(event.ctrlKey) {159
event.preventDefault();160
return;161
}162
}163
}, { passive: false });234
canvas.addEventListener('pointerdown', function(event) {235
let { layerX, layerY, buttons, pointerType, target } = event;236
if(!devices.touch && pointerType === 'touch') {237
devices.touch = true;238
if(device) {239
show_notification('notification.input-device.touch.add');240
}241
}242
if(!devices.pen && pointerType === 'pen') {243
devices.pen = true;244
show_notification('notification.input-device.pencil.add');245
}246
if(device !== 'gamepad') {247
if(!lock_x) {248
start.x = layerX;249
}250
if(!lock_y) {251
start.y = layerY;252
}253
if(current_modal && target === canvas) {254
toggle_modal(current_modal);255
left_modal = true;256
}257
else {258
left_modal = false;259
}260
if(device === pointerType) {261
if(!current_modal && !left_modal) {262
if(start.x !== null && start.y !== null) {263
if(buttons == 1) {264
draw_line(start, null, radius, COLOR[index]);265
}266
if(buttons == 2) {267
draw_line(start, null, radius, 'white');268
erase = true;269
last.x = null;270
last.y = null;271
}165
document.addEventListener('pointerdown', function(event) {166
if(state.device !== 'gamepad') {167
if(state.device === event.pointerType) {168
if(event.target === canvas.get_canvas()) {169
canvas.on_press(event);171
ad.style.pointerEvents = 'none';172
hotbar.style.pointerEvents = 'none';173
toolbar.style.pointerEvents = 'none';174
actionbar.style.pointerEvents = 'none';175
for(let modal of node.modal_list) {176
modal.style.pointerEvents = 'none';177
}178
}274
ad.style.pointerEvents = 'none';275
hotbar.style.pointerEvents = 'none';276
toolbar.style.pointerEvents = 'none';277
actionbar.style.pointerEvents = 'none';278
for(let modal of modals) {279
modal.style.pointerEvents = 'none';280
}179
}180
}181
});182
document.addEventListener('pointermove', function(event) {285
let { layerX, layerY, target, pointerType, buttons } = event;286
if(!devices.mouse && pointerType === 'mouse') {287
devices.mouse = true;288
}289
if(device !== 'gamepad') {290
draw = buttons == 1;291
erase = buttons == 2;292
if(buttons == 3) {293
draw = true;294
erase = true;295
}296
if(start.x !== null || start.y !== null) {297
last = start;298
start = {299
x: null,300
y: null301
};302
}303
if(device === pointerType) {304
left_modal = false;305
if(target == canvas) {306
if(!lock_x) {307
point.x = layerX;308
}309
if(!lock_y) {310
point.y = layerY;311
}312
}313
if(draw && erase) {314
last.x = null;315
last.y = null;183
if(state.device !== 'gamepad') {184
if(state.device === event.pointerType) {185
if(event.target === canvas.get_canvas()) {186
canvas.on_move(event, state);187
}188
}318
if(!document.hasFocus()) {319
draw = false;320
erase = false;321
}189
}190
});324
document.addEventListener('pointerout', function(event) {325
if(device !== 'gamepad') {326
if(!lock_x && !lock_y) {327
point.x = null;328
point.y = null;191
document.addEventListener('pointerup', function(event) {192
if(state.device !== 'gamepad') {193
if(state.device === event.pointerType) {194
canvas.on_release(event);196
ad.style.pointerEvents = '';197
hotbar.style.pointerEvents = '';198
toolbar.style.pointerEvents = '';199
actionbar.style.pointerEvents = '';200
for(let modal of node.modal_list) {201
modal.style.pointerEvents = '';202
}203
}204
}205
});332
document.addEventListener('pointerup', function(event) {333
if(device !== 'gamepad') {334
let { buttons } = event;335
draw = buttons == 1;336
erase = buttons == 2;337
last.x = null;338
last.y = null;339
ad.style.pointerEvents = '';340
hotbar.style.pointerEvents = '';341
toolbar.style.pointerEvents = '';342
actionbar.style.pointerEvents = '';343
for(let modal of modals) {344
modal.style.pointerEvents = '';206
document.addEventListener('pointerout', function(event) {207
if(state.device !== 'gamepad') {208
if(state.device === event.pointerType) {209
canvas.on_release(event);210
}211
}212
});214
document.addEventListener('keydown', function(event) {349
let { code, ctrlKey, shiftKey, altKey } = event;350
if(device !== 'gamepad') {215
if(state.device !== 'gamepad') {216
let lock = event.getModifierState("CapsLock");352
if(!ctrlKey && !shiftKey && !altKey) {353
if(code === 'KeyX') {354
lock_y = !lock_y;355
lock_x = false;356
}357
if(code === 'KeyZ') {358
lock_x = !lock_x;359
lock_y = false;360
}217
if(!event.ctrlKey && !event.shiftKey && !event.altKey) {218
if(!lock) {362
if(code.startsWith('Digit')) {363
let number = parseInt(code.substr(5)) - 1;364
if(number >= 0 && number < COLOR_LENGTH) {365
index = number;366
for(let i in colors) {367
if(COLOR_LENGTH > i) {368
colors[i].classList[i == index ? 'add' : 'remove']('active');219
if(event.code.startsWith('Digit')) {220
let digit = parseInt(event.code.substr(5)) - 1;221
if(digit >= 0 && digit < state.color_list.length) {222
state.color = state.color_list[digit];223
state.index = digit;224
for(let i in node.hotbar_color_list) {225
if(state.color_list.length > i) {226
node.hotbar_color_list[i].classList[i == state.index ? 'add' : 'remove']('active');227
}228
}229
}
231
}232
}233
}376
if(code === 'Escape') {234
if(event.code === 'Escape') {235
if(current_tab) {236
close_tab(current_tab);237
}
240
}241
}242
});385
point = { x: null, y: null };386
last = { x: null, y: null };387
start = { x: null, y: null };388
update();389
}391
function update() {392
if(radius < 2) {393
radius = 2;394
}395
if(radius > 50) {396
radius = 50;397
}398
let gamepad = navigator.getGamepads()[0];399
if(gamepad) {400
if(!devices.gamepad) {401
devices.gamepad = true;402
show_notification('notification.input-device.gamepad.add');403
if(gamepad.vibrationActuator) {404
gamepad.vibrationActuator.playEffect("dual-rumble", {405
startDelay: 0,406
duration: 100,407
weakMagnitude: 1.0,408
strongMagnitude: 1.0409
});410
}411
}412
if(device === 'gamepad') {413
if(point.x == null && point.y == null) {414
point.x = parseInt(window.innerWidth / 2);415
point.y = parseInt(window.innerHeight / 2);416
}417
let input = read(gamepad);418
let speed = 4;419
draw = input.button['A'];420
erase = input.button['B'];421
if(pressed['L2'] && !pressed['R2']) {422
speed = 10;423
}424
if(pressed['R2'] && !pressed['L2']) {425
speed = 1;426
}427
// move428
if(!lock_x) {429
point.x += input.axes['Left'].x * speed;430
if(point.x < 0 ) {431
point.x = 0;432
}433
if(point.x > window.innerWidth) {434
point.x = window.innerWidth;435
}436
}437
if(!lock_y) {438
point.y += input.axes['Left'].y * speed;439
if(point.y < 0) {440
point.y = 0;441
}442
if(point.y > window.innerHeight) {443
point.y = window.innerHeight;444
}445
}446
// colors447
key_pressed('Option', input, function() {448
toggle_modal(colors_modal);449
});450
// capture451
key_pressed('Capture', input, function() {452
toggle_modal(capture_modal);453
});454
// draw455
key_pressed('A', input, function() {456
last.x = null;457
last.y = null;458
if(!current_modal) {459
left_modal = false;460
}461
});462
// erase463
key_pressed('B', input, function() {464
last.x = null;465
last.y = null;466
if(current_tab) {467
close_tab(current_tab);468
left_modal = true;469
}470
else if(current_modal) {471
toggle_modal(current_modal);472
left_modal = true;473
}474
else {475
left_modal = false;476
}477
});478
// sprint479
key_pressed('L2', input);480
// sneak481
key_pressed('R2', input);482
// clear483
key_pressed('Y', input, function() {484
toggle_modal(clear_modal);485
});486
// radius487
let y = -(input.axes['Right'].y / 2);488
if(y !== 0 && radius + y > 2 && radius + y < 50 + 1) {489
radius += y;490
scale_range.value = radius;491
}492
// lock y493
key_pressed('L3', input, function() {494
lock_y = !lock_y;495
lock_x = false;496
});497
// lock x498
key_pressed('R3', input, function() {499
lock_x = !lock_x;500
lock_y = false;501
});502
// color-wheel left503
key_pressed('L1', input, function() {504
if(index > 0) {505
index--;506
for(let i in colors) {507
if(COLOR_LENGTH > i) {508
colors[i].classList[i == index ? 'add' : 'remove']('active');509
}510
}511
}512
});513
// color-wheel right514
key_pressed('R1', input, function() {515
if(index < COLOR_LENGTH - 1) {516
index++;517
for(let i in colors) {518
if(COLOR_LENGTH > i) {519
colors[i].classList[i == index ? 'add' : 'remove']('active');520
}521
}522
}523
});524
key_pressed('Up', input, function() {525
if(arrow_y > 0) {526
arrow_y--;527
}528
});529
key_pressed('Down', input, function() {530
if(arrow_y < 10) {531
arrow_y++;532
}533
});534
key_pressed('Left', input, function() {535
if(arrow_x > 0) {536
arrow_x--;537
}538
});539
key_pressed('Right', input, function() {540
if(arrow_x < 4) {541
arrow_x++;542
}543
});544
}545
}546
else {547
if(devices.gamepad) {548
devices.gamepad = false;549
show_notification('notification.input-device.gamepad.remove');550
}551
}552
if(device !== 'gamepad') {553
let pos = arrow_y * 5 + arrow_x;554
if(modal_colors[pos].classList.contains('focus')) {555
modal_colors[pos].classList.remove('focus');556
}557
}558
// device mouse option559
let mouse_option = document.querySelector('.settings-modal .device-tab .item[data-device="mouse"]');560
if(devices.mouse && mouse_option.classList.contains('inactive')) {561
mouse_option.classList.remove('inactive');562
if(!device) {563
device = 'mouse';564
fallback_device = 'mouse';565
mouse_option.classList.add('active');566
}567
}568
// device touch option569
let touch_option = document.querySelector('.settings-modal .device-tab .item[data-device="touch"]');570
if(devices.touch && touch_option.classList.contains('inactive')) {571
touch_option.classList.remove('inactive');572
if(!device) {573
device = 'touch';574
fallback_device = 'touch';575
touch_option.classList.add('active');576
}577
}578
// device pen option579
let pen_option = document.querySelector('.settings-modal .device-tab .item[data-device="pen"]');580
if(devices.pen && pen_option.classList.contains('inactive')) {581
pen_option.classList.remove('inactive');582
if(!device) {583
device = 'pen';584
fallback_device = 'pen';585
pen_option.classList.add('active');586
}587
}588
// device gamepad option589
let gamepad_option = document.querySelector('.settings-modal .device-tab .item[data-device="gamepad"]');590
if(devices.gamepad && gamepad_option.classList.contains('inactive')) {591
gamepad_option.classList.remove('inactive');592
if(!device) {593
device = 'gamepad';594
fallback_device = 'gamepad';595
gamepad_option.classList.add('active');596
}597
}598
if(!devices.gamepad && !gamepad_option.classList.contains('inactive')) {599
gamepad_option.classList.add('inactive');600
gamepad_option.classList.remove('active');601
if(device === 'gamepad') {602
if(device !== fallback_device) {603
device = fallback_device;604
let option = document.querySelector(`.settings-modal .device-tab .item[data-device="${device}"]`);605
option.classList.add('active');606
}607
else {608
device = null;609
}610
point.x = null;611
point.y = null;612
last.x = null;613
last.y = null;614
}615
}616
// cursor visible617
canvas.style.cursor = device === 'mouse' ? 'none' : 'default';618
if(!current_modal && !left_modal) {619
// pencil620
if(draw && !erase) {621
if(point.x !== null && point.y !== null) {622
if(last.x !== null && last.y !== null) {623
draw_line(point, last, radius, COLOR[index]);624
}625
}626
}627
// eraser628
if(erase && !draw) {629
if(point.x !== null && point.y !== null) {630
if(last.x !== null && last.y !== null) {631
draw_line(point, last, radius, 'white');632
}633
}634
}635
}636
// at least one device637
let one_device = Object.values(devices).some(function(device) {638
return device;639
});640
if(one_device && !device_empty.classList.contains('hidden')) {641
device_empty.classList.add('hidden');642
}643
if(!one_device && device_empty.classList.contains('hidden')) {644
device_empty.classList.remove('hidden');645
}646
// navigate colors647
let pos = arrow_y * 5 + arrow_x;648
if(device === 'gamepad') {649
for(let [ i, item ] of Object.entries(modal_colors)) {650
item.classList[parseInt(i) == pos ? 'add' : 'remove']('focus');651
}652
}653
render();654
if(draw || erase) {655
last.x = point.x;656
last.y = point.y;657
}658
requestAnimationFrame(update);243
// point = { x: null, y: null };244
// last = { x: null, y: null };245
// start = { x: null, y: null };246
}248
/*249
function render() {662
if(radius < 2) {663
radius = 2;250
if(state.radius < 2) {251
state.radius = 2;252
}253
o.clearRect(0, 0, window.innerWidth, window.innerHeight);254
if(point.x !== null && point.y !== null) {667
let touch_device = (device === 'touch' || device === 'pen');255
let touch_device = (state.device === 'touch' || state.device === 'pen');256
if(touch_device) {257
if(!left_modal) {258
o.fillStyle = 'white';259
o.beginPath();672
o.arc(point.x, point.y, parseInt(radius) + 2, 2 * Math.PI, 0);260
o.arc(point.x, point.y, parseInt(state.radius) + 2, 2 * Math.PI, 0);261
o.fill();674
o.fillStyle = COLOR[index];262
o.fillStyle = COLOR[state.index];263
o.beginPath();676
o.arc(point.x, point.y, parseInt(radius), 2 * Math.PI, 0);264
o.arc(point.x, point.y, parseInt(state.radius), 2 * Math.PI, 0);265
o.fill();266
}267
}268
else {269
o.fillStyle = 'white';270
o.beginPath();683
o.arc(point.x, point.y, parseInt(radius) + 2, 2 * Math.PI, 0);271
o.arc(point.x, point.y, parseInt(state.radius) + 2, 2 * Math.PI, 0);272
o.fill();685
o.fillStyle = COLOR[index];273
o.fillStyle = COLOR[state.index];274
o.beginPath();687
o.arc(point.x, point.y, parseInt(radius), 2 * Math.PI, 0);275
o.arc(point.x, point.y, parseInt(state.radius), 2 * Math.PI, 0);276
o.fill();277
}278
}
281
o.beginPath();282
o.lineWidth = 2;283
o.strokeStyle = 'white';696
o.moveTo(point.x, point.y - parseInt(radius) * 0.5);697
o.lineTo(point.x, point.y + parseInt(radius) * 0.5);698
o.moveTo(point.x - parseInt(radius) * 0.5, point.y);699
o.lineTo(point.x + parseInt(radius) * 0.5, point.y);284
o.moveTo(point.x, point.y - parseInt(state.radius) * 0.5);285
o.lineTo(point.x, point.y + parseInt(state.radius) * 0.5);286
o.moveTo(point.x - parseInt(state.radius) * 0.5, point.y);287
o.lineTo(point.x + parseInt(state.radius) * 0.5, point.y);288
o.stroke();289
}290
}
293
o.lineWidth = 2;294
o.strokeStyle = 'white';295
if(lock_x) {708
o.moveTo(point.x, point.y - parseInt(radius));709
o.lineTo(point.x, point.y + parseInt(radius));296
o.moveTo(point.x, point.y - parseInt(state.radius));297
o.lineTo(point.x, point.y + parseInt(state.radius));298
}299
if(lock_y) {712
o.moveTo(point.x - parseInt(radius), point.y);713
o.lineTo(point.x + parseInt(radius), point.y);300
o.moveTo(point.x - parseInt(state.radius), point.y);301
o.lineTo(point.x + parseInt(state.radius), point.y);302
}303
o.stroke();304
}305
}306
*/719
function draw_line(point, last, radius, color) {720
if(last) {721
g.lineCap = 'round';722
g.strokeStyle = color;723
g.lineWidth = 2 * parseInt(radius);724
g.beginPath();725
g.moveTo(last.x + 0.5, last.y + 0.5);726
g.lineTo(point.x + 0.5, point.y + 0.5);727
g.stroke();728
}729
else {730
g.fillStyle = color;731
g.beginPath();732
g.arc(point.x, point.y, parseInt(radius), 2 * Math.PI, 0);733
g.fill();734
}735
}737
function change_device(element) {738
let value = element.dataset.device;739
if(devices[value]) {740
device = value;741
for(let item of device_options) {742
item.classList[element === item ? 'add' : 'remove']('active');743
}744
if(device !== 'gamepad') {745
point.x = null;746
point.y = null;747
last.x = null;748
last.y = null;749
}308
function init_custom() {309
// language310
let language_elements = document.querySelectorAll('[data-event="change.language"]');311
for(let item of language_elements) {312
item.addEventListener('click', function(event) {313
let code = item.dataset.code;314
locale.change(code);315
for(let sub_item of language_elements) {316
sub_item.classList[item === sub_item ? 'add' : 'remove']('active');317
}318
});319
}751
}753
function change_language(element) {754
let code = element.dataset.code;755
lang = code;756
let items = document.querySelectorAll('[data-lang]');757
for(let item of items) {758
let prime = item.dataset.prime === 'true';759
let beta = item.dataset.beta === 'true';760
let type = item.dataset.type;761
let text = LANG[code][item.dataset.lang];762
let prime_content;763
let beta_content;764
if(prime) {765
prime_content = item.querySelector('b.prime-badge').textContent;766
}767
if(beta) {768
beta_content = item.querySelector('b.beta-badge').textContent;769
}770
if(text) {771
if(type === 'tooltip') {772
item.dataset.title = text;320
document.addEventListener('pointerdown', function(event) {321
// detect touch322
if(!state.device_list.touch && event.pointerType === 'touch') {323
state.device_list.touch = true;324
if(state.device) {325
show_notification('notification.input-device.touch.add');326
}327
else {775
item.textContent = text;328
state.device = 'touch';329
state.device_fallback = 'touch';330
}777
if(prime && type !== 'tooltip') {778
item.innerHTML += `<b class="prime-badge">${prime_content}</b>`;331
update_device_list();332
}333
// detect pen334
if(!state.device_list.pen && event.pointerType === 'pen') {335
state.device_list.pen = true;336
show_notification('notification.input-device.pencil.add');337
if(!state.device) {338
state.device = 'pen';339
state.device_fallback = 'pen';340
}780
if(beta && type !== 'tooltip') {781
item.innerHTML += `<b class="beta-badge">${beta_content}</b>`;341
update_device_list();342
}343
});344
document.addEventListener('pointermove', function(event) {345
// detect mouse346
if(!state.device_list.mouse && event.pointerType === 'mouse') {347
state.device_list.mouse = true;348
if(state.device) {349
show_notification('notification.input-device.mouse.add');350
}351
else {352
state.device = 'mouse';353
state.device_fallback = 'mouse';354
}355
update_device_list();356
}357
});358
// device359
let device_elements = document.querySelectorAll('[data-event="change.device"]');360
for(let item of device_elements) {361
item.addEventListener('click', function(event) {362
let code = item.dataset.code;363
if(state.device_list[code]) {364
state.device = code;365
if(state.device !== 'gamepad') {366
// point = { x: null, y: null };367
// last = { x: null, y: null };368
}369
for(let sub_item of device_elements) {370
sub_item.classList[item === sub_item ? 'add' : 'remove']('active');371
}372
update_device_list();373
}374
});375
}785
let options = document.querySelectorAll('.language-tab .item');786
for(let option of options) {787
option.classList[option === element ? 'add' : 'remove']('active');376
}378
function update_device_list() {379
for(let item of node.device_list) {380
let code = item.dataset.code;381
item.classList[code === state.device ? 'add' : 'remove']('active');382
item.classList[state.device_list[code] ? 'remove' : 'add']('inactive');383
}384
}
400
item.classList.remove('active');401
}402
}808
for(let item of modals) {403
for(let item of node.modal_list) {404
if(item !== modal) {405
item.classList.add('hidden');406
}
418
}419
}420
if(code === 'colors') {826
if(device === 'gamepad') {827
modal_colors[0].classList.add('focus');828
arrow_x = 0;829
arrow_y = 0;421
if(state.device === 'gamepad') {422
node.modal_color_list[0].classList.add('focus');423
}424
}425
}
468
notification_code = code;469
let element = document.querySelector('.notification');470
let content = element.querySelector('.content');878
content.textContent = LANG[lang][message];471
content.textContent = locale.get()[message];472
element.animate([473
{ opacity: 0 },474
{ opacity: 1}
490
}492
function clear_screen() {900
g.clearRect(0, 0, canvas.width, canvas.height);493
canvas.clear();494
show_notification('notification.clear');495
toggle_modal(clear_modal);496
}
1
const LINE_BREAK_PATTERN = /\r\n|\r|\n/;2
const PROPERTY_PATTERN = /^([\w+.-]+)=([^=]*)$/;4
/**5
Reads all properties files in the given directory and specified locale code.7
@async8
@function load9
@param {string} path - The path to the locale files.10
@param {string[]} locales - The list containing all locales.11
@return {Object} The locale object.12
*/13
async function load(path, locales) {14
let result = {};15
for(let code of locales) {16
let text = await fetch(`${path}/${code}.properties`)17
.then(function(response) {18
if(!response.ok) {19
throw new Error('(404) Not Found');20
}21
return response.text();22
})23
.catch(function(error) {24
console.error(`No properties file found for locale '${code}'!`, error);25
});26
if(text) {27
result[code] = parse(text);28
}29
}30
return result;31
}33
/**34
Converts properties text to a locale object.36
@function parse37
@param {string} text - Raw properties text data.38
@return {Object} The locale object.39
*/40
function parse(text) {41
let result = {};42
for(let line of text.split(LINE_BREAK_PATTERN)) {43
let match = PROPERTY_PATTERN.exec(line);44
if(match) {45
result[match[1]] = match[2];46
}47
}48
return result;49
}51
export { load, parse };
62
}63
}65
export { uuid, html, query };65
/**66
Prevents an event.68
@function prevent69
@param {Event} event - The event to prevent.70
*/71
function prevent(event) {72
event.preventDefault();73
}75
export { uuid, html, query, prevent };
21
pointer-events: none;22
}24
.prime-badge {24
.badge {25
display: inline-block;26
margin-top: -1px;27
margin-left: 5px;28
padding: 2px 4px;29
background: #0372EF;29
border-radius: 2px;30
font-weight: 500;31
font-size: 12px;32
color: white !important;34
}36
.beta-badge {37
display: inline-block;38
margin-top: -1px;39
margin-left: 5px;40
padding: 2px 4px;41
background: #388E3C;42
border-radius: 2px;43
font-weight: 500;44
font-size: 12px;45
color: white !important;34
&.prime {35
background: #0372EF;36
}38
&.beta {39
background: #388E3C;40
}41
}43
.controls {
192
}193
}195
.capture-modal {196
top: calc(50% - 250px);197
left: calc(50% - 200px);198
width: 400px;199
height: 500px;200
display: grid;202
.text-save {203
font-size: 20px;204
width: 380px;205
height: px;206
text-align: center;207
align-items: center;208
margin-top: 20px;209
}211
.preview {212
height: 250px;213
background: #F5F5F5;214
border: 1px solid #f1f1f1;215
border-radius: 3px;216
margin-top: 20px;217
margin-left: 20px;218
margin-right: 20px;219
}221
.action-file {222
border-radius: 3px;223
border: 2px solid #f1f1f1;224
height: 50px;225
margin-top: 10px;226
margin-left: 20px;227
margin-right: 20px;228
padding: 0px 0px 0px 10px;229
font-size: 15px;230
}232
.align {233
display: flex;234
margin-top: auto;235
margin-bottom: 20px;237
.btn-cancel {238
width: 170px;239
height: 50px;240
border: none;241
border-radius: 3px;242
background-color: #F5F5F5;243
font-size: 17px;244
margin-left: 20px;246
&:hover {247
background-color: #E0E0E0;248
}249
}251
.btn-apply {252
width: 170px;253
height: 50px;254
border: none;255
border-radius: 3px;256
border-color: grey;257
background-color: #F5F5F5;258
margin-left: 20px;259
font-size: 17px;261
&:hover {262
background-color: #E0E0E0;263
}264
}265
}266
}268
.toolbar {269
top: 20px;270
left: 20px;
316
}317
}319
.colors-modal {320
flex-wrap: wrap;321
min-width: 410px;322
width: 410px;323
max-width: 410px;324
padding: 30px !important;325
top: calc(50% - 421px);326
left: calc(50% - 205px);327
display: flex;328
gap: 12px;330
.color {331
width: 60px;332
height: 60px;333
border-radius: 30px;334
background: #EEE;335
cursor: pointer;336
transition: transform 0.2s;337
transform: scale(0.9);339
&:not(.active):hover {340
transform: scale(1);341
}343
&.active {344
transform: scale(1.1);345
}347
&.focus {348
transform: scale(1);349
}350
}351
}353
.multiplayer-modal {354
top: 75px;355
right: 120px;
380
right: 20px;381
}281
.colors-modal {282
flex-wrap: wrap;283
width: 425px;284
max-width: 425px;285
min-width: 425px;286
height: 860px;287
padding: 30px !important;288
top: calc(50% - 430px);289
left: calc(50% - 212.5px);291
.color {292
margin: 6px;293
width: 60px;294
height: 60px;295
border-radius: 30px;296
background: #EEE;297
cursor: pointer;298
transition: transform 0.2s;299
transform: scale(0.9);301
&:not(.active):hover {302
transform: scale(1);303
}305
&.active {306
transform: scale(1.1);307
}309
&.focus {310
transform: scale(1);311
}312
}313
}383
.modal {384
width: 250px;385
position: fixed;