fabiochiu/medium-articles huggingface dataset:
For the first time since the summer local celebrity artist “JPeso” previewed some cover art hinting…
Tags: Celebrity, Music, New Jersey

For the first time since the summer local celebrity artist “JPeso” previewed some cover art hinting towards an album ? A single? Maybe even a collaboration. The title “Phases” and the montage of pictures from 2020 gives us a feeling he’s going to finally open up about his year. Peso didn’t want to give to much information out yet but he had this to say “ From blacking out on New Years to the Banger I threw for my birthday I don’t miss a beat when it comes to explaining the phases I went through this year. The effect of corona to when I was tired of being quarantined in late May then taking over seaside for two months opening up the market again in my local scene . From completely getting sidetracked while Falling in love to the heartbreak it later became. The lessons are a lifetime in one year and you’ll definitely hear my happiness and pain I’m excited to give this to the world”. He later explained that the year isn’t over and he is still going through phases and learning more about himself everyday self reflection is something he prides in. As far as a release date there is none most likely because he has more to write and record. It’s good to see JPeso going back to his roots and continuing making music.
Maximilian David Muñiz: Jennifer Lopez’s Son Age, Info and FAQs
By: Rui Carreira
Tags: Singer, Artist, Entertainment, Celebrity, Music

Doesn’t Maximilian David Muñiz Sing? Following His Parents’ Footsteps

Emme Maribel loves the spotlight and she already started performing. One of the main highlights of her still short career was singing with her mother Jennifer Lopez during the Superbowl, and her career is what’s making people ask how Maximilian is doing.

He is also 12 years of age, but he isn’t too keen to follow in his parents’ footsteps and doesn’t seem too fond of the limelight.

This is what makes people run to the internet to find out if he already started singing or not, only to find out singing doesn’t seem to be in the path he chose. So, did he reveal his taste for anything yet?

Let’s find out.

The Couple and The Twins: Background Info on Max and Emme Muñiz

Marc Anthony and J-Lo were parents in February of 2008 to a set of twins, which made them insanely popular as a family and immediately started a collective fantasy of four world-renowned talents on the stage singing at the same time.

However, even though Emme Muñiz wants to sing and likes music very much, young Max doesn’t seem to share that opinion.

Max seems to be in love with arts, but he recently was found singing Riptide on Instagram, as Emme helped him out with a guitar. This Vance Joy tune was sung in a style that resembles Marc Anthony, while fans claim Emme is more like Jennifer Lopez.

Max is suspected of being a “Mini-Marc”, and their mom also states he has a lot of energy but likes to keep himself under the radar, which is fine as not many 12-year-olds like the world paying attention to them, some even having trouble with a single onlooker at times.
Billionaires | Security Costs
Tags: Elon Musk, Sundar Pichai, Billionairelifesyle, Mark Zuckerberg, Celebrity

Well, each and every billionaire has a certain amount of dedicated budget to manage personal security, especially when in the public. For example, in 2018, Facebook paid Mark Zuckerberg $13 million for his personal security and travel expenses.

Mark Zuckerberg with his bodyguards.

In fact, it’d cost Facebook $22 million to keep Mr Zuckerberg and his family safe.

It’s worth mentioning that the official salary of FB CEO is $1 a year. Moreover, in 2018, he didn’t get any bonuses or stock awards. 😉 That said, his compensation in 2017 was above $9 million. In 2018, he received $22.6 million in compensation.

Elon Musk’s security costs have just not been very clear. However, he has got a weird habit of changing his phone in less than a year’s time. He seems to be very concerned about the Data Security.

The owner of Tesla earns a minimum salary about $55,000 a year. However, Mr Musk had never taken his salary from Tesla. The CEO of SpaceX wouldn’t take a paycheck until Tesla hits the $100 billion market cap. His net worth stands above around $45 billion.

Jack Dorsey.

Here are the lump sum security expenses (per year) of some of the Silicon Valley giants:
Cardi B No Makeup: How Does She Look Naturally
By: Rui Carreira
Tags: Rap, Entertainment, Celebrity, Music, Makeup

Cardi B No Makeup: How Does She Look Naturally

Cardi B No Makeup photos aren’t rare, but since she uses so much makeup you may be shocked at the star’s natural looks. Rui Carreira Follow Dec 7, 2020 · 8 min read

