Skip to content

Instantly share code, notes, and snippets.

View svondervoort's full-sized avatar
👾
Just playing around

Sander van de Vondervoort svondervoort

👾
Just playing around
  • The Netherlands
View GitHub Profile
@svondervoort
svondervoort / code.html
Last active May 10, 2021 09:46
Resize the video so it covers the whole wrapper but keeps its aspect ratio
<div class="video-wrapper video-wrapper--js">
<div class="video video--js">
<div class="w-100 h-100 embed-responsive">
<iframe src="https://player.vimeo.com/video/542626427?autoplay=1&loop=1&color=ffffff&title=0&byline=0&portrait=0&muted=1&dnt=1" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe><script src="https://player.vimeo.com/api/player.js"></script>
</div>
</div>
</div>
// Call this function with a form as parameter everytime an input changes
function checkConditions(form) {
let conditions = [];
form.find('div[data-conditional] :input').each(function(){
let value = $(this).val();
conditions.push(value);
});
$.each(conditions, function( index, value ) {
@svondervoort
svondervoort / toggle.scss
Created October 23, 2020 09:07
Toggle classes for changing icon or content inside a toggle
.toggle {
.open { display: none; }
.closed { display: block; }
&--active {
.open { display: block; }
.closed { display: none; }
}
}
@svondervoort
svondervoort / scss-mixin-position.scss
Last active March 31, 2020 09:20
SCSS Mixin collection
// @mixin position()
// Mixin for easy positioning
// All variables are optional
@mixin position($position: relative, $top: auto, $right: auto, $bottom: auto, $left: auto, $z-index: unset) {
position: $position;
top: $top;
right: $right;
bottom: $bottom;
left: $left;