Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Example to Live Sample and remove typewriter simulation demo #9111

Merged
merged 3 commits into from
Sep 22, 2021

Conversation

AnilSeervi
Copy link
Contributor

@AnilSeervi AnilSeervi commented Sep 20, 2021


  • Remove TypeWriter Example
  • Convert alternating colors example to live sample
  • update id link by reducing a space

@AnilSeervi AnilSeervi requested a review from a team as a code owner September 20, 2021 14:50
@AnilSeervi AnilSeervi requested review from Rumyra and removed request for a team September 20, 2021 14:50
@github-actions
Copy link
Contributor

github-actions bot commented Sep 20, 2021

Preview URLs

Flaws

None! 🎉

External URLs

URL: /en-US/docs/Web/API/setInterval
Title: setInterval()
on GitHub

No new external URLs

(this comment was updated 2021-09-21 12:08:10.966116)

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR! But I think the right thing to do here (if we want to keep this example at all, which I'm not sure about) would be to make this into a live sample, as we did for #8667 .

@AnilSeervi
Copy link
Contributor Author

Thanks for this PR! But I think the right thing to do here (if we want to keep this example at all, which I'm not sure about) would be to make this into a live sample, as we did for #8667 .

Yes. I too thought about converting it into a live sample. But then the example would start right away when the page loads and it'd be over by the time some users get to it. I know that there are controls to trigger the actions. But,
I'm not sure if the example should be kept or be removed ¯_(ツ)_/¯

@wbamberg
Copy link
Collaborator

Thanks for this PR! But I think the right thing to do here (if we want to keep this example at all, which I'm not sure about) would be to make this into a live sample, as we did for #8667 .

Yes. I too thought about converting it into a live sample. But then the example would start right away when the page loads and it'd be over by the time some users get to it. I know that there are controls to trigger the actions.

That's a good point. Yes, it would need some kind of "start/reset" buttons.

But, I'm not sure if the example should be kept or be removed ¯_(ツ)_/¯

Looking at this page as a whole, I think it ought to have at least one live sample. At the moment it has none but has two examples that could be converted to live samples, "Alternating two colors", and "Typewriter simulation". I think the issue I have with the typewriter one is that it's quite long and has a lot of complexity in it that's not relevant to the setInterval API, and this makes it hard to use as an example of the API. And I don't see that the typewriter one demonstrates a different enough usage of setInterval to merit another example.

So, I think the best thing for this page:

  • delete the typewriter example
  • convert "Alternating two colors" into a live sample (but giving a start/stop button so it's not doing it all the time).

Also for "Alternating two colors" it might also be worth changing it to set a class attribute on the element, and having some separate CSS, like:

.stop {
  color: red;
}

.go {
  color: green;
}

...rather than setting the CSS inline with the style (since inline CSS is not good practice).

What do you think?

@wbamberg
Copy link
Collaborator

(also, this is completely irrelevant but typewriter simulations should build in some randomized delay before each "keypress". They look much more realistic that way :)

@AnilSeervi
Copy link
Contributor Author

Agree with you @wbamberg.
The typewriter example can be removed and put into a external link where one can visit to, if they need a complex example to understand the API better.

The conversion to live sample of the simple example would add to the understanding of the API right away.👍

Looking at this page as a whole, I think it ought to have at least one live sample.

@wbamberg
Copy link
Collaborator

I've assigned you the issue, hope that's OK :).

The typewriter example can be removed and put into a external link

I think it can just be removed, without an external link. Otherwise one day it will rot and someone will file this bug again :).

@AnilSeervi
Copy link
Contributor Author

I've assigned you the issue, hope that's OK :).

Yea sure no problem.

The typewriter example can be removed and put into a external link

I think it can just be removed, without an external link. Otherwise one day it will rot and someone will file this bug again :).

Will remove it:)

@AnilSeervi AnilSeervi changed the title add JSFiddle link to view demo example live Convert Example to Live Sample and remove typewriter simulation demo Sep 21, 2021
@AnilSeervi
Copy link
Contributor Author

Looking good, aint't it. @wbamberg

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this looks great :).

@wbamberg wbamberg merged commit 764e2cb into mdn:main Sep 22, 2021
@AnilSeervi AnilSeervi deleted the patch-3 branch September 23, 2021 17:23
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with "setInterval()": (Typewriter simulation demo results 404)
2 participants