A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
24
this.loading = true;25
const result = await http`get::/api/favorite`();26
this.loading = false;27
this.results = result.data;27
this.results = result;28
}29
},30
mounted() {
29
this.loading = true;30
const result = await http`get::/api/search`(this.query);31
this.loading = false;32
this.results = result.data;32
this.results = result;33
}34
},35
mounted() {
44
type="text"45
:placeholder="$lang('search.input.placeholder')"46
class="w-full h-[56px] px-5 text-lg rounded-lg bg-zinc-900 text-white font-medium placeholder:font-normal placeholder:text-gray-500 focus:placeholder:text-gray-600 outline-none"47
spellcheck="false"48
autocomplete="off"49
>50
<ul class="flex flex-col">51
<li
13
const line = ltr(parts, values).trim();14
const regex = /^(\w+)::([\w\/.]*)$/;15
const [, method, path] = line.match(regex) ?? [];16
return (data) => {16
return (query) => {17
return new Promise(async (resolve, reject) => {18
try {19
const headers = {
26
let body = null;27
let params = '';28
if(method === 'get' || method === 'head') {29
params = '?' + new URLSearchParams(data).toString();29
params = '?' + new URLSearchParams(query).toString();30
}31
else {32
body = JSON.stringify(data);32
body = JSON.stringify(query);33
}34
const response = await fetch(window.location.origin + path + params, {35
method,36
headers,37
body38
});39
resolve(await response.json());39
const json = await response.json();40
const {ok, data, error} = json;41
if(ok === undefined) {42
resolve(json);43
return;44
}45
if(!ok) {46
reject(`[${error.kind}] ${error.message}`);47
return;48
}49
resolve(data);50
}51
catch(error) {52
reject(error);
1
{2
"scripts": {3
"build": "npx tailwindcss -i ./www/asset/css/input.css -o ./www/asset/css/style.css --minify"3
"build": "npx tailwindcss -i ./www/asset/css/input.css -o ./www/asset/css/style.css --minify"4
},5
"devDependencies": {6
"tailwindcss": "^3.0.23"