Skip to content

Commit

Permalink
WIP react-nextjs.html
Browse files Browse the repository at this point in the history
  • Loading branch information
user authored and user committed Jul 15, 2024
1 parent 6a25cfa commit a522e7e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,5 +340,5 @@ main()

console.log('⭐️ END BUILD ⭐️\n🎉 🎉 🎉')

module.exports = { kissX, optimizeHTML } // For development purpose import in watch.js
module.exports = { kissX, optimizeHTML, convertImages, copyAssets } // For development purpose import in watch.js
// #endregion
20 changes: 16 additions & 4 deletions src/assets/modules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ function Counter() {
justifyContent: 'center',
alignItems: 'center',
},

heading: {
padding: '0',
margin: '0',
},
paragraph: {
margin: '0.5rem',
},
button: {
width: '10rem',
color: 'white',
Expand All @@ -23,8 +29,8 @@ function Counter() {

return (
<div style={mystyle.container}>
<h3>Counter</h3>
<p>You clicked {count} times</p>
<h3 style={mystyle.heading}>Counter</h3>
<p style={mystyle.paragraph}>You clicked {count} times</p>
<button style={mystyle.button} onClick={() => setCount(count + 1)}>
Click me
</button>
Expand All @@ -33,7 +39,13 @@ function Counter() {
}

function Header() {
return <h2>Develop. Preview. Ship. 🚀</h2>
const mystyle = {
heading: {
padding: '0.5rem',
margin: '0',
},
}
return <h2 style={mystyle.heading}>Develop. Preview. Ship. 🚀</h2>
}

function App() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/navmenu-x.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
</div>
</a>

<a class="nav__link" href="/nextjs.html" aria-label="link to page">
<a class="nav__link" href="/react-nextjs.html" aria-label="link to page">
<div class="svg nav__svg">
<svg
width="48"
Expand Down
10 changes: 8 additions & 2 deletions src/pages/nextjs.html → src/pages/react-nextjs.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
border-radius: 5px;
filter: drop-shadow(0 0 2rem rgba(255, 255, 255, 0.5));
}
.heading-react {
margin: 0;
}
.heading-next {
margin-top: 5rem;
}
</style>
</head>

Expand All @@ -31,7 +37,7 @@
<main>
<h1>React & Next.js</h1>

<h2>React</h2>
<h2 class="heading-react">React</h2>

<div id="app"></div>

Expand All @@ -45,7 +51,7 @@ <h2>React</h2>
<!-- React Component -->
<script src="/assets/react.js" type="text/babel"></script>

<h2>Next.js</h2>
<h2 class="heading-next">Next.js</h2>

<a href="https://nextjs-blog-pink-two-81.vercel.app">Next.js Blog</a>
<div class="iframe">
Expand Down
6 changes: 4 additions & 2 deletions watch.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const fs = require('fs')
const { kissX, optimizeHTML } = require('./index.js')
const { kissX, optimizeHTML, convertImages, copyAssets } = require('./index.js')
// const { exec } = require('child_process')

// Watch file changes and rebuild
fs.watch('./src/', { recursive: true }, (event, filename) => {
console.log(`Detected ${event} in ${filename}`)
kissX()
optimizeHTML()
// optimizeHTML()
// convertImages()
// copyAssets()
})

// // Exec shell command
Expand Down

0 comments on commit a522e7e

Please sign in to comment.