forked from theaquarium/nshs-schedule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathother.js
83 lines (74 loc) · 2.8 KB
/
other.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
const lionTigerBlockTitle = document.querySelector('.lion-tiger-block-title');
// Initial values
document.querySelector('.schedule-title').value = UserSettings.title;
document.querySelector('.use24h').checked = UserSettings.use24h;
document.querySelector('.north').checked = UserSettings.north;
lionTigerBlockTitle.innerHTML = UserSettings.north ? 'Tiger' : 'Lion';
document.querySelector('.useColors').checked = !UserSettings.useColors;
document.querySelector('.affirmation').value = UserSettings.affirmation;
document.querySelector('.schedule-title').addEventListener('input', () => {
UserSettings.title = document.querySelector('.schedule-title').value;
draw();
});
document.querySelector('.use24h').addEventListener('change', () => {
UserSettings.use24h = document.querySelector('.use24h').checked;
draw();
});
document.querySelector('.north').addEventListener('change', () => {
UserSettings.north = document.querySelector('.north').checked;
lionTigerBlockTitle.innerHTML = UserSettings.north ? 'Tiger' : 'Lion';
draw();
});
document.querySelector('.useColors').addEventListener('change', () => {
UserSettings.useColors = !document.querySelector('.useColors').checked;
draw();
});
document.querySelector('.affirmation').addEventListener('input', () => {
UserSettings.affirmation = document.querySelector('.affirmation').value;
draw();
});
// Buttons
document.querySelector('.save-button').addEventListener('click', () => {
saveBase64(canvasToBase64(), 'schedule.png');
});
document.querySelector('.print-button').addEventListener('click', () => {
printBase64(canvasToBase64());
});
document.querySelector('.share-button').addEventListener('click', () => {
shareCanvas('schedule.png');
});
const affirmations = [
"You're doing an amazing job, have a great day!",
"You're doing great today!",
"You've got this!",
'Have a great day!',
"You're going to do great today!",
'This is your moment!',
'The sky is the limit!',
'You are unique and wonderful.',
'Make today your day!',
'Be yourself!',
'You are valid.',
'Every day is an opportunity!',
'You are amazing!',
'Follow your feelings.',
'Love yourself.',
'Make today go how you want it.',
'Have an amazing day!',
'You are awesome!',
'You are unstoppable!',
'Today is your day!',
"You're wonderful!",
"Show everyone what you're made of!",
'You are loved.',
'Take care of yourself.',
'Take care of yourself today.',
'You deserve the best.',
'You deserve the best.',
];
document.querySelector('.new-affirmation').addEventListener('click', () => {
UserSettings.affirmation =
affirmations[Math.floor(Math.random() * affirmations.length)];
document.querySelector('.affirmation').value = UserSettings.affirmation;
draw();
});