Skip to main content

LED Solar Lights

 These: https://amzn.to/3FoGFQQ which I have mounted in my 20x20 dog pen. They light the whole thing up brightly, and I've tested them after about 11 hours and they were still bright. I also have these on my fence lining my driveway. https://amzn.to/3tskRRQ

Making Google Calendar a responsive embed with Mobile support

Google Calendar is amazing, but the embed code is pretty old.  They haven't updated it in many years.

Since everything is Mobile First today, I needed a way to display better on cell phones.

The following code does the following:

  • Define a Responsive Cal types so that it uses 100% of the frame
  • Define a DeskContent and a PhoneContent sizes (with a width of 768 being the switch point) 
  • Wrap all of it in the Responsive Call Div so it all resizes automatically
  • Display the Month view of the calendar if it's a desktop resolution
  • Display the Agenda view of the calendar if it's a mobile resolution

<style>
.responsiveCal {
position: relative; padding-bottom: 75%; height: 0; overflow: hidden;
}
.responsiveCal iframe {
position: absolute; top:0; left: 0; width: 100%; height: 100%;
}
@media all and (min-width: 768px) {
.deskContent {display:block;}
.phoneContent {display:none;}
}
@media all and (max-width: 767px) {
.deskContent {display:none;}
.phoneContent {display:block;}
}
</style>
<div class="responsiveCal">
<div class="deskContent"><iframe src="https://calendar.google.com/calendar/embed?src=m7djtqdm8q7b43kol0nu295sko%40group.calendar.google.com&ctz=America%2FNew_York" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
</div>
<div class="phoneContent"><iframe src="https://calendar.google.com/calendar/embed?mode=AGENDA&amp;height=400&amp;wkst=1&amp;src=m7djtqdm8q7b43kol0nu295sko%40group.calendar.google.com&ctz=America%2FNew_York" style="border: 0" width="280" height="500" frameborder="0" scrolling="no"></iframe></div></div>
view raw gistfile1.txt hosted with ❤ by GitHub


I've formatted this so that it can be placed inline in your HTML file.

The first Embed should be your calendar code set to the Month view.

The second Embed should be your calendar code set to the Agenda view.

Comments

  1. Works great; thanks for the help!

    ReplyDelete
  2. Thank you so much! I was looking everywhere to find the correct code and multipe tries. Worked like a charm. Thank you again so much!

    ReplyDelete
  3. I just used this and it totally worked!! Thank you for taking the time to put this together!!!! Easy to work out.

    ReplyDelete

Post a Comment

Most Popular Posts

First Post!

In August 1999, I bought my own domain name, mpking.com .  This domain name. Over the years I've used a variety of blogging software. Initially I did all the website design myself, hand crafting the HTML myself. I even had one of those *Designed by Notepad* buttons. I still have one of the custom drop cap letters I made. Yea, it's really hard to see, because it's White text.  My first website, like most all bad websites of the early 2000, was black theme.  I ran the website off my computer in my room. I quickly tired of this, and moved onto a Blog software platform.  You used an actual program program, (I don't remember it's name) and you would type up your entry, then upload it to the website.  That tired quickly, as the software was at home, and most entries, then as now, revolved around work. Then I discovered FreeGuppy .  It was online CMS platform, and it was nearly perfect, for almost five years.I even developed some pl...