Skip to content

Commit

Permalink
Thumbnail fix
Browse files Browse the repository at this point in the history
Thumbnail fix
  • Loading branch information
ksanjeev284 committed Dec 6, 2024
1 parent 9c96abf commit 7d3c166
Show file tree
Hide file tree
Showing 27 changed files with 1,038 additions and 354 deletions.
952 changes: 947 additions & 5 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^3.0.3",
"astro": "^4.15.3",
"date-fns": "^2.30.0",
"three": "^0.158.0",
"@astrojs/react": "^3.0.3",
"puppeteer": "^23.10.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"three": "^0.158.0"
}
}
}
Binary file added public/project-images/2048-3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/ai-jobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/ai-weather.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/anime-manga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/project-images/aqi-checker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/bounce-game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/btc-time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/cities-aqi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/crypto-calc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/ctc-calc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/finance-calc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/project-images/image-compressor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/math-toolkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/meowie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/pixel-runner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/reddit-viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/rubix-cube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/sarcle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/sip-calc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/snake-3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/snake-classic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/valorant-trivia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/project-images/yt-spotify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions scripts/take-screenshots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import puppeteer from 'puppeteer';
import path from 'path';
import { fileURLToPath } from 'url';
import fs from 'fs';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const websites = [
{ url: 'https://indianaqichecker.netlify.app/', name: 'aqi-checker' },
{ url: 'https://smallerimages.website/', name: 'image-compressor' },
{ url: 'https://www.ctccalculator.in/', name: 'ctc-calc' },
{ url: 'https://pixelrunner.netlify.app/', name: 'pixel-runner' },
{ url: 'https://meowie.netlify.app/', name: 'meowie' },
{ url: 'https://sarcle.netlify.app/', name: 'sarcle' },
{ url: 'https://aiweatherchecker.netlify.app/', name: 'ai-weather' },
{ url: 'https://allinonefinancecalculator.netlify.app/', name: 'finance-calc' },
{ url: 'https://bitcointimemachine.netlify.app/', name: 'btc-time' },
{ url: 'https://threejsnokiasnakegame.netlify.app/', name: 'snake-3d' },
{ url: 'https://indiancitiesaqi.netlify.app/', name: 'cities-aqi' },
{ url: 'https://indiansipcalculator.netlify.app/', name: 'sip-calc' },
{ url: 'https://valoranttrivia.netlify.app/', name: 'valorant-trivia' },
{ url: 'https://aijobboard.netlify.app/', name: 'ai-jobs' },
{ url: 'https://snakegamenokiaphone.netlify.app/', name: 'snake-classic' },
{ url: 'https://redditpostviewer.netlify.app/', name: 'reddit-viewer' },
{ url: 'https://bouncegame.netlify.app/', name: 'bounce-game' },
{ url: 'https://animemangarecommendation.netlify.app/', name: 'anime-manga' },
{ url: 'https://livecryptoprofitcalculator.netlify.app/', name: 'crypto-calc' },
{ url: 'https://mathematicaltoolkit.netlify.app/', name: 'math-toolkit' },
{ url: 'https://rubixcubesolver.netlify.app/', name: 'rubix-cube' },
{ url: 'https://youtubetospotifyplaylistconverter.netlify.app/', name: 'yt-spotify' },
{ url: 'https://3d2048game.netlify.app/', name: '2048-3d' }
];

async function takeScreenshots() {
const browser = await puppeteer.launch({
headless: "new",
defaultViewport: {
width: 1200,
height: 630
}
});

const outputDir = path.join(__dirname, '..', 'public', 'project-images');
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true });
}

for (const site of websites) {
try {
console.log(`Taking screenshot of ${site.url}`);
const page = await browser.newPage();
await page.goto(site.url, { waitUntil: 'networkidle0', timeout: 30000 });
await page.screenshot({
path: path.join(outputDir, `${site.name}.png`),
type: 'png'
});
await page.close();
console.log(`Screenshot saved for ${site.name}`);
} catch (error) {
console.error(`Error taking screenshot for ${site.url}:`, error.message);
}
}

await browser.close();
console.log('All screenshots completed!');
}

takeScreenshots().catch(console.error);
Loading

0 comments on commit 7d3c166

Please sign in to comment.