-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from mbaraa/feat/add-to-playlist-popup
Feat: add to playlist popup
- Loading branch information
Showing
11 changed files
with
123 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
root = "." | ||
|
||
[build] | ||
bin = "./dankmuzikk serve" | ||
cmd = "go generate && go build" | ||
delay = 100 | ||
exclude_dir = [ | ||
"assets", | ||
"tmp", | ||
"vendor", | ||
"_db", | ||
"_serve", | ||
"node_modules", | ||
"ytscraper", | ||
"ytdl", | ||
] | ||
exclude_file = [] | ||
exclude_regex = [".*_templ.go"] | ||
exclude_unchanged = false | ||
follow_symlink = false | ||
full_bin = "" | ||
include_dir = [] | ||
include_ext = ["go", "tpl", "tmpl", "templ", "html", "js", "css"] | ||
kill_delay = "0s" | ||
log = "build-errors.log" | ||
send_interrupt = true | ||
stop_on_error = true | ||
|
||
[color] | ||
app = "" | ||
build = "yellow" | ||
main = "magenta" | ||
runner = "green" | ||
watcher = "cyan" | ||
|
||
[log] | ||
time = false | ||
|
||
[misc] | ||
clean_on_exit = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,19 +6,16 @@ BINARY_NAME=dankmuzikk | |
build: | ||
npm i && \ | ||
go mod tidy && \ | ||
templ generate && \ | ||
go generate && \ | ||
go build -ldflags="-w -s" -o ${BINARY_NAME} | ||
|
||
generate: | ||
go generate && \ | ||
templ generate | ||
go generate | ||
|
||
init: | ||
npm i && \ | ||
go get && \ | ||
go generate && \ | ||
templ generate && \ | ||
go run main.go migrate | ||
|
||
seed: | ||
|
@@ -27,7 +24,7 @@ seed: | |
# dev runs the development server where it builds the tailwind css sheet, | ||
# and compiles the project whenever a file is changed. | ||
dev: | ||
templ generate --watch --cmd="./run.sh dev" | ||
go run github.com/cosmtrek/[email protected] | ||
|
||
clean: | ||
go clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package popup | ||
|
||
import "fmt" | ||
|
||
templ Popup(id, title string, button, child templ.Component) { | ||
<button | ||
class={ | ||
"popup-trigger", "p-2", "rounded-md", "hover:bg-accent-trans-20", | ||
"flex", "justify-center", "items-center", | ||
} | ||
title={ title } | ||
type="button" | ||
onClick={ toggleTheThing(id) } | ||
> | ||
@button | ||
</button> | ||
<dialog | ||
id={ fmt.Sprintf("popup-%s", id) } | ||
class={ "bg-[#ffffff00]" } | ||
> | ||
<form | ||
class={ } | ||
> | ||
<div class={ "w-full","flex", "justify-end" }> | ||
<button | ||
formmethod="dialog" | ||
type="submit" | ||
class={ | ||
"bg-[#DE3333]", "hover:bg-white", "text-white", "hover:text-[#DE3333]", | ||
"popup-trigger", "p-[5px]", "rounded-t-md", "text-lg", "font-medium", | ||
} | ||
>Close</button> | ||
</div> | ||
@child | ||
</form> | ||
</dialog> | ||
} | ||
|
||
script toggleTheThing(id string) { | ||
const popup = document.getElementById(`popup-${id}`); | ||
popup.showModal(); | ||
popup.addEventListener("click", e => { | ||
const rect = popup.getBoundingClientRect() | ||
if ( | ||
e.clientX < rect.left || | ||
e.clientX > rect.right || | ||
e.clientY < rect.top || | ||
e.clientY > rect.bottom | ||
) { | ||
popup.close() | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package icons | ||
|
||
templ Options() { | ||
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<circle cx="10.5" cy="2.5" r="2.5" fill="var(--secondary-color)"></circle> | ||
<circle cx="10.5" cy="10.5" r="2.5" fill="var(--secondary-color)"></circle> | ||
<circle cx="10.5" cy="18.5" r="2.5" fill="var(--secondary-color)"></circle> | ||
</svg> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters