Download components/timeline.js from FaZeranajit/tertiary-tales-explorer-interactive-data-visualization: direct link, hf CLI and curl.
- Browser
- Download file 3.49 kB
-
https://huggingface.co/spaces/FaZeranajit/tertiary-tales-explorer-interactive-data-visualization/resolve/main/components/timeline.js
- Command line
-
hf download hf://spaces/FaZeranajit/tertiary-tales-explorer-interactive-data-visualization/components/timeline.js
-
curl -L -o timeline.js https://huggingface.co/spaces/FaZeranajit/tertiary-tales-explorer-interactive-data-visualization/resolve/main/components/timeline.js
3.49 kB
| class CustomTimeline extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| .timeline-container { | |
| padding: 2rem 0; | |
| } | |
| .timeline-title { | |
| text-align: center; | |
| font-size: 1.8rem; | |
| color: #4f46e5; | |
| margin-bottom: 2rem; | |
| } | |
| .timeline { | |
| position: relative; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| } | |
| .timeline::after { | |
| content: ''; | |
| position: absolute; | |
| width: 6px; | |
| background-color: #6366f1; | |
| top: 0; | |
| bottom: 0; | |
| left: 50%; | |
| margin-left: -3px; | |
| } | |
| .timeline-item { | |
| padding: 10px 40px; | |
| position: relative; | |
| width: 50%; | |
| box-sizing: border-box; | |
| } | |
| .timeline-item::after { | |
| content: ''; | |
| position: absolute; | |
| width: 25px; | |
| height: 25px; | |
| right: -12px; | |
| background-color: white; | |
| border: 4px solid #6366f1; | |
| top: 15px; | |
| border-radius: 50%; | |
| z-index: 1; | |
| } | |
| .left { | |
| left: 0; | |
| } | |
| .right { | |
| left: 50%; | |
| } | |
| .timeline-content { | |
| padding: 20px 30px; | |
| background-color: white; | |
| position: relative; | |
| border-radius: 6px; | |
| box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); | |
| } | |
| .timeline-date { | |
| font-weight: bold; | |
| color: #4f46e5; | |
| margin-bottom: 0.5rem; | |
| } | |
| @media screen and (max-width: 768px) { | |
| .timeline::after { | |
| left: 31px; | |
| } | |
| .timeline-item { | |
| width: 100%; | |
| padding-left: 70px; | |
| padding-right: 25px; | |
| } | |
| .timeline-item::after { | |
| left: 18px; | |
| } | |
| .right { | |
| left: 0%; | |
| } | |
| } | |
| </style> | |
| <div class="timeline-container"> | |
| <h2 class="timeline-title">Evolution of Tertiary Activities</h2> | |
| <div class="timeline"> | |
| <div class="timeline-item left"> | |
| <div class="timeline-content"> | |
| <div class="timeline-date">1950s</div> | |
| <p>Basic services dominated (retail, transportation)</p> | |
| </div> | |
| </div> | |
| <div class="timeline-item right"> | |
| <div class="timeline-content"> | |
| <div class="timeline-date">1970s</div> | |
| <p>Tourism and hospitality industries expanded globally</p> | |
| </div> | |
| </div> | |
| <div class="timeline-item left"> | |
| <div class="timeline-content"> | |
| <div class="timeline-date">1990s</div> | |
| <p>Information technology services began rapid growth</p> | |
| </div> | |
| </div> | |
| <div class="timeline-item right"> | |
| <div class="timeline-content"> | |
| <div class="timeline-date">2000s</div> | |
| <p>Outsourcing and offshoring became prominent</p> | |
| </div> | |
| </div> | |
| <div class="timeline-item left"> | |
| <div class="timeline-content"> | |
| <div class="timeline-date">2020s</div> | |
| <p>Digital services and remote work transformed the sector</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-timeline', CustomTimeline); |