You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever a user enters a valid social media link in link container, it should displays the relevant social media icon in link container and enable the preview button.
Details
Consider a prototype function isValidURL(url) in JS, which takes the URL as input and returns a bool: true if it's valid, else false.
Whenever a user enters a URL, it should validate first using isValidURL(url).
If the URL is valid, the preview button should be enabled (disabled by default).
After validating, it should searches the relevant link through the socialLinks dict. The socialLinks dict is already generated in index.js file.
constsocialLinks=getSocialLinks();
If the entered link is present in the values of socialLinks, retrieve the key.
Hint: Make sure to replace or trim the <username>, also handle the entered username.
After fetching the key, search the ${key}.png file in assets/logos folder, if the ${key}.png is present, fetch that logo and set it to icon class (img element).
If the entered link is not present in socialLinks or no ${key}.png exists, it should use a default icon 🌐, you can download the default icon from internet in assets/logos folder.
Update Link Container
Overview
Whenever a user enters a valid social media link in
link
container, it should displays the relevant social media icon inlink
container and enable thepreview
button.Details
isValidURL(url)
in JS, which takes the URL as input and returns a bool:true
if it's valid, elsefalse
.isValidURL(url)
.preview
button should be enabled (disabled by default).socialLinks
dict. ThesocialLinks
dict is already generated inindex.js
file.socialLinks
, retrieve the key.Hint: Make sure to replace or trim the
<username>
, also handle the entered username.${key}.png
file inassets/logos
folder, if the${key}.png
is present, fetch that logo and set it toicon
class (img element).socialLinks
or no${key}.png
exists, it should use a default icon 🌐, you can download the default icon from internet inassets/logos
folder.index.js
, style instyle.css
.Structure
Structure of the
link
container is defined as follows inindex.html
file.If you have any suggestion or idea, you're welcome to share.
Let's implement SocialRepo's link container updator! 🙌
The text was updated successfully, but these errors were encountered: