Skip to content

Instantly share code, notes, and snippets.

View itsonlyjames's full-sized avatar
🔥

James Alexandre itsonlyjames

🔥
  • Melbourne, Australia
View GitHub Profile
@itsonlyjames
itsonlyjames / Obsidian—Headings Indent.css
Last active July 8, 2024 01:36
Obsidian Indenting Based on Heading level, preview AND reading mode
/* Indent level 2 */
.markdown-source-view div.HyperMD-header.HyperMD-header-2 ~ div:not(.HyperMD-header),
.markdown-source-view div.HyperMD-header.HyperMD-header-2 ~ .HyperMD-header.HyperMD-header-3,
.markdown-reading-view div:has(h2):not(.mod-footer) ~ div:not(:has(h1)):not(:has(h2)):not(.mod-footer),
.markdown-reading-view div:has(h2):not(.mod-footer) ~ div:has(h3):not(.mod-footer) {
margin-left: 20px !important;
}
/* Indent level 3 */
.markdown-source-view div.HyperMD-header.HyperMD-header-3 ~ div:not(.HyperMD-header),
@itsonlyjames
itsonlyjames / Obsidian—Bullet Threading.css
Last active July 4, 2024 08:23
Obsidian Bullet Threading, Edit AND Live Preview Modes
body {
--list-threading-color: var(--color-accent);
--outline-guideline-width: var(--size-2-1);
--outline-guideline-color: var(--h1-color);
--outline-item-height: calc(var(--nav-item-size) * 1.8);
--list-threading-offset: var(--indentation-guide-source-indent);
--height-live-view: calc(0.85em - var(--outline-guideline-width) / 2);
--height-source-view: calc(0.925em - var(--outline-guideline-width) / 2);
}
@itsonlyjames
itsonlyjames / index.html
Last active February 21, 2016 23:49
Scroll to top of div
<div class="scroll-to">
<a id="floorplanlink" href="/">floorplan</a>
<a id="featuredinclusionslink" href="/">featured inclusions</a>
<a id="specificationslink" href="/">specifications</a>
</div>
@itsonlyjames
itsonlyjames / scripts.js
Last active February 21, 2016 23:49
Menu only opens/closes once animation is complete (this is using velocity, but can hook into stock jQuery animation too)
var button = $(".mobile-button");
var menu = $(".menu");
var classOpen = 'menu-is-open';
button.bind('click', function(el, ev) {
menu.toggle($(this), ev);
return false;
});
$(".header").click(function(e) {
@itsonlyjames
itsonlyjames / main.html
Last active August 29, 2015 14:26
Equal width dynamic nav bar. This is used to split the width of the menu's elements and set all of their widths to be the same.
<div class="header">
<ul class="menu">
<li>
<a href="">menu 1</a>
</li>
<li>
<a href="">menu 2</a>
</li>
<li>
<a href="">menu 3</a>
@itsonlyjames
itsonlyjames / scripts.js
Last active June 1, 2016 04:59
Hide mobile menu when browser is larger than x even if mobile menu is opened
$(window).resize(function() {
var $menu = $('#mobilenav');
if ($(window).width() > 769) {
// Window is larger than 767 pixels wide
if (!$menu.data('keepVisible')) {
// Hide the menu if it hasn't been kept visible by the user
$menu.hide();
}
} else if ($menu.is(':hidden') || $menu.data('keepVisible')) {
@itsonlyjames
itsonlyjames / scripts.js
Created July 17, 2015 08:48
Isotope layout/responsive with facetwp sorting plugin
// initially fire isotope layout
var $grid = $('.grid').isotope({
itemSelector: '.grid-item',
transitionDuration: 0,
masonry: {
columnWidth: 100
}
});
// runs isotope reload on facetwp change
@itsonlyjames
itsonlyjames / main.scss
Last active August 29, 2015 14:24
Remove Psuedo elements from current selected and also previous
a {
&:after {
content: "|";
}
}
.hidden:after {
display: none;
}
@itsonlyjames
itsonlyjames / main.html
Last active February 21, 2016 23:52
Equal width dynamic nav bar, also with text left/right/center depending on where element is positioned in the nav. Also now it's responsive. However, probably best to cut out the behaviour and removes classes once mobile/tablet view is reached.
<div class="header">
<img src="http://placehold.it/900x80" class="img" />
<ul class="menu">
<li>
<a href="">menu 1</a>
</li>
<li>
<a href="">menu 2</a>
</li>
<li>
@itsonlyjames
itsonlyjames / main.html
Last active February 21, 2016 23:52
Box matches height of overlay, this way the overlay doesn't overflow the parent box. It's using the auto height script which is needed to accomplish this.
<div class="boxes">
<a href="javascript:void(0);" class="box">
<div class="image">
<img src="">
</div>
<h3>Title</h3>
<div class="overlay">
<h3>Title</h3>
<p>Overlay Text</p>
</div>