Skip to content

Commit

Permalink
Web performance tweaks
Browse files Browse the repository at this point in the history
(See upcoming PR for details)
  • Loading branch information
matteocargnelutti committed May 27, 2022
1 parent 75ab20d commit c871e8b
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ settings.py
__pycache__
.vagrant/
.virtualenvs/
.DS_Store

db.sqlite3
celerybeat-schedule.db
Expand Down
6 changes: 3 additions & 3 deletions capstone/capweb/templates/gallery/section_entries.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
title="{{ entry.title }} homepage"
id="{{ entry.title|slugify }}"
target="_blank">
<img class="gallery-thumbnail" alt="" src="{% if entry.image %}{{ entry.image.url }}{% else %}{% static 'img/gallery-default.jpg' %}{% endif %}">
<img class="gallery-thumbnail" loading="lazy" alt="" src="{% if entry.image %}{{ entry.image.url }}{% else %}{% static 'img/gallery-default.jpg' %}{% endif %}">
</a>
{% elif entry.repo_link %}
<a href="{{ entry.repo_link }}"
aria-label="{{ entry.title }} repository"
title="{{ entry.title }} repository"
id="{{ entry.title|slugify }}"
target="_blank">
<img class="gallery-thumbnail" alt="" src="{% if entry.image %}{{ entry.image.url }}{% else %}{% static 'img/gallery-default.jpg' %}{% endif %}">
<img class="gallery-thumbnail" loading="lazy" alt="" src="{% if entry.image %}{{ entry.image.url }}{% else %}{% static 'img/gallery-default.jpg' %}{% endif %}">
</a>
{% else %}
<img class="gallery-thumbnail" alt="" src="{% if entry.image %}{{ entry.image.url }}{% else %}{% static 'img/gallery-default.jpg' %}{% endif %}">
<img class="gallery-thumbnail" loading="lazy" alt="" src="{% if entry.image %}{{ entry.image.url }}{% else %}{% static 'img/gallery-default.jpg' %}{% endif %}">
{% endif %}

</div>
Expand Down
6 changes: 5 additions & 1 deletion capstone/capweb/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
<div class="main-content bg-black">

<!-- START MAP -->
<div id="app"></div>
<div class="map-section-layout-shift-buffer">
<div id="app"></div>
</div>
<!-- END MAP -->
<!-- START DIVE-IN -->

Expand Down Expand Up @@ -172,12 +174,14 @@ <h2 id="section-dive-in" class="section-title p-0 pt-4 pt-md-3 pt-xl-0 mb-0 mb-m
<div class="col-3 d-none d-lg-block pl-5 pt-4">
<div class="boxcontainer image-boxcontainer mb-3">
<img class="boxcontainer-img"
loading="lazy"
alt="a technician holding disbound pages from a case reporter in front of a high speed scanner"
src='{% static "img/book-scan.jpg" %}'>
<div class="boxcontainer-footer item-credit mt-2">Image: Brooks Kraft/Harvard Law School</div>
</div>
<div class="boxcontainer image-boxcontainer ">
<img class="boxcontainer-img"
loading="lazy"
alt="case reporter books in in stacks"
src='{% static "img/reporters.jpg" %}'/>
<div class="boxcontainer-footer item-credit mt-2">Image: Brooks Kraft/Harvard Law School</div>
Expand Down
95 changes: 66 additions & 29 deletions capstone/static/css/scss/_font-face.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-black-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-black-webfont.woff') format('woff');
Expand All @@ -7,6 +8,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-blackit-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-blackit-webfont.woff') format('woff');
Expand All @@ -15,6 +17,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-bold-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-bold-webfont.woff') format('woff');
Expand All @@ -23,6 +26,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-boldit-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-boldit-webfont.woff') format('woff');
Expand All @@ -32,6 +36,7 @@


@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-extralight-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-extralight-webfont.woff') format('woff');
Expand All @@ -40,6 +45,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-extralightit-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-extralightit-webfont.woff') format('woff');
Expand All @@ -48,6 +54,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-it-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-it-webfont.woff') format('woff');
Expand All @@ -56,6 +63,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-light-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-light-webfont.woff') format('woff');
Expand All @@ -64,6 +72,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-lightit-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-lightit-webfont.woff') format('woff');
Expand All @@ -72,6 +81,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-regular-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-regular-webfont.woff') format('woff');
Expand All @@ -80,6 +90,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-semibold-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-semibold-webfont.woff') format('woff');
Expand All @@ -88,6 +99,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-serif';
src: url('../../fonts/source-serif-pro/sourceserifpro-semiboldit-webfont.woff2') format('woff2'),
url('../../fonts/source-serif-pro/sourceserifpro-semiboldit-webfont.woff') format('woff');
Expand All @@ -96,6 +108,7 @@
}

@font-face {
font-display: swap;
font-family: 'source_sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-black-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-black-webfont.woff') format('woff');
Expand All @@ -104,6 +117,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-blackit-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-blackit-webfont.woff') format('woff');
Expand All @@ -113,6 +127,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-bold-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-bold-webfont.woff') format('woff');
Expand All @@ -122,6 +137,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-boldit-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-boldit-webfont.woff') format('woff');
Expand All @@ -131,6 +147,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-extralight-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-extralight-webfont.woff') format('woff');
Expand All @@ -140,6 +157,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-extralightit-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-extralightit-webfont.woff') format('woff');
Expand All @@ -149,6 +167,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-it-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-it-webfont.woff') format('woff');
Expand All @@ -158,6 +177,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-light-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-light-webfont.woff') format('woff');
Expand All @@ -166,6 +186,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-lightit-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-lightit-webfont.woff') format('woff');
Expand All @@ -174,6 +195,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-regular-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-regular-webfont.woff') format('woff');
Expand All @@ -182,6 +204,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-semibold-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-semibold-webfont.woff') format('woff');
Expand All @@ -190,6 +213,7 @@
}

@font-face {
font-display: swap;
font-family: 'source-sans';
src: url('../../fonts/source-sans-pro/sourcesanspro-semiboldit-webfont.woff2') format('woff2'),
url('../../fonts/source-sans-pro/sourcesanspro-semiboldit-webfont.woff') format('woff');
Expand All @@ -198,63 +222,71 @@
}

@font-face {
font-family: 'source-code';
font-display: swap;
font-family: 'source-code';
src: url('../../fonts/source-code-pro/sourcecodepro-it-webfont.woff2') format('woff2'),
url('../../fonts/source-code-pro/sourcecodepro-it-webfont.woff') format('woff');
font-weight: 400;
font-style: italic;
}

@font-face {
font-family: 'source-code';
font-display: swap;
font-family: 'source-code';
src: url('../../fonts/source-code-pro/sourcecodepro-light-webfont.woff2') format('woff2'),
url('../../fonts/source-code-pro/sourcecodepro-light-webfont.woff') format('woff');
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: 'source-code';
font-display: swap;
font-family: 'source-code';
src: url('../../fonts/source-code-pro/sourcecodepro-lightit-webfont.woff2') format('woff2'),
url('../../fonts/source-code-pro/sourcecodepro-lightit-webfont.woff') format('woff');
font-weight: 300;
font-style: italic;
}

@font-face {
font-family: 'source-code';
font-display: swap;
font-family: 'source-code';
src: url('../../fonts/source-code-pro/sourcecodepro-medium-webfont.woff2') format('woff2'),
url('../../fonts/source-code-pro/sourcecodepro-medium-webfont.woff') format('woff');
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: 'source-code';
font-display: swap;
font-family: 'source-code';
src: url('../../fonts/source-code-pro/sourcecodepro-mediumit-webfont.woff2') format('woff2'),
url('../../fonts/source-code-pro/sourcecodepro-mediumit-webfont.woff') format('woff');
font-weight: 500;
font-style: italic;
}

@font-face {
font-family: 'source-code';
font-display: swap;
font-family: 'source-code';
src: url('../../fonts/source-code-pro/sourcecodepro-regular-webfont.woff2') format('woff2'),
url('../../fonts/source-code-pro/sourcecodepro-regular-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'source-code';
font-display: swap;
font-family: 'source-code';
src: url('../../fonts/source-code-pro/sourcecodepro-semibold-webfont.woff2') format('woff2'),
url('../../fonts/source-code-pro/sourcecodepro-semibold-webfont.woff') format('woff');
font-weight: 600;
font-style: normal;
}

@font-face {
font-family: 'source-code';
font-display: swap;
font-family: 'source-code';
src: url('../../fonts/source-code-pro/sourcecodepro-semiboldit-webfont.woff2') format('woff2'),
url('../../fonts/source-code-pro/sourcecodepro-semiboldit-webfont.woff') format('woff');
font-weight: 600;
Expand All @@ -264,7 +296,8 @@

// Libre
@font-face {
font-family: 'Libre Baskerville';
font-display: swap;
font-family: 'Libre Baskerville';
src: url('../../fonts/LibreBaskerville-Regular.woff') format('woff');
font-weight: 300;
font-style: normal;
Expand All @@ -273,34 +306,38 @@

// Titillium
@font-face {
font-family: 'titillium';
src: url('../../fonts/titilliumweb-bold-webfont.woff2') format('woff2'),
url('../../fonts/titilliumweb-bold-webfont.woff') format('woff');
font-weight: 700;
font-style: normal;
font-display: swap;
font-family: 'titillium';
src: url('../../fonts/titilliumweb-bold-webfont.woff2') format('woff2'),
url('../../fonts/titilliumweb-bold-webfont.woff') format('woff');
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: 'titillium';
src: url('../../fonts/titilliumweb-semibold-webfont.woff2') format('woff2'),
url('../../fonts/titilliumweb-semibold-webfont.woff') format('woff');
font-weight: 600;
font-style: normal;
font-display: swap;
font-family: 'titillium';
src: url('../../fonts/titilliumweb-semibold-webfont.woff2') format('woff2'),
url('../../fonts/titilliumweb-semibold-webfont.woff') format('woff');
font-weight: 600;
font-style: normal;
}

@font-face {
font-family: 'titillium';
src: url('../../fonts/titilliumweb-regular-webfont.woff2') format('woff2'),
url('../../fonts/titilliumweb-regular-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
font-display: swap;
font-family: 'titillium';
src: url('../../fonts/titilliumweb-regular-webfont.woff2') format('woff2'),
url('../../fonts/titilliumweb-regular-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'titillium';
src: url('../../fonts/titilliumweb-extralight-webfont.woff2') format('woff2'),
url('../../fonts/titilliumweb-extralight-webfont.woff') format('woff');
font-weight: 200;
font-style: normal;
font-display: swap;
font-family: 'titillium';
src: url('../../fonts/titilliumweb-extralight-webfont.woff2') format('woff2'),
url('../../fonts/titilliumweb-extralight-webfont.woff') format('woff');
font-weight: 200;
font-style: normal;
}

Loading

0 comments on commit c871e8b

Please sign in to comment.