This commit is contained in:
2026-02-17 14:18:28 +01:00
parent 0d7dbf7d87
commit e6eb10f89a
5 changed files with 134 additions and 0 deletions

31
gui.rkt Normal file
View File

@@ -0,0 +1,31 @@
#lang racket
(require web-racket
racket/runtime-path
)
(provide
(all-from-out web-racket)
rktplayer%
)
(define-runtime-path rktplayer-start "rktplayer.html")
(define rktplayer%
(class ww-webview%
(inherit-field settings)
(super-new
[html-file rktplayer-start]
)
(define/override (html-loaded)
(super html-loaded)
)
(begin
(displayln "RktPlayer started")
)
)
)

13
play.svg Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg fill="#000000" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 58.752 58.752" xml:space="preserve">
<g>
<path d="M52.524,23.925L12.507,0.824c-1.907-1.1-4.376-1.097-6.276,0C4.293,1.94,3.088,4.025,3.088,6.264v46.205
c0,2.24,1.204,4.325,3.131,5.435c0.953,0.555,2.042,0.848,3.149,0.848c1.104,0,2.192-0.292,3.141-0.843l40.017-23.103
c1.936-1.119,3.138-3.203,3.138-5.439C55.663,27.134,54.462,25.05,52.524,23.925z M49.524,29.612L9.504,52.716
c-0.082,0.047-0.18,0.052-0.279-0.005c-0.084-0.049-0.137-0.142-0.137-0.242V6.263c0-0.1,0.052-0.192,0.14-0.243
c0.042-0.025,0.09-0.038,0.139-0.038c0.051,0,0.099,0.013,0.142,0.038l40.01,23.098c0.089,0.052,0.145,0.147,0.145,0.249
C49.663,29.47,49.611,29.561,49.524,29.612z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 972 B

35
rktplayer.html Normal file
View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css" />
<meta charset="UTF-8" />
<title>RktPlayer - A music player</title>
</head>
<body>
<div class="pane">
<div class="buttons">
<button id="prev" class="command"><img id="previous-img" src="previous.svg" /></button>
<button id="play" class="command"><img id="play-img" src="play.svg" /></button>
<button id="next" class="command"><img id="next-img" src="next.svg" /></button>
<span id="slider" class="h-slider"></span>
<span id="time" class="time">0:00</span>
<span id="totaltime" class="time">0:00</span>
<button id="repeat" class="command"><img id="repeat-img" src="repeat.svg" /></button>
<button id="volume" class="command"><img id="volume-img" src="repeat.svg" /></button>
</div>
<div class="left-panel">
<div class="music-library">
Library
</div>
<div class="album-art">
Album art
</div>
</div>
<div class="right-panel">
<div class="music-playing">
Music playing
</div>
</div>
</div>
</body>
</html>

14
rktplayer.rkt Normal file
View File

@@ -0,0 +1,14 @@
#lang racket
(require "gui.rkt"
simple-ini/class
)
(define (run)
(let* ((ini (new ini% [file 'rktplayer]))
(settings (new ww-simple-ini% [ini ini] [section 'player]))
(window (new rktplayer% [settings settings]))
)
window)
)

41
styles.css Normal file
View File

@@ -0,0 +1,41 @@
body {
font-family: Arial;
font-size: 11pt;
}
.pane {
height: 100%;
width: 100%;
}
.buttons {
height: 40px;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
button.command {
margin: 0;
padding: 0;
width: 40px;
height: 40px;
}
button.command img {
height: 32px;
width: 32px;
margin: 0;
padding: 2px;
}
span.h-slider {
flex-grow: 1;
}
.buttons span.time {
width: 5em;
font-weight: bold;
text-align: center;
}