Cardi B no makeup is a topic being searched around on search engines for a long time now as she wears a lot of cosmetics and nobody sees her natural look when she’s working.

However, we found plenty of pictures of her without these cosmetics on, so you can see how she looks naturally and how she would look like if she was one of the average Janes of the world.

If you’re curious to see it, then scroll down and look at some of the best pictures we collected as they will definitely make you relate more to this iconic celebrity.

Among the collection are some photos in which the idol is shopping, traveling, or simply walking where there were paparazzi nearby.

If you know her, you know she likes to dress up and she is quite bold in her looks and choices, even wearing wigs often and synthetic nails and eyelashes to boot.

It’s no wonder why many people are curious and want to find out how she looks like underneath all of that, so we got you served!
Announcing the 2021 Cantrip Theme Build-Off (Earn some Nano!)
By: Jeffrey Kilroy
Tags: Nanocurrency, Bitcoin, Nano, Frontend, Cryptocurrency

If you haven’t used it before, Cantrip is a website building tool for very basic web pages. As Cantrip development expands in features, our development has become heavily focused on the experience of our website builder and dashboard. As a result, the themes we offer on our websites are still rather lacking at the moment.

We wanted to open up this part of Cantrip to our talented community and in turn, provide an additional way to earn cryptocurrency!

Convert your CSS skills into some precious Nano

Now and through the month of January, each theme that is approved into the Cantrip live theme repository will be rewarded with 25 Nano to its developer.

In addition, one developer will be awarded 100 Nano for the best theme submitted during this time.

How do I start?

To get started, simply ‘git clone’ the themes repository here:

This git repository contains the starting HTML and tools to begin. Once you have the files on your machine then follow the README.md instructions to get hacking.

Some basic knowledge of NPM, SASS, and JS are required.

How do I get paid?

When you create your theme you will create a theme.json file. Within this file, be sure to add your own Nano address in the ‘nano_address’ field (View the “rad” theme as an example).

Payments will be made on these themes as they are approved and entered into the Cantrip application, and the grand prize winner will be awarded at the end of January.
An overview of Angular; Additional useful links
By: Paria Heidari
Tags: Frontend, Javascript Frameworks, Angular Cli, Angular

Learn how to generating and serving an Angular project.

—

Photo taken by me

In this article, we are going to have a look at how we can start the application by using the Angular Command Line Interface or CLI, Creating Your Application, Configuring the Angular Project to use Angular Material or Flex-Layout (If needed), Updating AppModule, Generating a new component, Implementing service and inject it into the application, Using Angular HTTP client to obtain data from a server, and additional Information & useful Links.

What Is Angular?

Angular is a TypeScript-based open-source web application framework led by the Angular Team at Google and by a community of individuals and corporations. Angular is a complete rewrite from the same team that built AngularJS (Wikipedia)

Angular Architecture

Modular

Component-based with Templates

Services
Speech text Reader with Javascript
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

course from Brad Traversy

Github code

Features:

web speech API

HTML

toggle-button for hiding and showing the text box

the select option list will fetch from API

textarea value pass into the message text when reading

the main show up the list of data (images and text)

CSS

hide the text box outside top of client Page and position turns down when adding classlist show

when the box is active , the box-shadow shows up

and the image fit in the box

grid the box at the main part. four columns and responsive screen setting up

JS

get the DOM needed

the data of images and text array

loop the data to get the image and the text, set the box dom and classList, then append to the main section

when clicking the box, setTextMessage() and speanText(),also for the box-shadow effect with active classname

For fetching the text and language with Web speech API.

new message of input text value as a parameter

the text pass to message value

speakText with speecgSynthesis.speak()

all kinds of voices stores in the array .

fetch the voices with speechSynthesis.getVoices()

loop each kind of voice and pass into select options including name and lang

when voice changed, getVoice()

when click the toggle button, hide and show the text box with class named show.

when click the close btton in the text box, close the box removing the show class name

when select change which means the lang changed, setVoice()

set the voice name to the selected option value

when clicking the read button, set the input text value to the message text and speak out

More

another demo for this web speech API
Typing game with Javascript
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

course from Brad Traversy

Github code

Features:

localStorage get and set setting difficulty selects matching words score add when correct time reduces and the time add if typing correctly(time depends on difficulty level)

HTML

button controls the setting section at the top

the setting is a form with three selections

the word data will be shown in the h1 tag

the text input compare to the word when the user types

time on the left, score on the right

and when the game end, the message shows up with the score and a reset button

CSS

hide the arrow on the select with appearance, for other browser adding the -webkit and -moz

When focusing on select, hiding the outline

the setting places at the top. when hiding, the position of the y-axis moves up

the messager box show at the absolute position relative to the container and hide first. when the game ends, show up

JS

select all the DOM needed with id

the words array or can be fetched from API

the initial score is zero, and the time is 10 seconds

get the difficulty from localStorage if have inside or set to medium and also show in the select

When loading the page, the mouse focus on the input right away

get a random word from the words array list with Math.random()

When typing in the text, the value of texting compares to the word shown in the DOM. If they match completely, it’s time to get a new word and update the score and time.

check the difficulty level before running the updateTime function

show the random word in the DOM.

and initially load the function

if the words match, the score adds one and show in the score DOM

Meanwhile, the time decreases every second with setInterval

When the time reaches zero, which mean the time is ended, the gameOver function is running

create the DOM in the endgame messager box and show up the score

turn the display from none to flex

when clicking the setting button, the setting section at the top toggle hide.

When selecting the form difficulty level, store in the difficult and also set in the localStorage
The notifier. Anytime you make a request, you often…
By: Ankit Kaushik
Tags: Rxjs, Angular, Notifications, Frontend, Reactive Programming

Anytime you make a request, you often need to show some notification to your user. As it's a frequently used utility, you don’t want yourself to end up writing redundant code or spending any extra ounce of energy each time you encounter one scenario.

So, let's build an intelligent plugin that caters to all your notifications needs.

The crucial member of this class is notify . Yes, this is our custom lettable RxJs operator that we are gonna pipe to an Observable stream(in simple words, your API call) to enable the notification functionality. This operator could be used like:

To display only success notification
你的 onscroll 不是你的 onscroll
Tags: Onevent, Frontend, 前端, 中文, Event Handlers

接著我去追查了這個酷酷的名詞（Window-reflecting body element event handler set），發現在講 body 的頁面提到：

The body element exposes as event handler content attributes a number of the event handlers of the Window object. It also mirrors their event handler IDL attributes.

The event handlers of the Window object named by the Window-reflecting body element event handler set, exposed on the body element, replace the generic event handlers with the same names normally supported by HTML elements.
Infinite scroll blogs with Javascript
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

course from Brad Traversy

Github code

Features:

posts fetch from JSONPlaceholder API custom three dots loader filter posts based on keywords

HTML

filter to type in the keywords

the post container will load the posts fetched from API

the loader is a three-dots animation

CSS

fixed position of the three dots animates the y axis and the opacity

JS

get the DOMs needed

Using the JSONPlaceholder API to get the posts data, set the limit number of posts and the page now

After fetching all the data, it’s time to show all the data in the DOM.

showing the post id, title, and body

When scrolling the page, show the loader if the height of scrolled longer than the whole scrollheight.

How to teel the difference of scrollHeight,clientHeight,offsetHeight?

scrollHeight: ENTIRE content & padding (visible or not)

Height of all content + paddings, despite of height of the element. clientHeight: VISIBLE content & padding

Only visible height: content portion limited by explicitly defined height of the element. offsetHeight: VISIBLE content & padding + border + scrollbar

Height occupied by the element on document.

When the posts need load, the loader shows up 1 second and showPost() again

When filter box text changing, filterPost()

Get the value of typing text and compare it to the post’s content including title and body. If the typing text contains in the title or body, the post shows up.

How to understand indexOf()?

The indexOf() method returns the position of the first occurrence of a specified value in a string. This method returns -1 if the value to search for never occurs. Note: The indexOf() method is case sensitive.

So, all the text transform to uppercase to compare.
【JavaScript 二部曲】提升 Hoisting
By: Helena Chang
Tags: JavaScript, Frontend, Js, Front End Development, Web Development

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Music Player with Javascript
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

Course from Brad Traversy

Github code

Features:

audio play() pause() currentTime duration timeupdate ended e.target e.clentWidth e.offsetX

HTML

link the font awesome in the head part for the audio play buttons

music-info includes a song title and the progress bar

audio embedded

the cover image positions at the left side

the navigation is three control buttons

CSS

The cover image has a white circle inside for good looking.

the cover image will rotate 360 degrees when the music is playing.

animation-play-state:running/paused more info MDN

music-info hide behind the container first and transform up entirely, and also the opacity from 0 to 1

changing the progress width every millisecond

JS

select all the DOM needed

all the songs name stored in the songs array, and the index init set to a number

When loading the page, load the song

showing the song title, image, and the audio source

when click the play button, checking if the music is playing based on the classname”play”

if the audio is playing, pause the song. if the song is paused, play the song

playSong(): add the play class to the music container and change the icon of controls. play() audio

pauseSong(): remove the class to the music container and change the icon of controls. pause() audio

previous and next buttons event

prevSong(): change the index of song. when the index is smaller than 0, jump to the last one.

nextSong():change the index of song. when the index is bigger than the length of songs list,jump to the first one.

timeupdate , the progress bar change based on the time played

click the progress bar to change the audio playing position

e.srcElement to get the duration and currentTime

get the playing percentage of progress and set the width of progress

the length of progress is the e.clientWidth.the click point is the e.offset X. set the audio currentTime

when the song play ended, go to next song
Adding Life to Your Social Media Icons
By: Michael Jiang
Tags: JavaScript, Coding, Programming, CSS, Frontend

With no styling, your buttons will be blue and purple, depending on if they’ve been visited yet. I’ve also labeled each of the icons using BEM Methodology. If you’re unfamiliar with that, check out my other blog post on it! I also have to mention that I use SCSS. If you’re following along in codepen.io, make sure under the CSS tab, you set your preprocessor to SCSS. Lastly, I have target set to blank because I want the links to open up in a new tab. Now that the HTML and settings configuration is done, we can get to the fun part.

The interesting thing about ion icons is that they change size based on font size. I’m going to grab the header__icons class, and set everything within it to have a font size of 40px. My icons will now look like this:

Now I want all of them to lose the color, but instead of setting the attributes for :active, :visited, :hover, and :link individually, I’m just going to apply a grayscale filter to all of them. This part gets a bit interesting, I’m going to create a mixin called iconColorChange, which is made to set the icons to grayscale, but upon hover, changes them back to having no filter. I want this transition to occur over the course of .3 seconds as well.

Remember to move your mixin to the top of your file. If you try to include the mixin before you have created it, it won’t work! Notice that I include the color change mixin for all the children of header__icons using the * selector.

Now that we’ve got the transition working, we want to set the colors for each of them. Remember that we specified each icon’s class name at the end of header__icons. All we need to do is to target each icon and set its color to the color of choice. I used LockDownSEO to find all the social media icon colors compiled in one site. If you’ve successfully added color to each icon, you should get something that looks like this:

Lastly, let’s make them scale up a little bit when we hover. I’m going to create another mixin since we have to apply this to all the icons as well. I’ll make a transform property and set scale to 1.4 times. I’ll also make the transition from regular size to large size happen over the course of .4 seconds. Although it would make sense to include it under the all children selector, it strangely does not work, so I added them individually to each icon. The final result should look like this:
Kampai Cocktails 🥂— A fun web app made with React and APIs
By: Halee Pagel
Tags: API, JavaScript, Frontend, React, Web Development

The Good 😁

Incorporating an API into our web app was a fantastic way to practice async/await calls. I learn a lot better when I’m trying things out myself. Working with my team to implement our API calls correctly was an amazing learning experience and confidence booster.

This is the first React project I worked on and it was once again, a perfect way to take my theoretical knowledge and put it to action. I watched a team member work on adding modals to individual recipes and that opened up another part of the React experience to me.

The Not So Good 😬

Async/await. Oof. There are so many places where things could be going wrong with your code and the nature of async/await calls doesn’t help the process. But, the sticky problematic bits are big learning moments, and overcoming them made me a better programmer.

The Code Base 💻

Alright, let’s talk about the tech stack. For this project we used:

JavaScript/HTML/CSS

React

Rakuten Rapid APIs

Anime.js

If you want a peek behind the curtain, check out our project’s codebase here. We’d love your input if you have an idea for an improvement.

Ina Garten teaches us how to survive 2020

Conclusion 💭

Working on a fun project is a perfect way to stay motivated and expand your technical skills. I still have a lot of ideas for how to improve Kampai Cocktails and I can’t wait to work on them in the future. Cheers to you for getting this far! And remember, it’s 5 o’clock somewhere! 🥂
Expense Tracker with Javascript
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

Course content from Brad Traversy

Github code

Features:

input value to DOM onclick delete item based on id localStorage to get and set

HTML:

the income has a plus sign value

the expense has a minus sign value

the balance is the total of income and expense

The history is a list of income or expense either getting from the localStorage or the value of the input.

The form is the input part with the text and amount. When submitting, the input value display in the DOM history.

CSS

The income and expense should be aligned. Flex=1 the same space

separating line in the middle is the border right

The delete button of each list item positions in the head of the list. Hide first, when hovering, show up with the transition.

JS

get the DOM needed with id

we plan to store the input value in the localStorage named transaction

When first load the page, it should get the data from localStorage right away. If the memory has the transaction, grab it, wither way, set the init array to empty.

When submitting the form, add the transaction to the array.

If the input text or the input amount is null, the placeholder reminder users to type something

If we can get the value, it’s time to set it into an object and pass all the new objects to the array.

And the id is generated random number

Then the array data should be displayed in the DOM with updateValue()

get the amount of input value, the balance is the total of all the amounts

the income is the total of amount more than 0

the expense is the total of amount less than 0

and show up in the top balance, income, and expense section

init the array and display the dom first loading

create the list in history dom with text value and amount, also add the class based on the amount

Clicking the item want to remove means rearrange the transaction array and localStorage

set the localStorage, make the transactions to a string to store data
Frontend Security 101
By: Wataru Oguchi
Tags: Security, Frontend Development, Frontend, Frontend Security, Web Development

Thanks to the dynamic improvement of its eco system, ECMAScript / JavaScript is widely used in both Backend side and Frontend side today. I am also the one who loves writing code in JavaScript (and TypeScript in last few years). I’ve written not only frontend/backend but also multiple tools, such as scheduled jobs and a Chrome extension.

Even though you’re a beginner, there are tons of tutorials you can make web apps with. However, not many of those have mentioned about “Security”. I had a chance to summarize about that topic. I’d love to share it in this post.
Create Dynamic Custom HTML Component using JavaScript
By: Mayank Gupta
Tags: Angular, JavaScript, Frontend, HTML, React

Create Dynamic Custom HTML Component using JavaScript

TechnoFunnel provides another article to create Custom Dynamic HTML Component without using any Frontend Framework. In this article we are going to create a Custom HTML Component and dynamically update the Component to show the latest time. In the previous articles, we have created a custom Component.

This will be series of article, with each article adding more details and functionality to the custom Component created.

Let’s start with creation of Custom Element which displays the time when the component was rendered and then update it further to keep updating every second. Let’s create a component to display the current Time:

In the above code, we have created a small element which will display a static time value when the component is rendered in the browser since the function “connectedCallback” is triggered on initial rendering of the Custom Component. Next, lets put down code to display the timer in the browser. In order to render this custom Component, we will be rending the component “current-time” in the HTML Page.

Once we have added the custom element “current-time” in the HTML page, it will render the time component on the HTML page. Given below is the working sandbox code for the same…

Adding Timer to “connectedCallback” to Update Component

In order to dynamically update the component, we can introduce a setInterval inside the “connectedCallback” function of the custom Component. After an interval of 1000ms, we will update the “innerHTML” for the component.

In the above code, we introduced a “setInterval” which will update the component with the latest time every second. Below is the code sandbox to represent the given scenario.
Heroku網站部署
By: Mino Chen
Tags: Frontend, Webconcent

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
HTML tags that can improve your SEO
By: Bill Chen
Tags: Frontend, In depth guide to SEO, In Depth Guide To Seo

Structural HTML page

Unlike human eyes, search engines are not able to tell where a page section starts/ends if they are created purely by CSS and spacing. In order for search engines to better understand our page structure, we need to create what is called Structural HTML Page. In this section we will cover some of the main HTML tags that can make your website more structural.

Header

Defines the header section of the page.

Nav

Defines the nav section where navigation links are placed.

Main

Define where the main content of the website will be.

H1 ~ H6

H1 ~ H6 tags are big to small titles that you can use for various purposes. (H1 being the highest importance while H6 being the lowest) H1 tag is typically reserved for page title. It can have the same value as the title tag and there should only be one H1 tag across the entire HTML page. H2 tags are normally used as section titles. H3 to H6 tags are additional title tags that you may use if you have additional subtopics within your subtopics. They are optional and won’t appear as often on a page.

