Add masonry, partly styled

replace/de86d7dcb4fa468baba7ae5a30b51451c6089e20
Cobular 5 years ago
parent 5976f479eb
commit 0eb7b00bca

@ -2,9 +2,21 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>About Me</title> <title>About Me</title>
<link rel="stylesheet" href="css/main.css">
</head> </head>
<body> <body>
<header class="header">
<a href="index.html" class="name">Jake Cover</a>
<div class="header-right">
<a class="active" href="index.html">Home</a>
<a href="contact.html">Contact</a>
<a href="about.html">About</a>
<a href="https://github.com/JakeCover">GitHub</a>
</div>
</header>
</body> </body>
</html> </html>

@ -2,9 +2,21 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>Contact Me</title> <title>Contact Me</title>
<link rel="stylesheet" href="css/main.css">
</head> </head>
<body> <body>
<header class="header">
<a href="index.html" class="name">Jake Cover</a>
<div class="header-right">
<a class="active" href="index.html">Home</a>
<a href="contact.html">Contact</a>
<a href="about.html">About</a>
<a href="https://github.com/JakeCover">GitHub</a>
</div>
</header>
</body> </body>
</html> </html>

@ -0,0 +1,3 @@
/*# sourceMappingURL=breakpoint-helpers.css.map */

@ -1,40 +0,0 @@
.header {
overflow: hidden;
background-color: lightgrey;
padding: 20px 10px; }
.header a {
float: left;
color: black;
text-align: center;
padding: 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px; }
.header a.name {
font-size: 25px;
font-weight: bold; }
.header a:hover {
background-color: #dddddd;
color: black; }
.header a:active {
background-color: dodgerblue;
color: white; }
.header-right {
float: right; }
@media screen and (max-width: 500px) {
.header a {
float: none;
display: block;
text-align: left; }
.header-right {
float: none; } }
/*# sourceMappingURL=index.css.map */

@ -1,7 +0,0 @@
{
"version": 3,
"mappings": "AAEA,OAAO;EACL,QAAQ,EAAE,MAAM;EAChB,gBAAgB,EAAE,SAAS;EAC3B,OAAO,EAAE,SAAS;;AAEpB,SAAS;EACP,KAAK,EAAE,IAAI;EACX,KAAK,EAAE,KAAK;EACZ,UAAU,EAAE,MAAM;EAClB,OAAO,EAAE,IAAI;EACb,eAAe,EAAE,IAAI;EACrB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;EACjB,aAAa,EAAE,GAAG;;AAEpB,cAAc;EACZ,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;;AAEnB,eAAe;EACb,gBAAgB,EAAE,OAAO;EACzB,KAAK,EAAE,KAAK;;AAEd,gBAAgB;EACd,gBAAgB,EAAE,UAAU;EAC5B,KAAK,EAAE,KAAK;;AAEd,aAAa;EACX,KAAK,EAAE,KAAK;;AAEd,oCAA4C;EAC1C,SAAS;IACP,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,IAAI;;EAElB,aAAa;IACX,KAAK,EAAE,IAAI",
"sources": ["../sass/index.sass"],
"names": [],
"file": "index.css"
}

@ -0,0 +1,54 @@
@import url("https://fonts.googleapis.com/css2?family=Fira+Code&family=Montserrat:wght@400;600;700&display=swap");
.header {
overflow: hidden;
background-color: #f1f1f1;
padding: 15px 10px;
font-family: "Fira Code", monospace;
border-radius: 3px; }
.header a {
float: left;
color: black;
text-align: center;
padding: 7px 12px;
text-decoration: none;
font-size: 18px;
line-height: 25px;
border-radius: 4px; }
.header a.name {
font-size: 25px;
font-weight: 600; }
.header a:hover {
background-color: #dddddd;
color: black; }
.header a:active {
background-color: dodgerblue;
color: white; }
.header-right {
float: right; }
@media (max-width: 575px) {
.header a {
float: none;
display: block;
text-align: left; }
.header-right {
float: none; } }
.page {
background-color: rgba(240, 240, 240, 0.94);
height: fit-content;
padding: 10px;
margin-top: 10px;
font-family: "Montserrat", sans-serif; }
@media (min-width: 992px) {
.page {
width: 80%;
margin: 10px auto auto; } }
/*# sourceMappingURL=main.css.map */

@ -0,0 +1,41 @@
.grid-item {
width: 240px;
margin-bottom: 10px;
padding: 5px;
box-sizing: border-box;
height: 200px;
transition: 0.22s all; }
.grid {
margin: 0 auto;
transition: 0.2s all; }
.grid-item--tall3 {
height: 300px; }
.grid-item--tall4 {
height: 400px; }
.grid-item--width2 {
background-color: #81d4fa;
width: 490px; }
.grid-item--image {
width: fit-content;
height: fit-content; }
@media (max-width: 575px) {
.grid-item--width2 {
width: 100%; } }
.blur-me {
filter: grayscale(20%) blur(0.7px) brightness(94%);
opacity: 0.8;
box-shadow: none; }
.grid:hover .grid-item:hover {
filter: blur(0px);
opacity: 1; }
.grid:hover .grid-item:hover > img {
filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.25)); }
/*# sourceMappingURL=masonry.css.map */

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -6,10 +6,11 @@
<meta content="Jake Cover's Homepage" name="description"> <meta content="Jake Cover's Homepage" name="description">
<title>Jake Cover</title> <title>Jake Cover</title>
<link href="css/index.css"> <link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/masonry.css">
</head> </head>
<body> <body>
<header> <header class="header">
<a href="index.html" class="name">Jake Cover</a> <a href="index.html" class="name">Jake Cover</a>
<div class="header-right"> <div class="header-right">
@ -19,5 +20,45 @@
<a href="https://github.com/JakeCover">GitHub</a> <a href="https://github.com/JakeCover">GitHub</a>
</div> </div>
</header> </header>
<div class="page">
<div class="grid">
<!--Distest-->
<div class="grid-item grid-item--tall4">
Distest
</div>
<!--CodeDay-->
<div class="grid-item grid-item--image">
<img src="images/codedaysd.png" alt="CodeDay SD Logo" width="230" height="230">
</div>
<!--SRND-->
<div class="grid-item">
SRND
</div>
<!--ScoreSaver Installer-->
<div class="grid-item">
ScoreSaber Installer
</div>
<!--Foresight-->
<div class="grid-item grid-item--image">
<img src="images/foresightsports.png" alt="ForeSight Sports Logo0" width="480">
</div>
<!--ReplyBot-->
<div class="grid-item grid-item--tall3">ReplyBot</div>
</div>
</div>
<script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
<script src="scripts/masonry_conf.js"></script>
<script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
<script>
$(".grid-item").hover(
function () {
$(this).siblings().addClass('blur-me')
},
function () {
$(this).siblings().removeClass('blur-me')
}
)
</script>
</body> </body>
</html> </html>

@ -0,0 +1,18 @@
http://www.alexafalcone.com/
http://gudh.github.io/ihover/dist/index.html#circle10
http://gudh.github.io/ihover/dist/index.html#circle13
http://gudh.github.io/ihover/dist/index.html#circle17
http://gudh.github.io/ihover/dist/index.html#square3
http://gudh.github.io/ihover/dist/index.html#square6
http://gudh.github.io/ihover/dist/index.html#square12
https://codepen.io/honglio/pen/FKyxG
https://codepen.io/russpate/pen/qRaepv --- Requires the whole area to be blurred
https://codepen.io/Mamboleoo/pen/XgBvrJ ---
https://codepen.io/cassidoo/pen/RZOWQb
https://codepen.io/Sherpa23/pen/rKvJXg !!
https://codepen.io/markmead/pen/MqmOVB !!
https://codepen.io/ViktorKorolyuk/pen/GYGwpv
https://ianlunn.github.io/Hover/ (border section)
https://codepen.io/bhautikbharadava/full/OdPzdW (gives borders too)
https://tympanus.net/Development/ProximityFeedback/index5.html
https://tympanus.net/Development/ProximityFeedback/index7.html (scroll icon)

@ -0,0 +1,83 @@
// A map of breakpoints.
$breakpoints: (
xs: 576px,
sm: 768px,
md: 992px,
lg: 1200px
);
// Respond above.
@mixin respond-above($breakpoint) {
// If the breakpoint exists in the map.
@if map-has-key($breakpoints, $breakpoint) {
// Get the breakpoint value.
$breakpoint-value: map-get($breakpoints, $breakpoint);
// Write the media query.
@media (min-width: $breakpoint-value) {
@content;
}
// If the breakpoint doesn't exist in the map.
} @else {
// Log a warning.
@warn 'Invalid breakpoint: #{$breakpoint}.';
}
}
@mixin respond-below($breakpoint) {
// If the breakpoint exists in the map.
@if map-has-key($breakpoints, $breakpoint) {
// Get the breakpoint value.
$breakpoint-value: map-get($breakpoints, $breakpoint);
// Write the media query.
@media (max-width: ($breakpoint-value - 1)) {
@content;
}
// If the breakpoint doesn't exist in the map.
} @else {
// Log a warning.
@warn 'Invalid breakpoint: #{$breakpoint}.';
}
}
@mixin respond-between($lower, $upper) {
// If both the lower and upper breakpoints exist in the map.
@if map-has-key($breakpoints, $lower) and map-has-key($breakpoints, $upper) {
// Get the lower and upper breakpoints.
$lower-breakpoint: map-get($breakpoints, $lower);
$upper-breakpoint: map-get($breakpoints, $upper);
// Write the media query.
@media (min-width: $lower-breakpoint) and (max-width: ($upper-breakpoint - 1)) {
@content;
}
// If one or both of the breakpoints don't exist.
} @else {
// If lower breakpoint is invalid.
@if (map-has-key($breakpoints, $lower) == false) {
// Log a warning.
@warn 'Your lower breakpoint was invalid: #{$lower}.';
}
// If upper breakpoint is invalid.
@if (map-has-key($breakpoints, $upper) == false) {
// Log a warning.
@warn 'Your upper breakpoint was invalid: #{$upper}.';
}
}
}

