From f1f9a695b68a77625f4abc885e4570eb51331275 Mon Sep 17 00:00:00 2001 From: Tan Date: Sun, 15 Nov 2020 13:00:51 -0600 Subject: Add Google Classroom recipe Google Classroom with DarkMode supp --- recipes/googleclassroom/LICENSE | 21 +++++ recipes/googleclassroom/README.md | 23 ++++++ recipes/googleclassroom/darkmode.css | 154 +++++++++++++++++++++++++++++++++++ recipes/googleclassroom/icon.png | Bin 0 -> 49059 bytes recipes/googleclassroom/icon.svg | 13 +++ recipes/googleclassroom/index.js | 11 +++ recipes/googleclassroom/package.json | 15 ++++ recipes/googleclassroom/service.css | 1 + recipes/googleclassroom/webview.js | 17 ++++ 9 files changed, 255 insertions(+) create mode 100644 recipes/googleclassroom/LICENSE create mode 100644 recipes/googleclassroom/README.md create mode 100644 recipes/googleclassroom/darkmode.css create mode 100644 recipes/googleclassroom/icon.png create mode 100644 recipes/googleclassroom/icon.svg create mode 100644 recipes/googleclassroom/index.js create mode 100644 recipes/googleclassroom/package.json create mode 100644 recipes/googleclassroom/service.css create mode 100644 recipes/googleclassroom/webview.js (limited to 'recipes/googleclassroom') diff --git a/recipes/googleclassroom/LICENSE b/recipes/googleclassroom/LICENSE new file mode 100644 index 0000000..516df99 --- /dev/null +++ b/recipes/googleclassroom/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Tania R. Zúñiga + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/recipes/googleclassroom/README.md b/recipes/googleclassroom/README.md new file mode 100644 index 0000000..a1a3455 --- /dev/null +++ b/recipes/googleclassroom/README.md @@ -0,0 +1,23 @@ +# Ferdi Google Classroom +A Google Classroom recipe for Ferdi + +Fixes getferdi/recipes#135 + +### Release notes +1.0.2: DarkMode support + +1.0.1: fix serviceURL + +1.0.0: First version + +### How to use? +1. Click on Download ZIP or use `git clone https://github.com/TanZng/ferdi-googleclassroom` +2. On Ferdi click on *Add new service* and go to *Custom Service* +3. Click on *Open Folder* +4. In the folder that Ferdi opened for you `...\Ferdi\recipes\dev`, drag the **unzip** ferdi-googleclassroom folder +5. After that Google Classroom should appear on Custom Services. If not, restart Ferdi. + +> :warning: **Don't use dark mode**: Google Classroom page will load with a black background! We are fixing it. + +### How to create your own Ferdi recipes: +* [Read the documentation](https://github.com/getferdi/recipes/blob/master/docs/integration.md) diff --git a/recipes/googleclassroom/darkmode.css b/recipes/googleclassroom/darkmode.css new file mode 100644 index 0000000..0e47715 --- /dev/null +++ b/recipes/googleclassroom/darkmode.css @@ -0,0 +1,154 @@ +html { +-webkit-filter:invert(90%) hue-rotate(180deg)!important; +filter:invert(90%) hue-rotate(180deg)!important; +background:#191919!important; +} + +.CflnFb { +background-color:#7b96c1!important; +filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; +color:#FFF!important; +} + +.h5t3Nc .GrK4Mb,.h5t3Nc .hVDHke,.h5t3Nc .l7VQxb,.h5t3Nc .zP0T0b,.h5t3Nc .qNixLe { +background-color:#c9c9c9; +border-color:#FFF; +} + +.lq96Td { +background-color:#003e3a!important; +color:#FFF!important; +filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; +} + +.GooADb { +color:#9dceff!important; +text-shadow:0 0 #404040!important; +} + +.bJZIjf.qs41qe { +opacity:0.3; +} + +#gb a.gb_ja,#gb a.gb_ja:visited,#gb a.gb_ja:active,#gb a.gb_ka,#gb a.gb_ka:visited { +color:rgba(255,255,255,0.87)!important; +text-decoration:none!important; +background-color:#000!important; +} + +.M6tHv { +background-color:#444!important; +} + +.gb_ea.gb_6f { +background-color:#e8e8e8!important; +} + +.gb_yc svg,.gb_kc svg { +color:#000!important; +opacity:.54!important; +} + +.HkPXyb { +background-color:#f9f9f9; +} + +.EfQccc.F262Ye.EiZ8Dd::after { +border-color:#000; +} + +.uHMk6b.fsHoPb { +border:7px solid #000!important; +} + +.g3VIld.GFhhge.Up8vH.hFEqNb.J9Nfi.iWO5td { +filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; +background:#191919!important; +color:#FFF!important; +} + +.g3dbUc .jKgTF,.QGRmIf,.lcPUt { +filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; +font-weight:700!important; +mix-blend-mode:darken; +} + +.g3dbUc.UflSff { +filter:invert(100%) hue-rotate(180deg) saturate(140%) contrast(105%) opacity(40%)!important; +color:#404040!important; +} + +.NlL62b.EfQccc.elYzab-cXXICe-Hjleke.EiZ8Dd.UflSff.jKgTF { +filter:invert(100%) hue-rotate(180deg) saturate(140%) contrast(50%) brightness(140%) opacity(90%)!important; +} + +.NlL62b.EfQccc.elYzab-cXXICe-Hjleke.EiZ8Dd.UflSff { +filter:opacity(80%)!important; +} + +.NlL62b.EfQccc.elYzab-cXXICe-Hjleke.EiZ8Dd.jKgTF { +filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; +font-weight:700!important; +} + +.W0m3G { +font-weight:500!important; +} + +.g3dbUc { +font-weight:900!important; +color:#000!important; +} + +.g3dbUc.smECzc { +color:#666!important; +} + +.FAxxKc { +font-weight:600!important; +color:#000!important; +} + +.rq8Mwb { +filter:invert(100%)!important; +} + +.WpDZC,.zHQkBf { +color:#c1c1c1!important; +} + +.XHsn7e,.YqtBEc,.xuBVOe,.Mh0NNb,.ck4bY,.asor.asor_i0,.gsoi.gsoi_w,.gsoi.gsoi_c.asor_v,.gsoi.gsoi_9.asor_v,.gsoi.gsoi_7.asor_v,#vqd3vxfo4jpl,#pnsketfj08m,.st-wc,.NlL62b.EfQccc.elYzab-cXXICe-Hjleke.EiZ8Dd,.a63c9c.ztKZ3d,.a63c9c,.Oxm52e,.kImhzd,.hsrazb,.Tnsqdc,.kw5sif,.kXIDId,.sIyjR,.ghXZpb,.whsOnd.zHQkBf { +filter:invert(100%) hue-rotate(180deg) brightness(1.1) saturate(140%) contrast(105%)!important; +} + +.gb_3,#rAECCd,.jPtXgd { +font-weight:600!important; +} + +#I0_1513527137275,.gb_W,:not([data-date]):before,img,svg,.jPtXgd,.gb_Wa.gb_Fe,.fFW7wc-OEVmcd { +filter:invert(100%) hue-rotate(180deg) brightness(1.1) contrast(105%)!important; +} + +.Wbs5sd,.rF3YF.wmyjXb,.A6wOnd,.VgueE,.Jmftzc.gVNoLb.EiZ8Dd,.Jmftzc.K9QN7e.EiZ8Dd.UflSff,.Jmftzc.K9QN7e.EiZ8Dd,.i5a7ie,.gb_Eb { +color:#000!important; +} + +.EfQccc.Hrn1mc.EiZ8Dd::after,.EfQccc.MmaWIb.KKjvXb.EiZ8Dd::after { +border:1px solid #000; +} + +.XBkKC.WSvIUd,.logo-plus-button-lockup-text { +color:#FFF; +} + +.IP9Hyd .O0WRkf:first-child,.gb_je.gb_ee { +color:#fff; +} + +.Jmftzc.gVNoLb.LKeQwe,.Jmftzc.EiZ8Dd { +color:#000; +} + +.gb_fa.gb_ng,.gb_Z { +font-weight:bolder!important; +} diff --git a/recipes/googleclassroom/icon.png b/recipes/googleclassroom/icon.png new file mode 100644 index 0000000..5dbd55e Binary files /dev/null and b/recipes/googleclassroom/icon.png differ diff --git a/recipes/googleclassroom/icon.svg b/recipes/googleclassroom/icon.svg new file mode 100644 index 0000000..922bd4e --- /dev/null +++ b/recipes/googleclassroom/icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/recipes/googleclassroom/index.js b/recipes/googleclassroom/index.js new file mode 100644 index 0000000..c9bd550 --- /dev/null +++ b/recipes/googleclassroom/index.js @@ -0,0 +1,11 @@ +var os = require('os') + +module.exports = Franz => + class googleclassroom extends Franz { + overrideUserAgent() { + if (os.platform() == 'linux') + return "Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0" + else + return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0"; + } + }; \ No newline at end of file diff --git a/recipes/googleclassroom/package.json b/recipes/googleclassroom/package.json new file mode 100644 index 0000000..b33114c --- /dev/null +++ b/recipes/googleclassroom/package.json @@ -0,0 +1,15 @@ +{ + "id": "googleclassroom", + "name": "Google Classroom", + "version": "1.0.2", + "description": "Google Classroom", + "main": "index.js", + "author": "Tania R. Zuniga ", + "license": "MIT", + "repository": "https://github.com/TanZng/ferdi-googleclassroom", + "config": { + "serviceURL": "https://accounts.google.com/ServiceLogin/signinchooser?service=classroom&passive=1209600&continue=https%3A%2F%2Fclassroom.google.com%2F%3Fsafe%3Dactive&followup=https%3A%2F%2Fclassroom.google.com%2F%3Fsafe%3Dactive&emr=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin", + "hasTeamId": false, + "hasNotificationSound": false + } + } diff --git a/recipes/googleclassroom/service.css b/recipes/googleclassroom/service.css new file mode 100644 index 0000000..38dcab0 --- /dev/null +++ b/recipes/googleclassroom/service.css @@ -0,0 +1 @@ +/* Insert custom styles you want to insert here */ \ No newline at end of file diff --git a/recipes/googleclassroom/webview.js b/recipes/googleclassroom/webview.js new file mode 100644 index 0000000..c53fe10 --- /dev/null +++ b/recipes/googleclassroom/webview.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = Franz => { + const getMessages = function getMessages() { + var homework = 0 + const upcomingAssignment = document.getElementsByClassName('hrUpcomingAssignmentGroup') + if (upcomingAssignment.length != 0) { + var i; + for (i = 0; i < upcomingAssignment.length; i++) { + homework += upcomingAssignment[i].childElementCount; + } + } + Franz.setBadge(parseInt(homework, 10)); + }; + + Franz.loop(getMessages); +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2