A web-based drawing app
git clone git://soophie.de/outline
477
<span data-lang="more.appearance.view-mode.info">Tools and drawing disabled</span>478
</div>479
</li>480
<li class="item ripple" data-event="toggle.dark-mode">481
<i class="ico">toggle_off</i>482
<div class="info">483
<p data-lang="more.appearance.dark-mode">Dark Mode</p>484
<span data-lang="more.appearance.dark-mode.info">More pleasant for your eyes</span>485
</div>486
</li>487
</ul>488
</li>489
</ul>
44
notification.input-device.gamepad.add=Gamepad erkannt45
notification.input-device.gamepad.remove=Gamepad entfernt46
notification.clear=Bildschirm gelöscht47
notification.view-mode.on=View Mode48
notification.view-mode.off=Edit Mode47
notification.view-mode.on=Ansichtmodus48
notification.view-mode.off=Bearbeitungsmodus49
notification.dark-mode.on=Dunkelmodus50
notification.dark-mode.off=Hellmodus52
multiplayer.join=Beitreten53
multiplayer.join.info=Suche nach beitretbaren Channels
46
notification.clear=Screen cleared47
notification.view-mode.on=View Mode48
notification.view-mode.off=Edit Mode49
notification.dark-mode.on=Dark Mode50
notification.dark-mode.off=Light Mode52
multiplayer.join=Join53
multiplayer.join.info=Search for channel to join
46
notification.clear=Écran effacé47
notification.view-mode.on=Mode d'affichage48
notification.view-mode.off=Mode édition49
notification.dark-mode.on=Mode sombre50
notification.dark-mode.off=Mode lumière52
multiplayer.join=Joindre53
multiplayer.join.info=Rechercher une chaîne à rejoindre
46
notification.clear=屏幕清除47
notification.view-mode.on=查看模式48
notification.view-mode.off=编辑模式49
notification.dark-mode.on=暗模式50
notification.dark-mode.off=灯光模式52
multiplayer.join=加入53
multiplayer.join.info=搜索要加入的频道
33
caption: null,34
option: {35
view_mode: false,36
crop_mode: false36
crop_mode: false,37
dark_mode: false38
},39
history: [],40
redo_history: []41
};42
export function init() {43
export async function init() {45
locale.init();45
locale.load('./asset/lang', LOCALES);46
await locale.load('./asset/lang', LOCALES);47
canvas.init();49
node = query({
69
pencil_tool: '.tool-item[data-code="pencil"]',70
option_event_fullscreen: '[data-event="toggle.fullscreen"]',71
option_event_view_mode: '[data-event="toggle.view-mode"]',72
option_event_dark_mode: '[data-event="toggle.dark-mode"]',73
undo_tool: '[data-lang="action.undo"]',74
redo_tool: '[data-lang="action.redo"]',75
colors_modal: '.colors-modal',
114
cookie.requestPermission(node.accept)115
.then(function() {116
node.cookie.classList.add('hidden');115
try {116
firebase.initializeApp(FIREBASE);117
firebase.analytics();118
}119
catch(error) {120
console.warn('Unable to load Google Analytics!');121
}117
load_resources();118
});119
}120
else {121
load_resources();122
}123
}125
function load_resources() {126
let dark_mode = localStorage.getItem('outline.custom.dark-mode');127
if(dark_mode && dark_mode === 'true') {128
document.body.classList.add('theme-dark');129
state.option.dark_mode = true;130
update_dark_mode_option({ passive: true });131
}132
try {133
firebase.initializeApp(FIREBASE);134
firebase.analytics();135
}136
catch(error) {137
console.warn('Unable to load Google Analytics!');138
}139
}141
function bind_events(locale) {
296
state.option.view_mode = !state.option.view_mode;297
update_view_mode_option();298
});299
node.option_event_dark_mode.addEventListener('click', function(event) {300
state.option.dark_mode = !state.option.dark_mode;301
update_dark_mode_option();302
});303
node.undo_tool.addEventListener('click', function(event) {304
canvas.undo(state);305
update_undo_and_redo();
499
}500
}502
const CONFIG_COOKIE_PROPERTY = 'outline.custom.accepted';504
function update_dark_mode_option(args) {505
let { passive = false } = args || {};506
let dark_mode = state.option.dark_mode;507
if(!passive) {508
show_notification(`notification.dark-mode.${dark_mode ? 'on' : 'off'}`);509
}510
node.option_event_dark_mode.classList[dark_mode ? 'add' : 'remove']('active');511
node.option_event_dark_mode.querySelector('.ico').textContent = dark_mode ? 'toggle_on' : 'toggle_off';512
document.body.classList[dark_mode ? 'add' : 'remove']('theme-dark');513
if(cookie.hasAccepted()) {514
localStorage.setItem('outline.custom.dark-mode', dark_mode);515
}516
}518
function update_undo_and_redo() {519
node.undo_tool.classList[state.history.length > 0 ? 'remove' : 'add']('inactive');520
node.redo_tool.classList[state.redo_history.length > 0 ? 'remove' : 'add']('inactive');
102
cookie.requestPermission(node.accept)103
.then(function() {104
node.cookie.classList.add('hidden');105
try {106
firebase.initializeApp(FIREBASE);107
firebase.analytics();108
}109
catch(error) {110
console.warn('Unable to load Google Analytics!');111
}105
load_resources();106
});107
}108
else {109
load_resources();110
}111
}113
function load_resources() {114
let dark_mode = localStorage.getItem('outline.custom.dark-mode');115
if(dark_mode && dark_mode === 'true') {116
document.body.classList.add('theme-dark');117
}118
try {119
firebase.initializeApp(FIREBASE);120
firebase.analytics();121
}122
catch(error) {123
console.warn('Unable to load Google Analytics!');124
}125
}127
function show_notification(message) {
1
@media(prefers-color-scheme: dark) {1
@brand-dark: #333C41;2
@brand-light: #E0E0E0;3
@brand-night: #2D353A;4
@brand-grey: #828282;3
@brand-dark: #333C41;4
@brand-light: #E0E0E0;5
@brand-night: #2D353A;6
@brand-grey: #828282;6
@media(prefers-color-scheme: dark) {8
/* ### Home ### */
436
}437
}438
}440
body.theme-dark {442
/* ### Home ### */444
&.home {445
background: @brand-dark;447
header {448
background-image: url('../asset/img/background-dark.png');450
.brand-logo {452
a {453
background-image: url('../asset/img/brand-logo-dark.png');454
}455
}457
.logo {458
background-image: url('../asset/img/logo-dark.png');459
background-position: center;460
}462
h1.headline {463
color: white;464
}466
p.description {467
color: @brand-light;469
b {470
color: @brand-blue;471
}472
}473
}475
main {476
background: @brand-dark;477
}479
footer {480
background: @brand-night;482
.footer-item {483
color: darken(@brand-light, 20%);484
}485
}487
button.button {489
&.button-prime {490
background: @brand-blue;491
color: white;493
&:hover {494
background: darken(@brand-blue, 2%);495
}496
}498
&.button-default {499
background: darken(@brand-night, 7%);500
color: @brand-light;502
&:hover {503
background: darken(@brand-night, 8%);504
color: lighten(@brand-light, 10%);505
}506
}508
&.button-prime-light {509
background: rgba(@brand-blue, 0.1);510
color: lighten(@brand-blue, 8%);512
&:hover {513
background: rgba(@brand-blue, 0.13);514
color: lighten(@brand-blue, 12%);515
}516
}517
}519
.badge-version {520
background: @brand-night;521
color: @brand-light;522
}524
.caption {526
h2.caption-headline {527
color: white;529
b {530
color: @brand-blue;531
}532
}534
.caption-info {536
p {537
color: @brand-light;538
}539
}540
}541
}543
/* ### App ### */545
.wrapper {546
background: white;547
}549
.header-list {550
background: @brand-dark;551
border-bottom: 1px solid @brand-dark;553
.mainbar,554
.sidebar {556
.tool,557
.action,558
.option {560
ul {562
li {564
&:not(.inactive):not(.active):hover {565
background: rgba(@brand-night, 0.95);567
&.ripple {569
&.ripple-active {570
background: lighten(rgba(@brand-night, 0.95), -2%);571
}572
}573
}575
&.active {576
background: rgba(@brand-night, 0.95);578
&.ripple {580
&.ripple-active {581
background: lighten(rgba(@brand-night, 0.95), -2%);582
}583
}584
}586
&.inactive {588
i.ico {589
color: @brand-grey;591
svg {593
path {594
fill: @brand-grey;595
}596
}597
}598
}600
i.ico {601
color: @brand-light;603
svg {605
path {606
fill: @brand-light;607
}608
}609
}610
}611
}612
}613
}614
}616
.badge {618
&.prime {619
background: @brand-blue;620
}622
&.beta {623
background: @brand-green;624
}625
}627
.key {628
color: @brand-grey-2;629
background: @brand-grey-7;630
border: 1px solid @brand-grey-4;631
}633
.button {634
background: darken(@brand-night, 4%);635
color: @brand-light;637
&:hover {639
&.ripple-active {640
background: darken(@brand-night, 5%);641
}642
}644
&.outline {645
border: 1px solid @brand-grey-5;647
&:hover {649
&.ripple-active {650
background: lighten(white, -2%);651
}652
}653
}655
&.prime {656
background: @brand-blue;657
color: white;659
&:hover {661
&.ripple-active {662
background: lighten(@brand-blue, -2%);663
}664
}665
}667
&.danger {668
background: @brand-red;669
color: white;671
&:hover {673
&.ripple-active {674
background: lighten(@brand-red, -2%);675
}676
}677
}678
}680
.notification {682
p {683
background: @brand-black;684
color: white;685
}686
}688
.controls {690
.hotbar {692
.color {693
background: @brand-bright;694
}695
}697
.scale-modal {699
input[type="range"] {700
background: @brand-grey-1;702
&::-webkit-slider-thumb {703
background: @brand-grey-3;705
&:hover {706
background: darken(@brand-grey-3, 2%);707
}708
}709
}710
}712
.clear-modal {714
.info {715
color: @brand-light;716
}718
.align {720
.btn-apply {721
border-color: grey;722
}723
}724
}726
.colors-modal {728
&::-webkit-scrollbar-thumb {729
background: @brand-night;731
&:hover,732
&:active {733
background: darken(@brand-night, 2%);734
}735
}737
.color {738
background: @brand-bright;739
}740
}741
}743
.modal {744
background: @brand-dark;745
border: 1px solid @brand-dark;747
.header {749
.back {751
i.ico {752
color: @brand-light;753
}755
&:hover {756
background: @brand-night;757
}759
&.ripple {761
&.ripple-active {762
background: lighten(@brand-night, -2%);763
}764
}765
}767
.info {769
p {770
color: @brand-light;771
}773
span {774
color: @brand-grey-3;775
}776
}777
}779
ul.item-list {781
.separator {782
background: lighten(@brand-dark, 5%);783
}785
li.caption {787
p {788
color: @brand-grey-3;789
}790
}792
li.item {794
&.empty {796
p {797
color: @brand-light;798
}799
}801
&:not(.active):not(.inactive) {803
&:hover {804
background: lighten(@brand-dark, -2%);805
}807
&.ripple {809
&.ripple-active {810
background: lighten(@brand-dark, -2%);811
}812
}813
}815
i.ico {816
color: @brand-light;818
svg {820
path {821
fill: @brand-light;822
}823
}824
}826
i.lang {827
color: @brand-light;828
}830
.info {832
p {833
color: @brand-light;834
}836
span {837
color: @brand-grey-3;838
}839
}841
&.active {842
background: @brand-night;844
&.ripple {846
&.ripple-active {847
background: lighten(@brand-night, -2%);848
}849
}850
}852
&.inactive {854
i.ico {855
color: @brand-grey-3;856
}858
.info {860
p {861
color: @brand-grey-3;862
}864
span {865
color: @brand-grey-3;866
}867
}868
}869
}870
}871
}872
}