Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/dictionaries/proper-names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ wisedog
Wolenetz
Wrox
XAMPP
Xandar
Xavi
Xiluodu
Xiowan
Expand Down
1 change: 1 addition & 0 deletions .vscode/dictionaries/terms-abbreviations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ ICANN
ICNS
iconset
idents
IDOR
IERS
IMSC
Indo-Pacific
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page-type: guide
sidebar: games
---

Shaders use GLSL (OpenGL Shading Language), a special OpenGL Shading Language with syntax similar to C. GLSL is executed directly by the graphics pipeline. There are [several kinds of shaders](https://www.khronos.org/opengl/wiki/Shader), but two are commonly used to create graphics on the web: Vertex Shaders and Fragment (Pixel) Shaders. Vertex Shaders transform shape positions into 3D drawing coordinates. Fragment Shaders compute the renderings of a shape's colors and other attributes.
Shaders use GLSL (OpenGL Shading Language), a special OpenGL Shading Language with syntax similar to C. GLSL is executed directly by the graphics pipeline. There are [several kinds of shaders](https://wikis.khronos.org/opengl/Shader), but two are commonly used to create graphics on the web: Vertex Shaders and Fragment (Pixel) Shaders. Vertex Shaders transform shape positions into 3D drawing coordinates. Fragment Shaders compute the renderings of a shape's colors and other attributes.

GLSL is not as intuitive as JavaScript. GLSL is strongly typed and there is a lot of math involving vectors and matrices. It can get very complicated — very quickly. In this article we will make a simple code example that renders a cube. To speed up the background code we will be using the Three.js API.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,61 +45,62 @@ We are going to get you to solve this challenge in your local development enviro
<h1>An Exciting Blog Post</h1>
<img src="images/square6.jpg" alt="placeholder" class="feature" />
<p>
Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi
welsh onion daikon amaranth tatsoi tomatillo melon azuki bean
garlic.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis non
justo at erat egestas porttitor vel nec tortor. Mauris in molestie
ipsum. Vivamus diam elit, ornare ornare nisi vitae, ullamcorper
pharetra ligula. In vel lacus quis nulla sollicitudin pellentesque.
</p>

<p>
Turnip greens yarrow ricebean rutabaga endive cauliflower sea
lettuce kohlrabi amaranth water spinach avocado daikon napa
asparagus winter purslane kale. Celery potato scallion desert
raisin horseradish spinach carrot soko. Lotus root water spinach
fennel kombu maize bamboo shoot green bean swiss chard seakale
pumpkin onion chickpea gram corn pea. Brussels sprout coriander
water chestnut gourd swiss chard wakame kohlrabi beetroot carrot
watercress. Corn amaranth salsify bunya nuts nori azuki bean
chickweed potato bell pepper artichoke.
Nunc vitae eleifend odio, eget tincidunt sem. Cras et varius justo.
Nulla sollicitudin quis urna vitae efficitur. Pellentesque
hendrerit molestie arcu sit amet lacinia. Vivamus vulputate sed
purus at eleifend. Phasellus malesuada sem vel libero hendrerit,
sed finibus massa porta. Vestibulum luctus scelerisque libero, sit
amet sagittis eros sollicitudin ac. Class aptent taciti sociosqu ad
litora torquent per conubia nostra, per inceptos himenaeos.
</p>

<p>
Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot
courgette tatsoi pea sprouts fava bean collard greens dandelion
okra wakame tomato. Dandelion cucumber earthnut pea peanut soko
zucchini.
Phasellus tincidunt eros iaculis, feugiat mi at, eleifend mauris.
Quisque porttitor lacus eu massa condimentum, eu tincidunt nisl
consequat. Nunc egestas lacus dolor, id scelerisque ante tincidunt
ac. In risus massa, sodales ac enim eu, iaculis eleifend lorem.
</p>

<p>
Nori grape silver beet broccoli kombu beet greens fava bean potato
quandong celery. Bunya nuts black-eyed pea prairie turnip leek
lentil turnip greens parsnip. Sea lettuce lettuce water chestnut
eggplant winter purslane fennel azuki bean earthnut pea sierra
leone bologi leek soko chicory celtuce parsley jícama salsify.
Maecenas euismod condimentum enim, non rhoncus neque tempor ut.
Vestibulum eget nisi ornare, vehicula felis id, aliquet nibh. Donec
in mauris in diam aliquam commodo nec ac nunc. Aliquam nisl risus,
eleifend a iaculis id, tempor vel tortor. Nam ullamcorper dictum
tellus id rhoncus. Sed quis nulla in mi aliquam euismod nec eu
metus.
</p>

<p>
Celery quandong swiss chard chicory earthnut pea potato. Salsify
taro catsear garlic gram celery bitterleaf wattle seed collard
greens nori. Grape wattle seed kombu beetroot horseradish carrot
squash brussels sprout chard.
Nam orci nulla, convallis aliquet ante ut, lobortis hendrerit
risus. Nulla malesuada porta turpis in consequat. Duis suscipit
nulla a mauris pellentesque vehicula. Fusce euismod, mi malesuada
venenatis vestibulum, metus erat faucibus dui, vel rutrum turpis
nibh ut diam.
</p>

<p>
Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi
welsh onion daikon amaranth tatsoi tomatillo melon azuki bean
garlic.
Nam ornare et mauris eget tincidunt. Nam ornare et mauris eget
tincidunt. Donec et ipsum a orci elementum commodo et ut ex.
Vivamus porttitor sem in purus maximus, eu imperdiet felis
lobortis.
</p>

<p>
Turnip greens yarrow ricebean rutabaga endive cauliflower sea
lettuce kohlrabi amaranth water spinach avocado daikon napa
asparagus winter purslane kale. Celery potato scallion desert
raisin horseradish spinach carrot soko. Lotus root water spinach
fennel kombu maize bamboo shoot green bean swiss chard seakale
pumpkin onion chickpea gram corn pea. Brussels sprout coriander
water chestnut gourd swiss chard wakame kohlrabi beetroot carrot
watercress. Corn amaranth salsify bunya nuts nori azuki bean
chickweed potato bell pepper artichoke.
Pellentesque ullamcorper dolor ut ullamcorper convallis. Duis a
orci aliquet, pretium neque ut, auctor purus. Proin viverra
tincidunt nisi id fringilla. Maecenas interdum risus in ultricies
finibus. Vestibulum volutpat tincidunt libero, a feugiat leo
suscipit in. Sed eget lacus rutrum, semper ligula a, vestibulum
ipsum. Mauris in odio fringilla, accumsan eros blandit, mattis
odio. Ut viverra mollis augue, vitae ullamcorper velit hendrerit
eu. Curabitur mi lacus, condimentum in auctor sed, ornare sed leo.
</p>
</article>

Expand All @@ -126,8 +127,8 @@ We are going to get you to solve this challenge in your local development enviro
}

body {
background-color: #fff;
color: #333;
background-color: white;
color: #333333;
margin: 0;
font: 1.2em / 1.6 sans-serif;
}
Expand All @@ -151,7 +152,7 @@ We are going to get you to solve this challenge in your local development enviro
}

