11-01-full-example.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Stargazing – a showcase of visual effects in HTML, CSS and SVG</title>
  6. <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700|Roboto:400,700" rel="stylesheet" type="text/css">
  7. <script src="js/modernizr.min.js"></script>
  8. <link rel="stylesheet" href="css/main.css">
  9. <style>
  10. /**
  11. * Some of the techniques require references (using URL fragments) to SVG
  12. * elements that are inline at the bottom of the document. The rest of the
  13. * CSS is in the linked file above.
  14. */
  15. .header-title {
  16. mask: url(#ellipseMask);
  17. }
  18. .fig-sun {
  19. mask: url(#circlemask);
  20. }
  21. @media only screen and (min-width: 600px) {
  22. /**
  23. * 1. Shape the "Moon" item using a border-radius
  24. */
  25. .nav-section [href="#moon"] {
  26. border-radius: 50%; /* [1] */
  27. }
  28. /**
  29. * 1. Shape the remaining items with a clip-path in inline SVG.
  30. */
  31. .nav-section [href="#sun"] {
  32. -webkit-clip-path: url(#sunclip); /* [1] */
  33. clip-path: url(#sunclip); /* [1] */
  34. }
  35. .nav-section [href="#planets"] {
  36. -webkit-clip-path: url(img/clip.svg#saturnclip); /* [1] */
  37. clip-path: url(img/clip.svg#saturnclip); /* [1] */
  38. }
  39. .nav-section [href="#milky-way"] {
  40. -webkit-clip-path: url(#milkyclip); /* [1] */
  41. clip-path: url(#milkyclip); /* [1] */
  42. }
  43. .nav-section [href="#universe"] {
  44. -webkit-clip-path: url(#cloudclip); /* [1] */
  45. clip-path: url(#cloudclip); /* [1] */
  46. }
  47. }
  48. </style>
  49. </head>
  50. <body>
  51. <header class="page-header stacked inverted">
  52. <h1 class="header-title">Stargazing</h1>
  53. </header>
  54. <nav class="stacked section nav-section inverted">
  55. <ul class="wrapper">
  56. <li><a href="#moon">The Moon</a></li>
  57. <li><a href="#sun">The Sun</a></li>
  58. <li><a href="#planets">Planets</a></li>
  59. <li><a href="#milky-way">Galaxy</a></li>
  60. <li><a href="#universe">Universe</a></li>
  61. </ul>
  62. </nav>
  63. <main>
  64. <article id="moon" class="section-moon section stacked inverted">
  65. <div class="wrapper">
  66. <h2 class="section-title">The moon</h2>
  67. <img class="fig fig-moon" src="img/moon.jpg" alt="The Moon">
  68. <div class="section-text">
  69. <p>The Moon (in Greek: σελήνη Selene, in Latin: Luna) is Earth's only natural satellite. It is one of the largest natural satellites in the Solar System, and, among planetary satellites, the largest relative to the size of the planet it orbits (its primary). It is the second-densest satellite among those whose densities are known (after Jupiter’s satellite Io).
  70. <p>The Moon is thought to have formed approximately 4.5 billion years ago, not long after Earth. There are several hypotheses for its origin; the most widely accepted explanation is that the Moon formed from the debris left over after a giant impact between Earth and a Mars-sized body called Theia.</p>
  71. </div>
  72. </div>
  73. </article>
  74. <article id="sun" class="section-sun stacked section">
  75. <div class="wrapper">
  76. <h2 class="section-title">The Sun</h2>
  77. <img class="fig fig-sun" src="img/sun.jpg" alt="The Sun">
  78. <div class="section-text">
  79. <p>The Sun (in Greek: Helios, in Latin: Sol) is the star at the center of the Solar System and is by far the most important source of energy for life on Earth. It is a nearly perfect spherical ball of hot plasma, with internal convective motion that generates a magnetic field via a dynamo process. Its diameter is about 109 times that of Earth, and it has a mass about 330,000 times that of Earth, accounting for about 99.86% of the total mass of the Solar System.</p>
  80. <p>The Sun is a G-type main-sequence star (G2V) based on spectral class and it is informally referred to as a yellow dwarf. It formed approximately 4.567 billion years ago from the gravitational collapse of matter within a region of a large molecular cloud. Most of this matter gathered in the center, whereas the rest flattened into an orbiting disk that became the Solar System. The central mass became increasingly hot and dense, eventually initiating nuclear fusion in its core. It is thought that almost all stars form by this process.</p>
  81. </div>
  82. </div>
  83. </article>
  84. <article id="planets" class="section-planets section stacked inverted">
  85. <div class="wrapper">
  86. <h2 class="section-title">The Planets</h2>
  87. <img class="fig fig-planet" src="img/saturn.png" alt="The planet Saturn and its ring system">
  88. <div class="section-text">
  89. <p>The Solar System comprises the Sun and the planetary system that orbits it, either directly or indirectly. Of those objects that orbit the Sun directly, the largest eight are the planets, with the remainder being significantly smaller objects, such as dwarf planets and small Solar System bodies such as comets and asteroids. Of those that orbit the Sun indirectly, like the moons, two are larger than the smallest planet Mercury.</p>
  90. <p>The Solar System formed 4.6 billion years ago from the gravitational collapse of a giant interstellar molecular cloud. The vast majority of the system’s mass is in the Sun, with most of the remaining mass contained in Jupiter. The four smaller inner planets, Mercury, Venus, Earth and Mars, are terrestrial planets, being primarily composed of rock and metal. The four outer planets are giant planets, being substantially more massive than the terrestrials. The two largest, Jupiter and Saturn, are gas giants, being composed mainly of hydrogen and helium; the two outermost planets, Uranus and Neptune, are ice giants, being composed partially of substances with relatively high melting points compared with hydrogen and helium, called ices, such as water, ammonia and methane. All planets have almost circular orbits that lie within a nearly flat disc called the ecliptic.</p>
  91. </div>
  92. </div>
  93. </article>
  94. <article id="milky-way" class="section-milkyway section stacked inverted">
  95. <div class="wrapper">
  96. <h2 class="section-title">The Milky Way</h2>
  97. <div class="section-text">
  98. <p>The Milky Way is a galaxy that contains our Solar System. Its name "milky" is derived from its appearance as a dim glowing band arching across the night sky whose individual stars cannot be distinguished by the naked eye. The term ”Milky Way” is a translation of the Latin via lactea, from the Greek γαλαξίας κύκλος (galaxías kýklos, "milky circle").</p>
  99. <p>From Earth the Milky Way appears as a band because its disk-shaped structure is viewed from within. Galileo Galilei first resolved the band of light into individual stars with his telescope in 1610. Until the early 1920s most astronomers thought that the Milky Way contained all the stars in the Universe. Following the 1920 Great Debate between the astronomers Harlow Shapley and Heber Curtis, observations by Edwin Hubble showed that the Milky Way is just one of many galaxies—now known to number in the billions.</p>
  100. </div>
  101. </div>
  102. </article>
  103. <article id="universe" class="section-universe stacked section">
  104. <div class="wrapper">
  105. <header class="universe-header">
  106. <h2 class="universe-title">
  107. <svg viewBox="0 0 400 120" role="presentation">
  108. <text id="universe-title-textcontent">
  109. <!-- Put both tspan elements on same line, to prevent bug in WebKit. -->
  110. <tspan class="universe-span-1" x="6" dy="0.8em">The Observable</tspan> <tspan class="universe-span-2" x="3" dy="0.75em">Universe</tspan>
  111. </text>
  112. </svg>
  113. </h2>
  114. <img class="fig fig-universe" src="img/universe.jpg" alt="A starscape with far galaxies.">
  115. </header>
  116. <div class="section-text">
  117. <p>The observable universe consists of the galaxies and other matter that can, in principle, be observed from Earth at the present time because light and other signals from these objects have had time to reach the Earth since the beginning of the cosmological expansion. Assuming the universe is isotropic, the distance to the edge of the observable universe is roughly the same in every direction. That is, the observable universe is a spherical volume (a ball) centered on the observer. Every location in the Universe has its own observable universe, which may or may not overlap with the one centered on Earth.</p>
  118. <p>The word observable used in this sense does not depend on whether modern technology actually permits detection of radiation from an object in this region (or indeed on whether there is any radiation to detect). It simply indicates that it is possible in principle for light or other signals from the object to reach an observer on Earth. In practice, we can see light only from as far back as the time of photon decoupling in the recombination epoch. That is when particles were first able to emit photons that were not quickly re-absorbed by other particles. Before then, the Universe was filled with a plasma that was opaque to photons.</p>
  119. </div>
  120. </div>
  121. </article>
  122. </main>
  123. <footer class="stacked section page-footer inverted">
  124. <div class="wrapper">
  125. <h2 class="section-title">Image credits</h2>
  126. <ul>
  127. <li>All texts from Wikipedia</li>
  128. <li>Earth image: <a href="https://www.flickr.com/photos/projectapolloarchive/21700614435/">NASA Apollo project archive on Flickr</a> (public domain license)</li>
  129. <li>Moon image: <a href="https://www.flickr.com/photos/projectapolloarchive/21328842073/in/album-72157657139810744/">NASA Apollo project archive on Flickr</a> (public domain license).</li>
  130. <li>Sun image: <a href="http://sdo.gsfc.nasa.gov/gallery/main/item/532">Solar Dynamics Observatory/NASA</a> (public domain license)</li>
  131. <li>Saturn image: <a href="https://www.flickr.com/photos/gsfc/4046388535/in/photolist-7ayNkz-anq9zM-9sBSh3-7emdLM-5WdLyb-7MUdo6-5j1urX-CPCk-9qDHcB-vAAPqD-ajGX7H-8cVZtE-7JUhoJ-7GGghT-89Fo8y-5oKUqh-2NNKPc-9uA1Ep-dUUvY-eC8W6B-Eb8G-9N6fMy-dUUzd-qauzjv-9PPZeQ-5HqQu8-9McTY2-ez2aCx-jka1X9-eAhRA1-7Po7aY-brDoj-9s9ACi-9ZD9i9-seJxzC-4tvCfg-gLScA7-7ayNmn-9YKZ4-9STdQ1-8PNUjh-9TYMzg-qUzEQu-a452X-guArHy-s2VGi4-rPgA9f-5JmPWv-9PUsa2-fcWRK5">NASA Goddard Space Flight Center on Flickr</a> (Creative Commons <a href="https://creativecommons.org/licenses/by/2.0/legalcode">license</a>)</li>
  132. <li>Milky way image: <a href="https://www.flickr.com/photos/image-catalog/22290102206/in/photolist-zXGAP1-sqeeLQ">Image Catalog on Flickr</a> (public domain license)</li>
  133. <li>Starfield image: <a href="https://www.flickr.com/photos/smithsonian/9933989656/in/photolist-g8Qi2J">Smithsonian Institute on Flickr</a> (public domain license)</li>
  134. </ul>
  135. </div>
  136. </footer>
  137. <!-- Start of SVG containing clip paths, filters and masks -->
  138. <svg xmlns="http://www.w3.org/2000/svg" height="0" viewBox="0 0 100 100">
  139. <defs>
  140. <mask id="circlemask" maskUnits="objectBoundingBox" maskContentUnits="objectBoundingBox">
  141. <circle r="0.48" cx="0.5" cy="0.5" fill="#fff" />
  142. </mask>
  143. <clipPath id="sunclip" clipPathUnits="objectBoundingBox">
  144. <polygon points="0.5,0.048 0.558,0.001 0.604,0.06 0.671,0.028 0.702,0.095 0.775,0.08 0.79,0.153 0.864,0.155
  145. 0.862,0.229 0.934,0.248 0.914,0.32 0.98,0.355 0.944,0.42 1,0.469 0.95,0.525 0.993,0.585 0.932,0.628 0.96,0.697 0.89,0.724
  146. 0.902,0.797 0.828,0.808 0.822,0.882 0.748,0.875 0.725,0.946 0.654,0.922 0.616,0.986 0.552,0.946 0.5,0.999 0.448,0.946
  147. 0.384,0.986 0.346,0.922 0.275,0.946 0.252,0.875 0.178,0.882 0.172,0.808 0.098,0.797 0.11,0.724 0.04,0.697 0.068,0.628
  148. 0.007,0.585 0.05,0.525 0,0.469 0.056,0.42 0.02,0.355 0.086,0.32 0.066,0.248 0.138,0.229 0.136,0.155 0.21,0.153 0.225,0.08
  149. 0.298,0.095 0.329,0.028 0.396,0.06 0.442,0.001 "/>
  150. </clipPath>
  151. <clipPath id="saturnclip" clipPathUnits="objectBoundingBox">
  152. <circle fill="#fff" cx="0.5" cy="0.5" r="0.45"/>
  153. <ellipse transform="matrix(-0.7553 0.6554 -0.6554 -0.7553 1.2053 0.5499)" fill="#fff" cx="0.5" cy="0.5" rx="0.639" ry="0.125"/>
  154. </clipPath>
  155. <clipPath id="milkyclip" clipPathUnits="objectBoundingBox">
  156. <path d="M0.769,0.667c-0.127,0.108-0.35,0.121-0.498,0.029s-0.166-0.255-0.04-0.364s0.35-0.121,0.498-0.029S0.895,0.559,0.769,0.667
  157. z"/>
  158. <path d="M0.405,0.708C0.201,0.682,0.102,0.664,0.033,0.563c-0.056-0.082-0.024-0.305,0.162-0.348c0,0-0.125,0.14-0.064,0.285
  159. S0.405,0.708,0.405,0.708z"/>
  160. <path d="M0.405-0.292C0.201-0.318,0.102-0.336,0.033-0.437c-0.056-0.082-0.024-0.305,0.162-0.348c0,0-0.125,0.14-0.064,0.285
  161. S0.405-0.292,0.405-0.292z"/>
  162. <path d="M0.204,0.538C0.139,0.395,0.113,0.323,0.201,0.231c0.072-0.075,0.356-0.161,0.496-0.062c0,0-0.228-0.014-0.373,0.095
  163. S0.204,0.538,0.204,0.538z"/>
  164. <path d="M0.313,0.328c0.141-0.11,0.215-0.161,0.369-0.148c0.124,0.01,0.364,0.152,0.311,0.289c0,0-0.092-0.153-0.292-0.194
  165. S0.313,0.328,0.313,0.328z"/>
  166. <path d="M0.617,0.298c0.2,0.038,0.296,0.061,0.354,0.166C1.019,0.549,0.963,0.77,0.773,0.801c0,0,0.14-0.132,0.095-0.28
  167. C0.822,0.374,0.617,0.298,0.617,0.298z"/>
  168. <path d="M0.799,0.479c0.049,0.146,0.067,0.22-0.031,0.307c-0.08,0.071-0.372,0.14-0.501,0.033c0,0,0.226,0.027,0.382-0.073
  169. S0.799,0.479,0.799,0.479z"/>
  170. <path d="M0.689,0.67c-0.14,0.111-0.214,0.162-0.367,0.15c-0.125-0.01-0.366-0.149-0.314-0.287c0,0,0.094,0.153,0.294,0.192
  171. C0.502,0.767,0.689,0.67,0.689,0.67z"/>
  172. </clipPath>
  173. <clipPath id="cloudclip" clipPathUnits="objectBoundingBox">
  174. <circle class="st0" cx="0.37" cy="0.72" r="0.21"/>
  175. <circle cx="0.38" cy="0.26" r="0.22"/>
  176. <circle cx="0.19" cy="0.51" r="0.17"/>
  177. <circle cx="0.85" cy="0.53" r="0.14"/>
  178. <circle cx="0.65" cy="0.30" r="0.22"/>
  179. <circle cx="0.66" cy="0.69" r="0.19"/>
  180. <circle cx="0.48" cy="0.56" r="0.17"/>
  181. </clipPath>
  182. <mask id="ellipseMask" maskUnits="objectBoundingBox" maskContentUnits="objectBoundingBox">
  183. <radialGradient id="radialfill" r="0.9" cy="1.1">
  184. <stop offset="45%" stop-color="#000"/>
  185. <stop offset="70%" stop-color="#fff"/>
  186. </radialGradient>
  187. <rect width="1" height="1" fill="url(#radialfill)" />
  188. </mask>
  189. </defs>
  190. </svg>
  191. <!-- End of SVG for clip-paths, filters and masks -->
  192. </body>
  193. </html>