From 013cb2e96b1c33a013176e39e52ebe86bd766c72 Mon Sep 17 00:00:00 2001 From: Bofh Date: Wed, 23 Nov 2022 01:18:34 +0100 Subject: [PATCH] Create basic #home screen for selecting instances * TODO: create a "+" button to create new (and API for writing config) --- app/home.php | 37 ++++++++++++++++++++++++++++++++++++ css/base.php | 39 +++++++++++++++++++++++++++++++++++++- img/software-mastodon.png | Bin 0 -> 1986 bytes index.php | 23 ++++++++++++++++++---- js/base.php | 9 +++++++++ 5 files changed, 103 insertions(+), 5 deletions(-) create mode 100644 app/home.php create mode 100644 img/software-mastodon.png diff --git a/app/home.php b/app/home.php new file mode 100644 index 0000000..378eaa1 --- /dev/null +++ b/app/home.php @@ -0,0 +1,37 @@ +
+
+
+ +
+ + diff --git a/css/base.php b/css/base.php index f14a601..28effc3 100644 --- a/css/base.php +++ b/css/base.php @@ -2,7 +2,6 @@ body { padding: 0; margin: 0; - padding-top: 1em; font-family: system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,"mastodon-font-sans-serif",sans-serif; } @@ -34,7 +33,45 @@ body { background: #9b1919; } +.window.hidden { display: none !important } +*[id*="-item"] { display: none !important } + +.flex { display: flex } +.center { margin: auto } +.wmax { width: 100vw } +.hmax { height: 100vh } + textarea { max-width: -moz-available; } + +a { + text-decoration: none; + color: inherit; +} + + +/* specific styles */ +#window-home { + background: #d7d7d7; +} +#window-home #instances .item { + padding: .5em; + background: #fff; + border-radius: .5em; + box-shadow: 0px 0px .5em #0000004f; + margin-top: .5em; +} +#window-home #instances .item:hover { + background: #f9f9f9; +} +#window-home #instances .item:active, +#window-home #instances .item:focus { + background: #dfdfdf; +} +#window-home #instances .item img { + width: 2.5em; + height: 2.5em; +} + diff --git a/img/software-mastodon.png b/img/software-mastodon.png new file mode 100644 index 0000000000000000000000000000000000000000..b3eab906142afc23524e3dfa91938562bf927e56 GIT binary patch literal 1986 zcmV;z2R-iCk2?ObSF8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N7% z5k#+`vQW{A;>ClE00Y1Wc0gYH&yQMq3LdN4e%|+WAM=+2kLq%4>nFZ3wpc7yl{(Zc z2U!Z#pezI`70N(U3Z}#rjR;hYM&Y%3C)Wof)U#bSib8x$$*`-T|1z*1zSB= z9YyLd-P^=fi&W>~=~wkG&(c{lanJKjhY)$ckj)0OYt=74UOT4%h=>Lqs}qqz z+UqL8{BhNbz0cg)a5Z}`=H2-4izmKejQ{5XQ(qi7rNVwk?0=S&mG*UgZ+T7{uGuqC z?j@2?^+VaXPRv$GuT!>YOvr8<}K6Kyp~Qu#)0`;uYc=`gf5 +
+ + + + +
diff --git a/js/base.php b/js/base.php index a8ade93..7843e6e 100644 --- a/js/base.php +++ b/js/base.php @@ -41,6 +41,12 @@ var E = { query.remove(); } }, + template: function(_id, cback) { + var tpl = E.elemid(_id+'-item').outerHTML; + tpl = tpl.replace('id="'+_id+'-item"','class="item"'); + tpl = tpl.replace('data-src=', 'src='); + E.elemid(_id).innerHTML = cback(tpl); + }, }; function isVisible(element) { @@ -100,6 +106,9 @@ function _get_func_params(func) { return params; } +function capitalize(str) { + return str[0].toUpperCase() + str.substring(1); +} function printstack() { console.error(new Error().stack) } function uuidv4() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {