Skip to content

Instantly share code, notes, and snippets.

View bmbrands's full-sized avatar

Bas Brands bmbrands

View GitHub Profile
@bmbrands
bmbrands / custom-css-sliders-cdtop.css
Last active November 22, 2019 10:26
custom-css-sliders-cdtop.css
.cd-top {
display: inline-block;
height: 40px;
width: 40px;
position: fixed;
bottom: 40px;
right: 10px;
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
/* image replacement properties */
<div class="slider-item">
<div class="slider-range"><input type="range"></div>
<div class="slider-label">1.1 Population dynamics</div>
</div>
<div class="slider-item">
<div class="slider-range"><input type="range"></div>
<div class="slider-label">1.2 Migration</div>
</div>
<div class="slider-item">
<div class="slider-range"><input type="range"></div>
@bmbrands
bmbrands / custom-sliders.js
Last active October 3, 2019 14:50
Custom JavaScript to remember input range state
<script
src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8="
crossorigin="anonymous"></script>
<script type="text/javascript">
var SELECTORS = {
LABELS: '.modtype_label',
RANGES: 'input[type="range"]'
};
@bmbrands
bmbrands / custom-css-sliders.css
Last active October 28, 2019 13:03
Custom CSS for HTML sliders
@media (min-width: 800px) {
.slider-item {
display: flex;
align-items: center;
margin-bottom: 0.5rem; }
.slider-item .slider-range {
flex: 0 0 220px;
max-width: 220px;
margin-right: 1rem; }
.slider-item .slider-label {
<div class="moodlevideo fluid-width-video-wrapper">
<iframe width="640" height="360" frameborder="0" allowfullscreen="true"
src="//player.vimeo.com/video/INSERTVIMEOID?api=1&amp;player_id=vimeoplayer"></iframe>
</div>
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@bmbrands
bmbrands / testsort-carddeck.php
Last active October 23, 2018 10:28
card-deck drag & drop
<?php
include __DIR__."/config.php";
$PAGE->set_context(context_system::instance());
$PAGE->set_url('/testsort.php');
$PAGE->set_pagelayout('admin');
echo $OUTPUT->header();
echo $OUTPUT->heading('Sortable list examples');
$dragdrop = $OUTPUT->render_from_template('core/drag_handle', ['movetitle' => get_string('move')]);
{
"name": "theme-reboost-tasks",
"version": "0.1.0",
"description": "Grunt tasks for Moodle Boost theme.",
"main": "Gruntfile.js",
"author": {
"name": "Bas Brands",
"url": "http://www.moodle.org"
},
"devDependencies": {
'use strict';
module.exports = function(grunt) {
// Import modules.
var path = require("path");
// PHP strings for exec task.
var moodleroot = path.dirname(path.dirname(__dirname));
var dirrootopt = grunt.option("dirroot") || process.env.MOODLE_DIR || "";
@bmbrands
bmbrands / courseimages.php
Created April 26, 2016 10:02
Get a image for a course from the course summary files
<?php
require_once("config.php");
function course_image($courseid) {
global $DB, $CFG;
require_once($CFG->libdir. '/coursecatlib.php');
$courserecord = $DB->get_record('course', array('id' => $courseid));