Commit Graph

17 Commits

Author SHA1 Message Date
JulianPrieber 907a3116bb Fixed dark mode not applying on first visit
This 'bug' was caused due to the way the dark mode was applied. The dark mode detection detects the preferred theme style from the client and then saves the preferred type with a cookie, all with JavaScript. Then a simple PHP if-else statement loads either the dark or light mode CSS theme, depending on the cookie.

The problem here was that the cookie would only be detected if the page was refreshed, so once the cookie was set, the dark mode was applied every time without a problem. But the first time a user visited the site and the preferred theme was set to dark mode, the page would still display the white version until the page was refreshed.

Now, I could have changed how the page applies the dark mode, however I decided against that and went with this commit instead.

Now I'm not really experienced with JavaScript at all, so this definitely could have been solved in a more elegant way, but this is what I did:

I added a bit to the JavaScript that sets and reads the cookie. When the page finished loading, a simple if statement is run that requires the following conditions: 
The URL contains a '#' and the color scheme equals 'dark' and the cookie isn't set yet. 
After these conditions are met, '#dark' is added to the URL and the page will be refreshed.

This refresh is only performed without the cookie, thus only refreshing the page on the first visit if the dark mode would be applied.

The '#dark' is only added to the URL to fail the first requirement of the if statement, preventing the page from being reloaded in an infinite loop. Otherwise, the  '#dark' part of the URL fulfills no purpose and only the '#' part is required, so it doesn't even matter what comes after the hash. I just chose this for clarification.

If the dark mode cookie is blocked by the user, the page will be set to light mode and refreshed every time they visit but the '#dark' will still be added to the URL, preventing the infinite refresh-loop.
2022-03-03 10:49:10 +01:00
JulianPrieber ec88a74889 Fixed bug/simplified setup
Fixed bug where users littlelink pages (domain.com/@username) would display a 404 error. This was caused due to the .env config file not containing an App URL. This issue could be solved by simply adding a URL to the config, this is now not necessary anymore, making the setup process easier and less confusing. 

I changed every instance of "{{ config('app.url') }}" to  "{{ url(' ') }}". This effectively automatically uses the correct URL for LittleLink links, even if LittleLink Custom is set up in a subdirectory.

In my testing, I couldn't find any problems this might have caused, so this appears to do the job just as well as setting the URL in the config. If I find any issues with this, I will revert this change.
2022-02-27 19:33:19 +01:00
JulianPrieber 2968da4a80
Added fadein animation to text and avatar
Added 'fadein' class to avatar image, littlelink_name and littlelink_description text. This class adds the fade-in animation from 'animate.css' found in /littlelink/css/.
2022-02-22 12:48:43 +01:00
JulianPrieber 51c16a2d00
Fixed bug
Fixed social preview image displaying on littlelink page
2022-02-21 20:33:55 +01:00
JulianPrieber c8696ca5d5 Fixed elseif
Fixed new elseif statements by changing:
"if
if"
to
"if
elseif"
2022-02-20 15:42:45 +01:00
JulianPrieber 8243d7c977 fixed logo.svg 2022-02-20 13:20:21 +01:00
JulianPrieber 96cfd5b4c1 Changed logo
As part of the new logo (https://github.com/JulianPrieber/littlelink-custom/milestone/1) I'm now using the new 'logo.svg' vector logo.

For this, I added an if-else statement in most cases, which first check for a custom logo uploaded by the admin or the avatar of an individual user. If the image doesn't exist, the default logo (logo.svg) is used.
2022-02-20 13:12:25 +01:00
JulianPrieber 5db777053e
Added dark mode detection
Added automatic dark mode detection to littlelink.blade.php via a cookie with js.cookie.min.js (see previous commit).

Detecting the dark mode setting is done with JavaScript. The script detects the preferred dark mode setting in the client's browser and saves it with a cookie. If the script detects a change in this setting, it corrects the cookie. 

Loading the appropriate skeleton.css is done via PHP with an if-else statement. If the cookie (saved by the previous script) color scheme equals 'dark' it will load skeleton-dark.css (found in /littlelink/css). 

If dark mode is not detected OR nothing is detected/cookie is getting blocked, the statement defaults to skeleton-light.css (also found in /littlelink/css).

You could change what the if-else statement defaults to (i.e. which color scheme is loaded if the cookie fails to detect) by switching 'skeleton-dark.css' and 'skeleton-light.css' around (see comment in if statement).

Everything added is commented and marked with begin/end.


Credit to 'user1575941' on Stack Overflow who's commented code REALLY helped getting behind all this.
2022-02-18 10:10:13 +01:00
JulianPrieber 44f57ce954
Added button entrance animation
Live demo: https://julianprieber.github.io/littlelink-admin-demo/button-entrance.html

Added an entrance animation for buttons on littlelink.blade.php. This animation was made by the Animate.css project (https://github.com/animate-css/animate.css).

Each button entrance animation lasts 100ms. Every button after the first adds 100ms to the value of the previous button i.e. button 1 loads after 100ms, button 2 loads after 200ms,  button 3 after 300ms and so on...

Timings for the buttons can be changed in /littlelink/css/animate.css

I put every button in a separate <div> Tag, so the animation wouldn't in interfere with the existing hover animation.

Likewise, I removed all <br> Tags.
2022-02-17 22:09:58 +01:00
JulianPrieber 14c324734f
Change public path
This is one of multiple public path edits. For simplified usability, I am integrating the public Laravel directory into the root directory. 

For this, I am changing every instance of 'public_path' to 'base_path' and will use this format in future changes as well.
2022-02-14 12:54:51 +01:00
JulianPrieber a58f412cc5
Added button animation littlelink
Added hover button animation to littlelink.blade.php.

  -  Included hover-min.css for animation
  -  Added class 'button hvr-grow' to all buttons
  -  Added class 'hvr-icon-wobble-vertical' to all buttons (for icon animation)
  -  Added class 'hvr-icon' to all icons (to indicate icon to hover-min.css)

Read more on how to use and change animations here: https://github.com/IanLunn/Hover/blob/master/README.md
Try a demo of the added animations here: https://julianprieber.github.io/littlelink-admin-demo/
2022-02-12 19:24:01 +01:00
JulianPrieber 0750e48830
Added support for social media preview
This shows a preview for Name, Bio and avatar image of users profiles if shared on social sites like Facebook,  Twitter, Facebook Messenger, WhatsApp, Discord, Pinterest and many more.
2022-02-12 14:59:07 +01:00
JulianPrieber 5364591c12
Added rounded avatar
Added class 'rounded-avatar' to avatar images
2022-02-11 22:01:03 +01:00
aprillio 4c3163674f update auth header logo link and page margin top-bottom 2021-07-06 16:42:39 +07:00
aprillio 91595c1a48 !! update page links blade !! 2021-07-06 15:49:29 +07:00
Khashayar Zavosh 538666900b add new brand: tiktok, email 2021-05-22 18:07:18 +04:30
Khashayar Zavosh 24db7cbbfb admin littlelink 2021-04-16 03:30:00 +04:30