Aside

Define contents that are indirectly related to the content. It is normally used for the sidebar section.

Footer

Define the footer section.

Section

Group similar contents together. It is recommended to use the <section> tag instead of the <div> tag when you need to define a new section. While the final appearance will be the same to users, they actually mean a big difference to search engines. If you use the <section> tag, search engines will understand that you are defining a new section, but the <div> tag does not provide any semantic meaning to search engines. They will simply be ignored and your contents will appear to be in the same section to search engines.

Article

Define contents that make senses to be presented independently from the rest of the page. Normally used for blog posts, news stories, or forum posts.

Ul / Ol

Define an unordered/ordered list.

Real World Example

Consider the following HTML page:
CSS-BootStrap安裝
By: Mino Chen
Tags: Frontend, Bootstrap

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Frontend Insights — December
By: Peter Varhoľák
Tags: CSS, JavaScript, Frontend, Resources, Web Development

Frontend Insights — December

PWAdvent

The Web developer’s advent calendar

PWAs are amazing. 🎉 And they can do a lot more than offline support and save themselves to desktop. Check out PWAdvent to explore the variety of web APIs available to you right now!

Tags: Intermediate, HTML, CSS, JS

Make Lighthouse proud

Guide to optimized font loading — (12 min read)

Lighthouse somehow became the holy grail of website metrics and although it is nice to see those green 100s in the audit, it shouldn’t be the end all be all for us. However, we cannot dismiss the recommendations this tool provides, one of which directly correlates to the way we load fonts.

Adrian Bece describes his approach to web font workflow and how he strikes the right balance between performance and UX of font loading.

Tags: Intermediate, CSS, UI/UX, Performance

Considerate Javascript

Loading resources that matter — (5 min read)

Web development shifted from PHP + jQuery to framework-land in the last couple of years and with that came increased use of JS libraries. Very quickly we started shipping huge bundle sizes to our users which led to better application performance at the cost of first load speed. 🚀

These days the web goes through a renaissance and developers are more mindful about what and how we load resources on the user devices. Umar Hansa describes various approaches on how to make your Javascript more considerate of the user device by utilizing new browser APIs.

Tags: Advanced, JS, UI/UX, Performance

CSS of 2020

The past, present, and future? of CSS

Just as last year Raphaël Benitte and Sacha Greif created a wonderful survey about CSS. Thanks to more than 11k people from 100+ countries we can observe how the ecosystem shifts and what to focus on in the future.

By exploring the website you can not only learn about current trends but maybe even discover some new browser functionality or libraries. Huge thanks to Raphaël and Sacha (and plenty of translators) for their initiative. 👏

Tags: Intermediate, CSS

Highlight of the month

Every year the Advent of Code comes with a series of programming puzzles of varying difficulty. It is a fun challenge for the last month of the year, perfectly suited for speed contests, trying out new languages, or school practice. 🧩

Over the years it amassed a wonderful community from every corner of the development world and that brings yet another layer into the whole experience worth a separate mention. 🌟
【JavaScript 二部曲】閉包 Closure
By: Helena Chang
Tags: JavaScript, Frontend, Js, Front End Development, Web Development

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Meal Finder using MealDB API
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

Course from Brad Traversy

Features:

fetching API with fetch() manipulating DOM in js

Github code

HTML

The input box includes a button to submit a search, and another one is the random search button. Both of them will trigger addEventlistener.

The result heading shows the result message.

The meals show the result displaying of cards.

The single meal shows the details of picked meal.

CSS

The container is centered, and the form is flex.

The meals is a list of results, which distributed to four items each line.

The each meal with info is in the absolute position covered on the images.

Changing the opacity of meal info’s background by hovering each meal.

The responsive purpose.

JS

get the DOMs needed

search and random click trigger the functions

reset the single meal first and then fetch the meals data from the MealDB API

AND result heading shows the meal according to the searching name

If no meal in the database, show the message

map all the meals if have and then create the meal

If the input is null, the message in the result heading

When clicking the random button, fetch the database again to pick the random meal and show on the page.

loop the meals to find the meal-info and get the attribute of meal id number

select the meal picked and add the meal to DOM
How to create a Hangman game with Javascript
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

This the part of Brad Traversy’s course.

