-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9c4342
commit 37366e6
Showing
8 changed files
with
114 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import HeightTransition from "@/components/(demo)/HeightTransition" | ||
import React from "react" | ||
|
||
const page = () => { | ||
return ( | ||
<div> | ||
<h1>Demo component</h1> | ||
<HeightTransition> | ||
tailwindcss - transition height auto using max-height | ||
</HeightTransition> | ||
</div> | ||
) | ||
} | ||
|
||
export default page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from "react" | ||
import style from "./HeightTransition.module.css" | ||
|
||
const HeightTransition = ({ children }) => { | ||
return ( | ||
<> | ||
<div className={style.example}> | ||
<div>transition height auto using CSS grid</div> | ||
</div> | ||
|
||
<div className="p-4 m-8 rounded-lg bg-slate-500 grid grid-rows-0 hover:grid-rows-1 transition-[grid-template-rows] duration-1000 "> | ||
<div className="text-white overflow-hidden"> | ||
tailwindcss - attempt to transition height auto using grid | ||
</div> | ||
</div> | ||
|
||
<div className="p-4 m-8 rounded-lg bg-blue-500 group "> | ||
<div className="text-white overflow-hidden max-h-0 group-hover:max-h-[500px] transition-max-height duration-500 "> | ||
{children} | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default HeightTransition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.example { | ||
margin: 2rem; | ||
padding: 1rem; | ||
background-color: #ed5ab3; | ||
border-radius: 5px; | ||
display: grid; | ||
grid-template-rows: 0fr; | ||
transition: grid-template-rows 500ms; | ||
} | ||
|
||
.example > div { | ||
color: white; | ||
overflow: hidden; | ||
} | ||
|
||
.example:hover { | ||
grid-template-rows: 1fr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import React from 'react' | ||
import React from "react" | ||
|
||
export default function Video({id}) { | ||
console.log("Video id: ", id) | ||
export default function Video({ id }) { | ||
// console.log("Video id: ", id) | ||
return ( | ||
<div className='aspect-w-16 aspect-h-9'> | ||
<iframe | ||
src={`https://www.youtube.com/embed/${id}`} | ||
title="YouTube video player" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
/> | ||
<div className="aspect-w-16 aspect-h-9"> | ||
<iframe | ||
src={`https://www.youtube.com/embed/${id}`} | ||
title="YouTube video player" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
/> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
darkMode: 'class', | ||
darkMode: "class", | ||
content: [ | ||
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}', | ||
'./src/components/**/*.{js,ts,jsx,tsx,mdx}', | ||
'./src/app/**/*.{js,ts,jsx,tsx,mdx}', | ||
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./src/components/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./src/app/**/*.{js,ts,jsx,tsx,mdx}", | ||
], | ||
theme: { | ||
extend: { | ||
backgroundImage: { | ||
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', | ||
'gradient-conic': | ||
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', | ||
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))", | ||
"gradient-conic": | ||
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))", | ||
}, | ||
gridTemplateRows: { | ||
0: "0fr", | ||
}, | ||
transitionProperty: { | ||
"max-height": "max-height", | ||
"grid-template-rows": "grid-template-rows", | ||
}, | ||
}, | ||
}, | ||
plugins: [ | ||
require('@tailwindcss/typography'), | ||
require('@tailwindcss/aspect-ratio') // for video | ||
require("@tailwindcss/typography"), | ||
require("@tailwindcss/aspect-ratio"), // for video | ||
], | ||
} |
37366e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
mysite-nextjs-remote-mdx – ./
mysite-nextjs-remote-mdx-antlossway.vercel.app
mysite-nextjs-remote-mdx-git-main-antlossway.vercel.app
mysite-nextjs-remote-mdx.vercel.app
quinn.unices.org