diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..4ff0be26 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: grandeljay diff --git a/README.md b/README.md index e210e544..1433bb10 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ your wishes for any kind of occasion ([demo](https://wishthis.online)). ![View wishlist](/src/assets/img/wishlist-view.png "View wishlist") -Join the [Discord](https://discord.gg/WrUXnpNyza)! +Join the conversation on: +* [Discord](https://discord.gg/WrUXnpNyza) +* [Matrix](https://matrix.to/#/#wishthis:matrix.org) ## Warning wishthis is a work in progress and may break at any time. Do not rely on it and make sure you have backups of your data. diff --git a/manifest.json b/manifest.json index 8b8f56ba..96abce83 100644 --- a/manifest.json +++ b/manifest.json @@ -15,6 +15,12 @@ "src": "/src/assets/img/logo-square.svg", "sizes": "any", "purpose": "any" + }, + { + "src": "/src/assets/img/logo-square.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any" } ], "shortcuts": [], diff --git a/src/assets/css/default.css b/src/assets/css/default.css index dafc7374..3876a417 100644 --- a/src/assets/css/default.css +++ b/src/assets/css/default.css @@ -41,6 +41,25 @@ img { height: 100%; } +/** Overlay */ +.ui.card .overlay { + transition: 0.4s ease opacity; + + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + + z-index: 1; + opacity: 0; + + background-color: rgba(255, 255, 255, 0.6); +} +.ui.card:hover .overlay { + opacity: 1; +} + /** Image */ .ui.card > .image > img.preview{ height: 25vh; @@ -56,11 +75,13 @@ img { height: 1.25em; width: auto; - z-index: 1; + z-index: 2; } .ui.card > .image > img.favicon + span.provider { padding-left: 3em; + + z-index: 2; } /** Provider name */ @@ -74,9 +95,7 @@ img { padding: calc(0.91666667em * 1.5) 0.91666667em; line-height: 1; - background-color: rgba(255, 255, 255, 0.6); user-select: none; - opacity: 0; } .ui.card:hover > .image > span.provider { @@ -94,6 +113,7 @@ img { opacity: 0; background-color: transparent; + z-index: 2; } .ui.card:hover > .image > button { animation: buttonWorking 2s linear infinite paused; @@ -114,13 +134,43 @@ img { } /** Content */ -.ui.card > .content > .header + .description, -.ui.card > .content > .meta + .description, -.ui.cards > .card > .content > .header + .description, -.ui.cards > .card > .content > .meta + .description { - max-height: calc(2em * var(--lineHeight)); +.ui.card > .content > .description { + position: absolute; + left: 1em; + right: 1em; + max-height: calc(3em * var(--lineHeight)); +} - overflow: hidden; +.ui.card > .content > .description-fade { + position: absolute; + right: 0; + bottom: 0; + left: 0; + + height: 4em; + width: 100%; + background-image: linear-gradient(0deg, rgba(255,255,255,1) 0.75em, rgba(255,255,255,0.8995799003195029) 45%, rgba(255,255,255,0) 100%); +} + +/** Buttons */ +.ui.card > .extra.buttons, +.ui.cards > .card > .extra.buttons { + transition: 0.4s ease opacity; + + display: flex; + + opacity: 0; + background-color: inherit; + z-index: 2; +} +.ui.card:hover > .extra.buttons, +.ui.cards > .card:hover > .extra.buttons { + opacity: 1; +} + +.ui.card > .extra.buttons > .button, +.ui.cards > .card > .extra.buttons > .button { + flex: 1 1 auto; } /** diff --git a/src/assets/css/install.css b/src/assets/css/install.css deleted file mode 100644 index e69de29b..00000000 diff --git a/src/assets/css/wishlists.css b/src/assets/css/wishlists.css new file mode 100644 index 00000000..6a178f36 --- /dev/null +++ b/src/assets/css/wishlists.css @@ -0,0 +1,6 @@ +/** + * Progress + */ +.ui.progress { + display: none; +} diff --git a/src/assets/img/favicon/site.webmanifest b/src/assets/img/favicon/site.webmanifest index b838a647..13a2e1d7 100644 --- a/src/assets/img/favicon/site.webmanifest +++ b/src/assets/img/favicon/site.webmanifest @@ -13,7 +13,7 @@ "type": "image/png" } ], - "theme_color": "#f4f4f4", + "theme_color": "#5829bb", "background_color": "#f4f4f4", "display": "standalone" } diff --git a/src/assets/img/logo-square.svg b/src/assets/img/logo-square.svg index fa909ed5..c54f2150 100644 --- a/src/assets/img/logo-square.svg +++ b/src/assets/img/logo-square.svg @@ -2,14 +2,14 @@ + transform="translate(157.69673,48.619999)"> + style="font-size:40px;line-height:1.25;font-family:Raleway;-inkscape-font-specification:Raleway;white-space:pre;shape-inside:url(#rect1574);stroke-width:0.338749"> + id="path1932" + style="stroke-width:0.338749" /> + id="path1934" + style="stroke-width:0.338749" /> + id="path1936" + style="stroke-width:0.338749" /> + id="path1938" + style="stroke-width:0.338749" /> diff --git a/src/assets/img/logo.svg b/src/assets/img/logo.svg index 73af77ef..1d5cc899 100644 --- a/src/assets/img/logo.svg +++ b/src/assets/img/logo.svg @@ -2,9 +2,9 @@ + inkscape:showpageshadow="false" + units="px" /> + transform="translate(157.69673,48.619995)"> + style="font-size:40px;line-height:1.25;font-family:Raleway;-inkscape-font-specification:Raleway;white-space:pre;shape-inside:url(#rect1574);stroke-width:0.296016"> + id="path3159" + style="stroke-width:0.296016" /> + id="path3161" + style="stroke-width:0.296016" /> + id="path3163" + style="stroke-width:0.296016" /> + id="path3165" + style="stroke-width:0.296016" /> diff --git a/src/assets/js/wishlists.js b/src/assets/js/wishlists.js index 74eb38f0..dae50bb2 100644 --- a/src/assets/js/wishlists.js +++ b/src/assets/js/wishlists.js @@ -33,10 +33,15 @@ $(function () { /** * Selection */ + var progress = $('.ui.progress'); + $(document).on('change', '.ui.dropdown.wishlists', function () { var wishlistValue = $('.ui.dropdown.wishlists').dropdown('get value'); var wishlistIndex = $('.ui.dropdown.wishlists select').prop('selectedIndex') - 1; + progress.progress('reset'); + progress.addClass('indeterminate'); + $('[name="wishlist_delete_id"]').val(wishlistValue); if (wishlistValue) { @@ -66,6 +71,18 @@ $(function () { /** * Generate cache */ + var cards = $('.ui.card[data-cache="false"]'); + + if (cards.length > 0) { + progress.slideDown(); + progress.removeClass('indeterminate'); + progress.progress({ + total: cards.length + }); + } else { + progress.slideUp(); + } + var timerInterval = 1200; var timerCache = setTimeout( function generateCacheCards() { @@ -90,9 +107,9 @@ $(function () { function generateCacheCard(card) { card = $(card); - var href = card.find('.content [href]').prop('href'); + var href = card.find('.content [href]').prop('href'); var product_id = card.data('id'); - var refresh = card.find('button.refresh'); + var refresh = card.find('button.refresh'); card.addClass('loading'); card.attr('data-cache', true); @@ -120,7 +137,7 @@ $(function () { if (!elementImage.length) { card.prepend( '
' + - '' + + '' + '
' ); } else { @@ -184,7 +201,8 @@ $(function () { if (info.description) { if (!elementContentDescription.length) { elementContent.append( - '
' + info.description + '
' + '
' + info.description + '
' + + '
' ); } } @@ -193,6 +211,7 @@ $(function () { * Finish */ card.removeClass('loading'); + progress.progress('increment'); } refresh.removeClass('working'); diff --git a/src/classes/embed-cache.php b/src/classes/embed-cache.php index 2fa5ac58..8be6f64e 100644 --- a/src/classes/embed-cache.php +++ b/src/classes/embed-cache.php @@ -1,10 +1,10 @@ */ diff --git a/src/classes/emebd-uri-interface.php b/src/classes/emebd-uri-interface.php new file mode 100644 index 00000000..c6e37356 --- /dev/null +++ b/src/classes/emebd-uri-interface.php @@ -0,0 +1,39 @@ +extractor->getOEmbed(); + + return $oembed->url('url') + ?: $oembed->url('web_page') + ?: $this->getCanonical() + ?: $this->extractor->getUri(); + } + + protected function getCanonical(): ?UriInterface + { + $document = $this->extractor->getDocument(); + + foreach ($document->select('.//link[@canonical]')->nodes() as $node) { + $href = $node->getAttribute('href'); + + if ($href) { + return $this->extractor->resolveUri($href); + } + } + + return null; + } +} diff --git a/src/classes/wishlist.php b/src/classes/wishlist.php index 77dafb99..4ac3559c 100644 --- a/src/classes/wishlist.php +++ b/src/classes/wishlist.php @@ -89,26 +89,28 @@ class Wishlist ?>
+
- image) { ?> -
+
+ image) { ?> + - favicon) { ?> - - + favicon) { ?> + + - providerName) { ?> - providerName ?> - + providerName) { ?> + providerName ?> + + + + + +
- - - -
-
title) { ?> @@ -131,6 +133,7 @@ class Wishlist
description ?>
+
@@ -143,7 +146,7 @@ class Wishlist url) { ?> - + View @@ -156,7 +159,6 @@ class Wishlist
-
diff --git a/src/pages/wishlists.php b/src/pages/wishlists.php index 885b74e7..364a2116 100644 --- a/src/pages/wishlists.php +++ b/src/pages/wishlists.php @@ -68,6 +68,12 @@ $page->navigation();

Products

+
+
+
+
+
+