Features:

SVG drawing with line and circle for a hangman letter matching the words, separating the correct letters and wrong letters, then displaying same typing letters notification box and success box play again game with reset button and enter press

Github code

HTML

SVG drawing: the rode is a four-line shape.

x1,x2 are the axis of x,y1,y2 are the axis of y, which two-point makes a line

head is a circle with cx, cy(the center of the circle),r(the radius of the circle)

body ,arms and legs are all the lines

where displaying the wrong letters

success message box

same typing message box

CSS

the hangman fill and stroke set up

hide the hangman lines first

hide the popup container first and change it in the js

position the notification box outside of the page and change the y axis to show up

JS

all the DOMs needed

the data is the array with several words or can be fetched from API

each time the selected word should be a random one

the correctLetters and wrongLetters to strore the qualidied array

loop the selected word and if the letter is included in the correctLetter, show the letter

if the displaying word is the same as the selected word, the success final message box shows up.

when key pressing the letters from a to z, checking the condition that whether the pressing letter included in the selected word. If the letter is already in the correct array, show the notification, if not, then add to the correct array. The same as the wrong array.

When want to display the wrong letters, it’s the same way.

map the wrong array and display in the dom

loop each of the hangman lines, if the index smaller than the length of the wrong array, showing the line.

When the line length is the same as the wrong array length, the message box shows up.

show a notification if needed and hide after 2 second

When clicking the play again button or key press the enter, reset all the arrays, and run the functions again, also hide the popup box.

do not forget to call the displayWord() when loading the page
URL的結構是什麼？
By: Mino Chen
Tags: Frontend

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
side-menu and modal with Javascript
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

This is the course content from Brad Traversy.

Not much javascript code though, but it’s really useful.

Github code

HTML

the header includes a toggle button, a title, a paragraph and a sign-up button

the container is just some random words in the demo

nav is the side menu content including a logo and an unsorted list

modal is the box of sign-up within a form and a close button

CSS

the main CSS to remind

first, hide the nav to the left side of the screen with transform

When showing the nav, transition happens moving to the right side with the length of the nav.

first, hide the modal before clicking the sign-up button.

modal with the animation opacity setting

JS

all the DOMs needed

When clicking the toggle menu button, the show-nav added(changing the position of nav)

When clicking the Sign-up button, modal show up( changing the display and opacity)

When clicking the close button in modal, modal hides(hiding the display and opacity)

When clicking the outside of the modal, closing the modal the same way. If clicking on the modal, it won’t work.
ReactJS: “useEffect” Hook Explained
By: Lucas Leiberman
Tags: React Hook Useeffect, Frontend, React Hook, React, Web Development

useEffect

If you have been using class components when building your react applications, I’m sure you have used lifecycle methods before such as componentDidMount or componentDidUpdate to perform side effects like fetching to API’s and such. If you are not familiar with lifecycle methods just know that they are different functions available to use at different times during a components’ lifecycle. With the introduction of useEffect, it can perform all these lifecycle duties with more control, and less lines of code. Let’s take a look at a very basic example of using useEffect.

Reminder when using hooks do not forget to import them as seen on line 1. Let’s dissect what this component is doing. As you can see we are implementing the useState hook that allows us to use and set state but don’t worry about that for now. I am rendering an h1 with my state of “name” included, and I have a button that will change that name to “Dough” when clicked. Let’s look at what our useEffect hook is doing here. useEffect will fire on every update including renders, so when our component first renders it is going to set the title of the document to our state which is “Lucas”. Once I hit the button to change the name the useEffect will fire again and set the title to our state which now reads “Doug”.

Working with the Dependency Array

As I mentioned, useEffect will fire after each change of state. But let’s say you have multiple state variables and you only want an effect to fire when a certain variable of state is changed. Here comes the dependency array, which is a second argument you can pass to useEffect where you can establish a connection to a piece of state. Here is an example:

Here, I have added LastName to state and another button that will change the last name to “Looperman” on click. In my useEffect I have the title set to first name + last name. So you would think that the document title would change when the the lastName state changes, but with the dependency array [name], the effect is told to depend on specifically that piece of state changing. You can also pass in an empty array which will tell the effect to only run once immediately after the original render.
Campos de entrada acessíveis — leitores de tela
By: Nicole Oliveira
Tags: Acessibilidade Web, Front End, Wai Aria, WCAG, HTML

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Understand SEO
By: Bill Chen
Tags: Frontend, In depth guide to SEO, In Depth Guide To Seo

