tangled
alpha
login
or
join now
tokono.ma
/
diffuse-applets
0
fork
atom
Experiment to rebuild Diffuse using web applets.
0
fork
atom
overview
issues
pulls
pipelines
feat: Audio UI styling and various fixes
Steven Vandevelde
1 year ago
e4e7e07e
4188dadf
+89
-24
4 changed files
expand all
collapse all
unified
split
astro.config.mjs
src
applets
themes
pilot
ui
audio
applet.astro
pages
themes
pilot
index.astro
styles
themes
pilot
index.css
-5
astro.config.mjs
reviewed
···
1
1
-
import { defineConfig } from "astro/config";
2
2
-
3
3
-
export default defineConfig({
4
4
-
trailingSlash: "always",
5
5
-
});
+77
-15
src/applets/themes/pilot/ui/audio/applet.astro
reviewed
···
3
3
href="https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css"
4
4
/>
5
5
6
6
-
<div>
7
7
-
<button>▶️</button>
8
8
-
<progress max="100" value="0"></progress>
9
9
-
</div>
6
6
+
<main>
7
7
+
<div class="queue-entry"></div>
8
8
+
<div class="playback-info">
9
9
+
<div class="controls">
10
10
+
<button class="controls__playpause">
11
11
+
<i class="iconoir-play-solid"></i>
12
12
+
</button>
13
13
+
</div>
14
14
+
<div class="time">
15
15
+
<progress max="100" value="0"></progress>
16
16
+
</div>
17
17
+
</div>
18
18
+
<div class="additional"></div>
19
19
+
</main>
10
20
11
21
<style>
12
22
@import "../../../../../styles/themes/pilot/variables.css";
13
23
14
14
-
div {
15
15
-
/* 5% darker version */
16
16
-
background: oklch(from var(--delicate-cloud) calc(l - 0.1) c h);
17
17
-
18
18
-
height: 100px;
19
19
-
line-height: 100px;
24
24
+
main {
25
25
+
align-items: center;
26
26
+
background: var(--made-in-the-shade);
27
27
+
color: oklch(from var(--made-in-the-shade) calc(l + 0.375) c h);
28
28
+
display: flex;
29
29
+
justify-content: center;
20
30
text-align: center;
21
31
}
22
32
23
33
button {
24
24
-
line-height: 1.5;
34
34
+
background: transparent;
35
35
+
border: 0;
36
36
+
color: inherit;
37
37
+
display: inline-block;
38
38
+
line-height: 0;
39
39
+
}
40
40
+
41
41
+
/***********************************
42
42
+
* Playback info
43
43
+
***********************************/
44
44
+
.playback-info {
45
45
+
align-items: center;
46
46
+
display: flex;
47
47
+
flex: 1;
48
48
+
flex-direction: column;
49
49
+
max-width: var(--container-lg);
50
50
+
padding: var(--space-sm) var(--space-md);
51
51
+
}
52
52
+
53
53
+
.controls {
54
54
+
align-items: center;
55
55
+
display: flex;
56
56
+
justify-content: center;
57
57
+
margin-bottom: var(--space-2xs);
58
58
+
59
59
+
& .controls__playpause {
60
60
+
font-size: var(--fs-lg);
61
61
+
}
62
62
+
}
63
63
+
64
64
+
.time {
65
65
+
align-self: stretch;
66
66
+
display: flex;
67
67
+
}
68
68
+
69
69
+
progress {
70
70
+
appearance: none;
71
71
+
border: 0;
72
72
+
flex: 1;
73
73
+
height: 4px;
74
74
+
}
75
75
+
76
76
+
progress::-webkit-progress-bar {
77
77
+
background-color: oklch(from var(--made-in-the-shade) calc(l + 0.15) c h);
78
78
+
overflow: hidden;
79
79
+
border-radius: 4px;
80
80
+
}
81
81
+
82
82
+
progress::-webkit-progress-value {
83
83
+
background-color: oklch(from var(--made-in-the-shade) calc(l + 0.3) c h);
84
84
+
border-radius: 4px;
85
85
+
}
86
86
+
87
87
+
progress::-moz-progress-bar {
25
88
}
26
89
</style>
27
90
···
51
114
52
115
context.setActionHandler("set_progress", (progress: number) => {
53
116
document.body.querySelector("progress").value = Math.round(progress * 100);
54
54
-
render();
55
117
});
56
118
57
119
////////////////////////////////////////////
···
62
124
};
63
125
64
126
function render() {
65
65
-
document.body.querySelector("button").innerText = context.data.isPlaying ? "⏸️" : "▶️";
127
127
+
document.body.querySelector("button").innerHTML = context.data.isPlaying
128
128
+
? `<i class="iconoir-pause-solid"></i>`
129
129
+
: `<i class="iconoir-play-solid"></i>`;
66
130
}
67
67
-
68
68
-
render();
69
131
</script>
+2
-2
src/pages/themes/pilot/index.astro
reviewed
···
6
6
<script src="../../../scripts/themes/pilot/index.js"></script>
7
7
8
8
<!-- Theme applets -->
9
9
-
<iframe id="#applet__ui__audio" src="ui/audio/" frameborder="0" style="width: 100%"></iframe>
9
9
+
<iframe id="applet__ui__audio" src="ui/audio/" frameborder="0"></iframe>
10
10
11
11
<!-- Other applets -->
12
12
-
<iframe id="#applet__engine__audio" src="../../engine/audio/" frameborder="0" height="0" width="0"
12
12
+
<iframe id="applet__engine__audio" src="../../engine/audio/" frameborder="0" height="0" width="0"
13
13
></iframe>
14
14
</Page>
+10
-2
src/styles/themes/pilot/index.css
reviewed
···
21
21
body {
22
22
background-color: var(--delicate-cloud);
23
23
color: var(--made-in-the-shade);
24
24
+
display: flex;
24
25
overflow: hidden;
26
26
+
height: 100dvh;
25
27
}
26
28
27
29
/***********************************
28
28
-
* Applets | Position
30
30
+
* Applets (UI)
29
31
***********************************/
30
32
#applet__ui__audio {
33
33
+
align-self: flex-end;
34
34
+
width: 100%;
31
35
}
32
36
33
33
-
/* Position engines outside the viewframe (no UI for these) */
37
37
+
/***********************************
38
38
+
* Applets (No UI)
39
39
+
* ---------------
40
40
+
* Position engines outside the viewframe
41
41
+
***********************************/
34
42
#applet__engine__audio {
35
43
left: 110vw;
36
44
position: absolute;