nav {
background-color: #000;
background-color: black;
padding: 0.5em;
}

Expand All @@ -162,7 +163,7 @@ We are going to get you to solve this challenge in your local development enviro
}

nav a {
color: #fff;
color: white;
text-decoration: none;
padding: 0.5em 1em;
}
Expand Down Expand Up @@ -223,8 +224,8 @@ The finished CSS looks like so:
}

body {
background-color: #fff;
color: #333;
background-color: white;
color: #333333;
margin: 0;
font: 1.2em / 1.6 sans-serif;
}
Expand Down Expand Up @@ -252,7 +253,7 @@ img {
}

nav {
background-color: #000;
background-color: black;
padding: 0.5em;
/* 2. Make navigation bar stick to top of viewport */
top: 0;
Expand All @@ -270,7 +271,7 @@ nav ul {
}

nav a {
color: #fff;
color: white;
text-decoration: none;
padding: 0.5em 1em;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ The images you need to embed in the example and their required `alt` text are as
- [`pic1.jpg`](https://mdn.github.io/shared-assets/images/examples/learn/gallery/pic1.jpg): "Closeup of a human eye".
- [`pic2.jpg`](https://mdn.github.io/shared-assets/images/examples/learn/gallery/pic2.jpg): "Rock that looks like a wave".
- [`pic3.jpg`](https://mdn.github.io/shared-assets/images/examples/learn/gallery/pic3.jpg): "Purple and white pansies".
- [`pic4.jpg`](https://mdn.github.io/shared-assets/images/examples/learn/gallery/pic4.jpg): "Section of wall from a pharoah's tomb".
- [`pic4.jpg`](https://mdn.github.io/shared-assets/images/examples/learn/gallery/pic4.jpg): "Section of wall from a pharaoh's tomb".
- [`pic5.jpg`](https://mdn.github.io/shared-assets/images/examples/learn/gallery/pic5.jpg): "Large moth on a leaf".

### Create a data object
Expand Down Expand Up @@ -216,9 +216,9 @@ for (const image of images) {
newImage.tabIndex = "0";
// 2f. Append the image as a child of the thumbBar
thumbBar.appendChild(newImage);
// 2g. Update the display to show the image fullsize when a thumb is clicked
// 2g. Update the display to show the image full size when a thumb is clicked
newImage.addEventListener("click", updateDisplayedImage);
// 2h. Update the display to show the image fullsize when the "Enter" key
// 2h. Update the display to show the image full size when the "Enter" key
// is pressed after it has been focused
newImage.addEventListener("keydown", (e) => {
if (e.code === "Enter") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,17 @@ The {{cssxref('appearance')}} property can be used to display an element using p

You can use JavaScript to detect whether a particular input type is supported. This is based on the fact we mentioned before — that every input type falls back to `<input type="text">` in non-supporting browsers.

1. Define a test function. The first line of the function body should create a test `<input>` element:
Define a test function. The first line of the function body should create a test `<input>` element. Next, set its `type` attribute to the type you want to test. Finally, test the `type` attribute value. In browsers that don't support that input type, the last line will have no effect and the `type` will be returned as `text`. In the below line we are inverting the return value using the negation operator (`!`) because if the `type` isn't `text`, then the type is supported, so we want to return `true`. The complete function looks like this:

```js
function testDatetimeLocalSupport() {
const testInput = document.createElement("input");
```

2. Next, set its `type` attribute to the type you want to test:

```js-nolint
testInput.setAttribute("type", "datetime-local");
```

3. Now test the `type` attribute value. In browsers that don't support that input type, the last line will have no effect and the `type` will be returned as `text`. In the below line we are inverting the return value using the negation operator (`!`) because if the `type` isn't `text`, then the type is supported, so we want to return `true`:

```js
return testInput.type !== "text";
}
```
```js
function testDatetimeLocalSupport() {
const testInput = document.createElement("input");
testInput.setAttribute("type", "datetime-local");
return testInput.type !== "text";
}
```

The above example shows the basic idea behind such tests. Instead of reinventing the wheel, however, you should use a feature detection library such as [Modernizr](https://modernizr.com/) to handle such tests.
The above example shows the basic idea behind such tests. Instead of reinventing the wheel, however, you should use a feature detection library to handle such tests.

Based on the results of that test, you could then for example choose to use JavaScript to build a custom replacement for the non-supported type, or not apply a stylesheet that styles the non-supported type because you want to provide simple default styles to legacy browsers.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To have more control over content and website appearance, most professionals/bus
- Web hosting is rented file space on a hosting company's [web server](/en-US/docs/Learn_web_development/Howto/Web_mechanics/What_is_a_web_server). You put website files on the web server. The web server provides website content to website visitors.
- A [domain name](/en-US/docs/Learn_web_development/Howto/Web_mechanics/What_is_a_domain_name) is the unique web address where people find your website, such as `https://www.mozilla.org` or `https://www.bbc.co.uk`. You can rent your domain name for as many years as you want from a **domain registrar**.

If you get your web hosting _and_ domain name from the same company, they tend to be configured automatically to talk to one another. However, If you get them from separate companies, or want to change your hosting to a different company, you need to do a bit of setup to point the domain name to the correct server. This is so that people will see your website when they navigate to that web address. This is usually done by logging into your domain registrar's website, and setting your domain's [nameservers](https://kinsta.com/knowledgebase/what-is-a-nameserver/) to the ones provided by your hosting company.
If you get your web hosting _and_ domain name from the same company, they tend to be configured automatically to talk to one another. However, If you get them from separate companies, or want to change your hosting to a different company, you need to do a bit of setup to point the domain name to the correct server. This is so that people will see your website when they navigate to that web address. This is usually done by logging into your domain registrar's website, and setting your domain's [nameservers](https://kinsta.com/blog/what-is-a-nameserver/) to the ones provided by your hosting company.

Companies use various mechanisms to transfer files to their web servers. Many will have more than one option; typical options include:

Expand Down
Loading