Design your page layout

We as humans tend to get attracted by things that are bigger, prettier, or shinier over things that are plain and simple. Even though each person may have different taste, when you put a big object next to a small object, your eyeball will almost always get drawn to the bigger object first.

Big object vs small

When it comes to web design, this is referred to as weight. Every element on the web page has a different weight according to their appearance or where they are placed. The higher the weight, the easier it is to draw users’ attention. UIUX designers often follow this principle and bring users’ attention to the right element by properly distributing weights among elements on the page, we can and should also consider the weight of each element when we are planning for SEO.

Things to remember while designing your page layout

Page title

Every web page should have a page title, so the users and more importantly search engines will be able to know what the page is about. You may use the <title> tag or the <h1> element to represent page title. (Can be different or the same) While the <title> element and <h1> element can exist on the page at the same time, it is important to remember that each page should only contain one <title> tag and one <h1> tag. I.e. Do not put more than one <title> or <h1> tags on your HTML. Section

If your website contains more than one topic or has many subtopics, it is a good idea to divide them into sections. It can help search engines understand your page layout. Without different sections, search engines will not be able to pick up subtopics that you try to cover in your website. Your website will only appear to search engines as a very long article without any paragraphs. Images

All images or logos should have their alt attribute specified on the HTML. The alt attribute stands for alternative, it is the alternative text that will be shown to the user when your images fail to load. Recall search engines do not analyze images on your HTML, they will rely on this attribute on your image in order to tell what each image is about. Element weight

As covered in the beginning of this section, each element has its own weight on the page. You should always examine your website, in each section and as a whole page, to test if each element has the proper weight (importance). Which elements of the section/page will users see first (i.e. most eye catchy). An easy way to test if you wear glasses, take off your glasses so the page becomes blurry. Now the element that stands out to you the most is the element with highest weight on the page.

With these four points in mind, let’s take a look at the portfolio website again, but focus on the weight distribution this time.
async 和 defer是什麼？
By: Mino Chen
Tags: Frontend, HTML, Js

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
wealth list with Javascript array methods
Tags: JavaScript, Frontend Development, Frontend, Front End Development, Web Development

This demo is learned from Brad Traversy’s course.

Demo Github

When mentioning of Array, there always is a list coming up in my mind. The first thing of Javascript is manipulating DOM to achieve the goal.

This demo concludes the arrray methods:sort(),forEach(),map() and filter().

Features:

fetch random user api create elements and appendChild to DOM

HTML

first remenmber to link the css and js in html file

aside is all the button with event added later in js

the main stores the data list

CSS

imported the font from Google fonts if you want

make everything in the center

with the line separating the aside and main

the title aligns at the other side with space-between

the h3 and .person will be appended in js

JS

get the DOM and set an array to store the new data

the five events listeners represent five events buttons in the aside

add a new user:

To fetch random user names, it’s easy to use a random user generator API

If you come to Access-control-allow-origin error, try to understand the answer in the article to handle it. (explained why I use this way to fix it here)

async and await to fetch the JSON data and store the data includes name and money into an object and add data to DOM

how to show the fetched data in the browser? updateDOM() it is

every time run the function, clear the main content

the default data is the stored object

loop the data and append to the created Div

Double wealth event with map():

map the data and multiply by 2 to money in the array

…user: spread operator

at last, update the DOM

sorted the list from max to min with sort():

from max to min: (a,b)=>b.money-a.money

from min to max:(a,b)=>a.money-b.money

pick up the millionaires with filter():

filter the number larger than a million and update DOM

calculate the total wealth with reduce():

accumulate each array number and format the number to currency string
[🤔Dica Rápida] — CSS Responsivo com Clamp()
By: Tiago Lima
Tags: CSS, Responsive, Responsive Design, Frontend

Pai de 3 lindos filhos, viciado em the king of fighters e Javascript and NodeJS enthusiast
一定要使用 SWR 的三個理由
By: Luke Liu
Tags: Race Condition, Frontend, Memory Leak, Swr, React

Very handy that you’ve never known
【JavaScript 二部曲】立即函式 IIFE
By: Helena Chang
Tags: JavaScript, Frontend, Js, Front End Development, Web Development

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore