Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 1 #94

Merged
merged 6 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# local env files
.env*.local

*.mdx
# dependencies
/node_modules
/.pnp
Expand Down
19 changes: 0 additions & 19 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,6 @@ const nextConfig = {
module.exports = nextConfig;

const securityHeaders = [
{
key: 'Content-Security-Policy',
value: `
frame-ancestors 'none';
default-src 'self';
img-src 'self' blob: data: avatars.githubusercontent.com;
script-src 'self';
font-src 'self';
style-src 'self';
media-src 'none';
connect-src 'self';
base-uri 'self';
form-action 'self';
frame-src 'self' *.codesandbox.io *.x.com;
block-all-mixed-content;
upgrade-insecure-requests;
object-src 'none';
`,
},
{
key: 'Referrer-Policy',
value: 'no-referrer, strict-origin-when-cross-origin',
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mysite",
"version": "1.0.1",
"version": "0.8.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down Expand Up @@ -48,6 +48,7 @@
"webpack": "^5.90.1"
},
"dependencies": {
"@gsap/react": "^2.1.0",
"@nextui-org/react": "^2.2.9",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-separator": "^1.0.3",
Expand All @@ -57,6 +58,7 @@
"dotenv": "^16.3.1",
"framer-motion": "^10.17.4",
"front-matter": "^4.0.2",
"gsap": "^3.12.5",
"lucide-react": "^0.309.0",
"next": "^14.0.4",
"next-mdx-remote": "^4.4.1",
Expand Down
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions public/blogs/CSRF-mitigation-techniques.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: CSRF Mitigation
seoTitle: No BS guide over how to actually do it to the most
summary: No BS guide over how to actually do it to the most
isReleased: true
isSequel: false
lastModDate: 2020-04-19T09:15:00-0401
firstModDate: 2020-04-19T09:15:00-0401
minutesToRead: 5
tags:
- 'react'
- 'framer-motion'
---
81 changes: 0 additions & 81 deletions public/blogs/captionize.mdx

This file was deleted.

21 changes: 19 additions & 2 deletions public/blogs/framer-motion.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Framer Motion
seoTitle: Streamlining Animations with Framer Motion in React
summary: Changed the way I handle animations in React
summary: Supercharging animations in React
isReleased: true
isSequel: false
lastModDate: 2020-04-19T09:15:00-0401
firstModDate: 2020-04-19T09:15:00-0401
minutesToRead: 18
minutesToRead: 5
tags:
- 'react'
- 'framer-motion'
Expand Down Expand Up @@ -75,7 +75,9 @@ showLineNumbers={true}
<Code
code=
{`const Component: React.FC = () => {

const [isVisible, setIsVisible] = useState(false);

return (
<div className="flex items-center justify-center py-2">
<div
Expand All @@ -99,12 +101,15 @@ showLineNumbers={true}

<Code
code={`const Component: React.FC = () => {

const [isVisible, setIsVisible] = useState(false);
const ref = useRef<HTMLDivElement>(null);

useEffect(() => {
// Handle it when in view
setIsVisible(!isVisible);
}, [ref]);

return (
<div className="flex items-center justify-center py-2">
<div
Expand Down Expand Up @@ -148,9 +153,11 @@ showLineNumbers={true}
code={`
import React, { useEffect, useRef, useState } from 'react';
import './styles.css';

const Component: React.FC = () => {
const [isVisible, setIsVisible] = useState(false);
const ref = useRef<HTMLDivElement>(null);

useEffect(() => {
const current = ref.current;
const observer = new IntersectionObserver(
Expand All @@ -171,6 +178,7 @@ const Component: React.FC = () => {
}
};
}, [ref]);

return (
<div className="flex items-center justify-center py-2">
<div
Expand All @@ -182,6 +190,7 @@ const Component: React.FC = () => {
</div>
);
};

export default Component;
const FadingText: React.FC = () => {
return (
Expand All @@ -206,6 +215,7 @@ const FadingText: React.FC = () => {
code={`
import React from 'react';
import { motion } from 'framer-motion';

const FramerMotionFadeInComponent: React.FC = () => {
return (
<div className="flex justify-center items-center py-2">
Expand All @@ -227,6 +237,7 @@ const FramerMotionFadeInComponent: React.FC = () => {
code={`
import React from 'react';
import { motion } from 'framer-motion';

const FramerMotionFadeInComponent: React.FC = () => {
return (
<div className="flex justify-center items-center py-2">
Expand Down Expand Up @@ -265,13 +276,15 @@ const FramerMotionFadeInComponent: React.FC = () => {
<C>Here's the code for it </C>
<Code
code={`import { motion } from 'framer-motion';

export default function YeetMe() {
const initial = {
opacity: 0,
borderRadius: 0,
scale: 0,
rotate: 360,
};

const animate = {
opacity: 1,
width: 160,
Expand All @@ -281,17 +294,21 @@ export default function YeetMe() {
boxShadow: '10px 10px 0 rgba(255, 46, 199, 0.2)',
rotate: 0,
};

const transition = {
duration: 1,
type: 'keyframes',
ease: 'easeInOut',
};

const whileHover = {
cursor: 'grab',
};

const whileDrag = {
cursor: 'grabbing',
};

return (
<motion.button
layout
Expand Down
Loading
Loading