Skip to content

Commit 1dbf84c

Browse files
authored
Merge pull request #571 from jupyter/responsive-iframe
Responsive Google Calendar iframe
2 parents 828af49 + 25ce226 commit 1dbf84c

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

_sass/components/_iframes.scss

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.iframe-container {
2+
position: relative;
3+
overflow: hidden;
4+
width: 100%;
5+
padding-top: 75%; /* 4:3 Aspect Ratio */
6+
@media (max-width: 767px) {
7+
padding-top: 130%; /* A custom aspect ratio for Google Calendar */
8+
}
9+
}
10+
11+
.responsive-iframe {
12+
position: absolute;
13+
top: 0;
14+
left: 0;
15+
bottom: 0;
16+
right: 0;
17+
width: 100%;
18+
height: 100%;
19+
}

assets/css/main.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
@import "components/footer";
1414
@import "components/jumbotron";
1515
@import "components/jupyterhub";
16-
@import "components/page-header";
16+
@import "components/page-header";
17+
@import "components/iframes";

community.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,17 @@ This page is for in person, one-of-a-kind events, for community engagement, see
135135

136136
This is a calendar of regular online events. It might not be exhaustive.
137137

138-
<iframe title="Calendar of Project Jupyter events" id="calendariframe" src="https://calendar.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23ffffff&amp;ctz=local&amp;src=ZGdwZDM2ZjQzZXQ5Z3JhYm42dGRpbjZwbWNAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;src=bTNoZWs2OWRhZzczODF1bXQ4a2NqZDc1dTRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;src=YXFwa3VpNXE3b2kzMnBrOXRjcDUzaG5zc2NAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;src=ZDE4NzR1cjZmZGh1ajBzbmpuaWxhYzJubGNAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;src=cGlhaGluZWpqcjZzc3ZpOGlrbWpqb3A2cm9AZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;color=%23AD1457&amp;color=%23EF6C00&amp;color=%23616161&amp;color=%23F6BF26&amp;color=%239E69AF" style="border:solid 1px #777" width="800" height="600" frameborder="0" scrolling="no"></iframe>
138+
<div class="iframe-container">
139+
<iframe title="Calendar of Project Jupyter events"
140+
class="responsive-iframe"
141+
id="calendariframe"
142+
src="https://calendar.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23ffffff&amp;ctz=local&amp;src=ZGdwZDM2ZjQzZXQ5Z3JhYm42dGRpbjZwbWNAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;src=bTNoZWs2OWRhZzczODF1bXQ4a2NqZDc1dTRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;src=YXFwa3VpNXE3b2kzMnBrOXRjcDUzaG5zc2NAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;src=ZDE4NzR1cjZmZGh1ajBzbmpuaWxhYzJubGNAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;src=cGlhaGluZWpqcjZzc3ZpOGlrbWpqb3A2cm9AZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&amp;color=%23AD1457&amp;color=%23EF6C00&amp;color=%23616161&amp;color=%23F6BF26&amp;color=%239E69AF"
143+
style="border:solid 1px #777"
144+
width="800"
145+
height="600"
146+
frameborder="0"
147+
scrolling="no"></iframe>
148+
</div>
139149
<script>document.getElementById("calendariframe").src = document.getElementById("calendariframe").src.replace("ctz=local", "ctz=" + Intl.DateTimeFormat().resolvedOptions().timeZone)</script>
140150

141151
See [this page](https://jupyter.readthedocs.io/en/latest/community/content-community.html#jupyter-wide-meetings) for

0 commit comments

Comments
 (0)