diff --git a/API.js b/API.js new file mode 100644 index 0000000..0c12c46 --- /dev/null +++ b/API.js @@ -0,0 +1,23 @@ +const express = require('express'); +const app = express(); // framework to create server +const port = 8080; + +// Serve the JSON file +app.get('/', (req, res) => { + // Path to the JSON file + + // Set the appropriate Content-Type header + res.setHeader('Content-Type', 'application/json'); + + // Send the JSON file + res.sendFile(__dirname + '/data/products.json'); +}); + + + +// Start the server +app.listen(port, () => { + console.log(`Server is running on port ${port}`); +}); + + diff --git a/client.js b/client.js new file mode 100644 index 0000000..b38728b --- /dev/null +++ b/client.js @@ -0,0 +1,19 @@ +const net = require('net'); + +// Create a TCP socket and connect to the server +const client = new net.Socket(); +client.connect(3000, 'localhost', () => { + console.log('Connected to server.'); +}); + +// Handle data received from the server +client.on('data', data => { + console.log(`Received data from server: ${data}`); + + // You can perform further actions with the received data here +}); + +// Handle server disconnection (optional) +client.on('close', () => { + console.log('Server connection closed.'); +}); \ No newline at end of file diff --git a/data/products.json b/data/products.json new file mode 100644 index 0000000..3186461 --- /dev/null +++ b/data/products.json @@ -0,0 +1,106 @@ +[ + { + "id": 0, + "name": "APPLE iPhone SE", + "color":"Black", + "ROM": 128, + "price": 990, + "modeName": "iPhone SE", + "modelNumber": "MHGT3HN/A", + "size": "11.94 cm (4.7 inch) Retina HD Display", + "camera": "12MP Rear Camera | 7MP Front Camera", + "Description": "Widescreen HD LCD Retina Multi-touch IPS Display (1400:1 Contrast Ratio (Typical), True Tone Display, Wide Color Display (P3), Haptic Touch, 625 nits Max Brightness (Typical), Fingerprint-resistant Oleophobic Coating, Display Zoom, Reachability)", + "productImage":"http://atlas-content-cdn.pixelsquid.com/stock-images/iphone-x-smartphone-xwVXQLD-600.jpg" + }, + { + "id": 1, + "name": "APPLE iPhone XR", + "color":"White", + "ROM": 64, + "price": 790, + "modeName": "iPhone XR", + "modelNumber": "MH6N3HN/A", + "size": "15.49 cm (6.1 inch) Display", + "camera": "12MP Rear Camera | 7MP Front Camera", + "Description": "1400:1 Contrast Ratio (Typical), True Tone Display (Six-channel Light Sensor), Wide Colour Display (P3), 625 nits Maximum Brightness (Typical), Fingerprint-resistant Oleophobic Coating, Support for Display of Multiple Languages and Characters Simultaneously, Liquid Retina HD Display, Tap to Wake, Wide Colour Gamut", + "productImage":"https://c8.alamy.com/zooms/6/e98284ded5444c08949d7fd9f2bae166/2cd68c5.jpg" + }, + { + "id": 2, + "name": "APPLE iPhone 11", + "color":"White", + "ROM": 64, + "price": 740, + "modeName": "iPhone 11", + "modelNumber": "MHDC3HN/A", + "size": "15.49 cm (6.1 inch) Liquid Retina HD", + "camera": "12MP + 12MP | 12MP Front Camera", + "Description": "1400:1 Contrast Ratio (Typical), True Tone Display, Wide Colour Display (P3), Haptic Touch, 625 nits Max Brightness (Typical), Fingerprint Resistant Oleophobic Coating, Support for Display of Multiple Languages and Characters Simultaneously", + "productImage":"https://png.pngtree.com/png-vector/20201230/ourlarge/pngtree-smart-phone-vector-3d-style-mobile-design-mockup-png-image_2679535.jpg" + }, + { + "id": 3, + "name": "APPLE iPhone XR", + "color":"Yellow", + "ROM": 128, + "price": 999, + "modeName": "iPhone XR", + "modelNumber": "MHDC4HN/A", + "size": "15.49 cm (6.1 inch) Liquid Retina HD", + "camera": "12MP + 12MP | 12MP Front Camera", + "Description": "1400:1 Contrast Ratio (Typical), True Tone Display, Wide Colour Display (P3), Haptic Touch, 625 nits Max Brightness (Typical), Fingerprint Resistant Oleophobic Coating, Support for Display of Multiple Languages and Characters Simultaneously", + "productImage":"https://png.pngtree.com/png-vector/20201230/ourlarge/pngtree-vector-3d-style-smart-phone-mockup-design-png-image_2679529.jpg" + }, + { + "id": 4, + "name": "APPLE iPhone 12 Mini", + "color":"Purple", + "ROM": 64, + "price": 720, + "modeName": "iPhone 12", + "modelNumber": "MGJE3HN/A", + "size": "13.72 cm (5.4 inch) Super Retina XDR Display", + "camera": "12MP + 12MP | 12MP Front Camera", + "Description": "Dive into a world of crystal-clear visuals with the Super Retina XDR Display of the iPhone 12 Mini. This beast of a smartphone packs the A14 Bionic chip to make for blazing-fast performance speeds. On top of that, its Dual-camera System, along with Night Mode, helps you click amazing pictures and selfies even when the lighting isn’t as good as you’d want it to be.", + "productImage":"https://cdn1.vectorstock.com/i/1000x1000/70/05/realistic-frameless-smartphone-mock-up-3d-vector-33107005.jpg" + }, + { + "id": 5, + "name": "APPLE iPhone 11", + "color":"Red", + "ROM": 128, + "price": 990, + "modeName": "iPhone 11", + "modelNumber": "MHDC3HN/A", + "size": "15.49 cm (6.1 inch) Liquid Retina HD", + "camera": "12MP + 12MP | 12MP Front Camera", + "Description": "1400:1 Contrast Ratio (Typical), True Tone Display, Wide Colour Display (P3), Haptic Touch, 625 nits Max Brightness (Typical), Fingerprint Resistant Oleophobic Coating, Support for Display of Multiple Languages and Characters Simultaneously", + "productImage":"https://previews.123rf.com/images/barmaleeva/barmaleeva2003/barmaleeva200300004/141800762-white-realistic-smartphone-mockup-3d-mobile-phone-with-blank-white-screen-modern-vector-cell-phone-t.jpg" + }, + { + "id": 6, + "name": "APPLE iPhone SE", + "color":"White", + "ROM": 64, + "price": 780, + "modeName": "iPhone SE", + "modelNumber": "MHGT3HN/A", + "size": "11.94 cm (4.7 inch) Retina HD Display", + "camera": "12MP Rear Camera | 7MP Front Camera", + "Description": "Widescreen HD LCD Retina Multi-touch IPS Display (1400:1 Contrast Ratio (Typical), True Tone Display, Wide Color Display (P3), Haptic Touch, 625 nits Max Brightness (Typical), Fingerprint-resistant Oleophobic Coating, Display Zoom, Reachability)", + "productImage":"http://atlas-content-cdn.pixelsquid.com/stock-images/iphone-x-smartphone-xwVXQLD-600.jpg" + }, + { + "id": 7, + "name": "APPLE iPhone 12", + "color":"Blue", + "ROM": 64, + "price": 780, + "modeName": "iPhone 12", + "modelNumber": "MHGT3HN/A", + "size": "11.94 cm (4.7 inch) Retina HD Display", + "camera": "12MP Rear Camera | 7MP Front Camera", + "Description": "Widescreen HD LCD Retina Multi-touch IPS Display (1400:1 Contrast Ratio (Typical), True Tone Display, Wide Color Display (P3), Haptic Touch, 625 nits Max Brightness (Typical), Fingerprint-resistant Oleophobic Coating, Display Zoom, Reachability)", + "productImage":"https://cdn1.vectorstock.com/i/1000x1000/70/05/realistic-frameless-smartphone-mock-up-3d-vector-33107005.jpg" + } +] \ No newline at end of file diff --git a/home.css b/home.css index a94cc07..0557aa3 100644 --- a/home.css +++ b/home.css @@ -182,4 +182,16 @@ display: inline-block; } + + .data{ + width: 700px; + background-color: antiquewhite; + height: 400px; + color: #000; + } + + ::selection{ + color: white; + background-color: #000; + } \ No newline at end of file diff --git a/main.html b/main.html index 07004fd..299beec 100644 --- a/main.html +++ b/main.html @@ -5,8 +5,7 @@
this is inner card
+the name of the product is dg
this is inner card
+this is inner card ad
this is inner card
+{{%MODELNO%}}
this is inner card
@@ -94,17 +95,12 @@this is inner card
this is inner card
+sdsd
This is the scrollable content that will overflow horizontally.
-You can add more content here to make it scrollable.
-Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-