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
167 changes: 167 additions & 0 deletions src/templates/ar/2019/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{% extends "base.html" %}

{% block dir_attribute %}dir="rtl"{% endblock %}

{% block styles %}
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link href="https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i,900%7CPoppins:300,400,700,900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/static/css/2019.css">
{% endblock %}

{% block content%}
{% block header %}
<header class="alt-bg">
<div class="top-header">
<a class="navigation-logo" href="{{ url_for('home', year=year, lang=lang) }}"><img src="/static/images/logo.svg" alt="Web Almanac by HTTP Archive"></a>
<nav>
<a href="{{ url_for('table_of_contents', year=year, lang=lang) }}">Table of Contents</a>
<a href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
{% if supported_years | length > 1 %}
{{ year_switcher() }}
{% endif %}
</nav>
<div class="cta">
{% if request.endpoint == 'home' %}
<a href="{{ url_for('table_of_contents', year=year, lang=lang) }}" class="alt btn">
Start Exploring
</a>
{% endif %}
{{ language_switcher() }}
</div>
<button type="button" class="menu-btn" arial-label="Menu">
<img class="menu-icon" src="/static/images/menu.png" data-src-close="/static/images/close.png" alt="" />
</button>
<nav class="menu">
<a href="{{ url_for('table_of_contents', year=year, lang=lang) }}">Table of Contents</a>
<a href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
<div class="misc">
<a href="https://httparchive.org/">
<img src="/static/images/ha-home.png" alt="HTTP Archive home" height="35" width="70">
</a>
<div class="social-media">
<a href="https://twitter.com/HTTPArchive" class="twitter">
<img src="/static/images/twitter.png" height="80" width="65" alt="Twitter" loading="lazy" />
</a>
<a href="https://github.com/HTTPArchive/almanac.httparchive.org" class="github">
<img src="/static/images/github.png" height="80" width="78" alt="GitHub" loading="lazy" />
</a>
</div>
{{ language_switcher() }}
</div>
</nav>
</div>
{% if request.endpoint == 'home' %}
<div class="intro-container">
<div class="intro">
<div class="intro-year">2019</div>
<h1 class="title title-lg title-alt">Web Almanac</h1>
<h2>
HTTP Archive's annual<br>
<b>state of the web</b> report
</h2>
<p>
Our mission is to combine the raw stats and trends of the HTTP Archive with the expertise of the web community. The Web Almanac is a comprehensive report on the state of the web, backed by real data and trusted web experts. It is comprised of 20 chapters spanning aspects of page content, user experience, publishing, and distribution.
</p>
<a href="{{ url_for('table_of_contents', year=year, lang=lang) }}" class="btn">
Start exploring
</a>
</div>
<img class="intro-image-2019" src="/static/images/home-hero-2019.png" alt="The Web Almanac 2019 edition" />
<img class="intro-image" src="/static/images/home-hero.png" alt="The Web Almanac 2019 edition" />
</div>
{% endif %}
</header>
{% endblock %}

{% block main %}{% endblock %}

{% block footer %}
<footer class="alt-bg">
<a class="navigation-logo home-logo" href="{{ url_for('home', year=year, lang=lang) }}"><img src="/static/images/logo.svg" alt="Web Almanac by HTTP Archive"></a>
<a class="navigation-logo ha-logo" href="https://httparchive.org">
<img src="/static/images/ha-home.png" alt="HTTP Archive home" height="35" width="70">
</a>
<nav class="nav-items">
<a href="{{ url_for('table_of_contents', year=year, lang=lang) }}">Table of Contents</a>
<a href="{{ url_for('contributors', year=year, lang=lang) }}">Contributors</a>
<a href="{{ url_for('methodology', year=year, lang=lang) }}">Methodology</a>
</nav>
<div class="language-switcher">{{ language_switcher() }}</div>
<p class="copyright"><span>© 2019 Web Almanac. Licensed under <a href="https://github.com/HTTPArchive/almanac.httparchive.org/blob/master/LICENSE">Apache 2.0</a>.</span></p>
<div class="social-media">
<a href="https://twitter.com/HTTPArchive" class="twitter">
<img src="/static/images/twitter.png" alt="Twitter" height="80" width="65" loading="lazy" />
</a>
<a href="https://github.com/HTTPArchive/almanac.httparchive.org" class="github">
<img src="/static/images/github.png" alt="GitHub" height="80" width="78" loading="lazy" />
</a>
</div>
<hr>
<hr>
</footer>
{% endblock %}
{% block scripts %}
<script nonce="{{ csp_nonce() }}">
(function() {
// Language switching
var languageSwitchers = document.querySelectorAll('.language-switcher select');
for (var i = 0; i < languageSwitchers.length; i++) {
languageSwitchers[i].addEventListener('change', function(e) {
if (e.target.value) {
window.location = e.target.value;
}
});
}

// Mobile menu
var menuIcon = document.querySelector('.menu-icon');
var menuIconInitialSrc = document.querySelector('.menu-icon').src;
var menuIconSrcClose = document.querySelector('.menu-icon').dataset.srcClose;

document.querySelector('.menu-btn').addEventListener('click', function() {
var menuOpen = document.body.classList.toggle('menu-open');
menuIcon.src = menuOpen ? menuIconSrcClose : menuIconInitialSrc;
});
})();
</script>
{% endblock %}
{% endblock %}

{% macro language_switcher() %}
{% if supported_languages | length > 1%}
<div class="language-switcher">
{% if language is not none %}
<img src="/static/images/{{ language }}.png" class="flag" height="25" width="25" loading="lazy" />
{% else %}
<img src="/static/images/English.png" class="flag" height="25" width="25" loading="lazy" />
{% endif %}
<select>
{% for l in supported_languages %}
<option
{% if l == language %}selected="selected"{% endif %}
value="{{ url_for(request.endpoint, **get_view_args(lang=l.lang_code)) }}">
{{ l }}
</option>
{% endfor %}
</select>
<img class="dropdown-arrow" src="/static/images/dropdown-arrow.png" alt="open" height="20" width="20" loading="lazy" />
</div>
{% endif %}
{% endmacro %}

{% macro year_switcher() %}
<div class="year-switcher">
<select>
{% for y in supported_years %}
<option
{% if y == year %}selected="selected"{% endif %}
value="{{ url_for('table_of_contents', **get_view_args(year=y)) }}">
{{ y }} Edition
</option>
{% endfor %}
</select>
<img class="dropdown-arrow" src="/static/images/dropdown-arrow.png" alt="open" height="20" width="20" loading="lazy" />
</div>
{% endmacro %}
2 changes: 1 addition & 1 deletion src/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="{% block lang %}{{ language.lang_attribute }}{% endblock %}">
<html lang="{% block lang %}{{ language.lang_attribute }}{% endblock %}" {% block dir_attribute %}{% endblock %}>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down