@ -1,40 +0,0 @@
$mobile-break: 500px
.header
overflow: hidden
background-color: lightgrey
padding: 20px 10px
.header a
float: left
color: black
text-align: center
padding: 12px
text-decoration: none
font-size: 18px
line-height: 25px
border-radius: 4px
.header a.name
font-size: 25px
font-weight: bold
.header a:hover
background-color: #dddddd
color: black
.header a:active
background-color: dodgerblue
color: white
.header-right
float: right
@media screen and (max-width: $mobile-break)
.header a
float: none
display: block
text-align: left
.header-right
float: none

@ -0,0 +1,57 @@
@import "breakpoint-helpers"
@import url('https://fonts.googleapis.com/css2?family=Fira+Code&family=Montserrat:wght@400;600;700&display=swap')
.header
overflow: hidden
background-color: #f1f1f1
padding: 15px 10px
font-family: "Fira Code", monospace
border-radius: 3px
.header a
float: left
color: black
text-align: center
padding: 7px 12px
text-decoration: none
font-size: 18px
line-height: 25px
border-radius: 4px
.header a.name
font-size: 25px
font-weight: 600
.header a:hover
background-color: #dddddd
color: black
.header a:active
background-color: dodgerblue
color: white
.header-right
float: right
@include respond-below(xs)
.header a
float: none
display: block
text-align: left
.header-right
float: none
.page
background-color: rgba(240, 240, 240, 0.94)
height: fit-content
padding: 10px
margin-top: 10px
font-family: 'Montserrat', sans-serif
@include respond-above(md)
.page
width: 80%
margin: 10px auto auto

@ -0,0 +1,50 @@
@import "breakpoint-helpers"
.grid-item
//background-color: coral
width: 240px
margin-bottom: 10px
padding: 5px
box-sizing: border-box
height: 200px
//box-shadow: 0 2px 3px 0px rgba(0,0,0,0.25)
transition: 0.22s all
.grid
margin: 0 auto
transition: .2s all
.grid-item--tall3
height: 300px
.grid-item--tall4
height: 400px
.grid-item--width2
background-color: #81d4fa
width: 490px
.grid-item--image
width: fit-content
height: fit-content
@include respond-below(xs)
.grid-item--width2
width: 100%
.blur-me
filter: grayscale(20%) blur(0.7px) brightness(94%)
opacity: .8
//transform: scale(.995)
box-shadow: none
.grid:hover .grid-item:hover
//transform: scale(1.005)
filter: blur(0px)
opacity: 1
//box-shadow: 0 8px 20px 0px rgba(0,0,0,0.125)
> img
filter: drop-shadow(0px 2px 3px rgba(0,0,0,0.25))

@ -0,0 +1,78 @@
class HoverButton {
constructor(el) {
this.el = el;
this.hover = false;
this.calculatePosition();
this.attachEventsListener();
}
attachEventsListener() {
window.addEventListener('mousemove', e => this.onMouseMove(e));
window.addEventListener('resize', e => this.calculatePosition(e));
}
calculatePosition() {
TweenMax.set(this.el, {
x: 0,
y: 0,
scale: 1
});
const box = this.el.getBoundingClientRect();
this.x = box.left + (box.width * 0.5);
this.y = box.top + (box.height * 0.5);
this.width = box.width;
this.height = box.height;
}
onMouseMove(e) {
let hover = false;
let hoverArea = (this.hover ? 0.5 : 0.5); // (detach, attach)
let x = e.clientX - this.x;
let y = e.clientY - this.y;
let distance = Math.sqrt( x*x + y*y );
if (distance < (this.width * hoverArea)) {
hover = true;
if (!this.hover) {
this.hover = true;
}
this.onHover(e.clientX, e.clientY);
}
if(!hover && this.hover) {
this.onLeave();
this.hover = false;
}
}
onHover(x, y) {
TweenMax.to(this.el, 0.05, {
x: (x - this.x) * 0.05,
y: (y - this.y) * 0.05,
scale: 1.00,
ease: Power2.easeOut
});
this.el.style.zIndex = 10;
}
onLeave() {
TweenMax.to(this.el, 0.7, {
x: 0,
y: 0,
scale: 1,
ease: Elastic.easeOut.config(1.2, 0.4)
});
this.el.style.zIndex = 1;
}
}
const btn1 = document.querySelector('.grid-item:nth-child(1)');
new HoverButton(btn1);
const btn2 = document.querySelector('.grid-item:nth-child(2)');
new HoverButton(btn2);
const btn3 = document.querySelector('.grid-item:nth-child(3)');
new HoverButton(btn3);
const btn4 = document.querySelector('.grid-item:nth-child(4)');
new HoverButton(btn4);
const btn5 = document.querySelector('.grid-item:nth-child(5)');
new HoverButton(btn5);
const btn6 = document.querySelector('.grid-item:nth-child(6)');
new HoverButton(btn6);

@ -0,0 +1,8 @@
var elem = document.querySelector('.grid');
var msnry = new Masonry( elem, {
// options
itemSelector: '.grid-item',
columnWidth: 240,
gutter: 10,
fitWidth: true
});
Loading…
Cancel
Save