Skip to main content

Posts

Three.js react js/next js duplicated content

I am using Three.js in react(next js) and a Mesh I have created is duplicated multiple times import * as THREE from 'three'; function Index() { if (process.browser) { const scene = new THREE.Scene(); const camera = new THREE. PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setPixelRatio(window.devicePixelRatio); document.body.appendChild(renderer.domElement); console.log(scene.children); const geometry = new THREE.BoxGeometry(); const material = new THREE.MeshBasicMaterial({color: 0x00ff00}); const cube = new THREE.Mesh(geometry, material); scene.add(cube); console.log(scene.children); camera.position.z = 12; renderer.render(scene, c...

How do I decrease the font size of specific elements in a date displayer

I am creating a website in html. What I want to do decrease the size of the hour, minute and second counter, but keep the size of the day, month and year counters. Splitting the 2 into separate id's doesn't seem to work and only shows the day, month and year. Here's my code: <html> <head><title>My website</title> <style type=text/css> .clock {background-color: 000000; text-align: center; margin: 2px 0px 0px 1190px; font-size: 30px; position: fixed; border-radius: 10px; color: #fff; text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff; border: 5px solid white;} div {margin: 2px;} body {background-color: 0d0d0d; font-family: "Vibur", sans-serif;} </style> </head> <body> <p id="date" class="clock"></p> <script> setInterval(function(){ date = new Date(); sekundy = date.getSeconds(); if (sekundy<10) sekundy = "0"+sekundy; minuty = date.getMinutes(); ...

Javascript Fetch Path

Problem: I am trying to setup my server to receive get and post requests with express. I have different client javascript code that I want to send requests to the server. Client Code: const response = await fetch('/RetrieveCustomerInformation'); Server Code: application.get('/RetrieveCustomerInformation', (request, response) => { console.log("Got here!") console.log(request, response) customerRecordsdb.find({}, (error, data) => { if (error) { response.end(); return; } response.json(data); }) }) File Hierachy: : https://i.stack.imgur.com/kkS7o.png Error Message: Failed to load resource: the server responded with a status of 404 (Not Found) I have tried playing around with the relative paths, so both URLs in the first .get() parameter point to the same location, but no luck with that. Any help or advice would be greatly appreciated! All the best. Via Active questions tagged javascr...

Change Selected Item Background Color of Semantic UI Form.Select element

I have semantic UI React imported as follows import { Form } from 'semantic-ui-react' Now, I am using their Select Component as follows: <Form> <Form.Group widths="equal"> <Form.Select //I wish to change the background color of only the selected item placeholder={"Choose Item"} value={selectedItem} className={classes.select} onChange={handleItemSelectionChange} options={ items.map((e) => { return ( { key: e['name'], value: e['name'], text: e['name'] } ) }) } > </Form.Select> </Form.Group> </Form> How can I change the background color and icon color of only the selected item in the Form.Select component. Thank you. Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW

How do I create elements on a new html page, based on selected data from another html page?

I'm creating a web application (html.css.js) where one can book a trip by boat. On page 1 there is a form with the option to select the amount of passengers. One page 2 I what to display the amount of selected passengers where each has an individual tag/element. When a passenger is selected a pre made html registration form is to be displayed. How do I send the value selected on page 1 to page 2 and generate the individual registration forms according to the selected value? Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW

How to query database in flask app using url parameters

I have my flask app and I am able to query the database in a view named 'blog.blade.php', but now to I want to transfer my control from this view to another view called 'viewblog.blade.php' and now I want to query the database in this view using url parameters that I am sending form first view. My problem is, I am getting an error in viewblog.php file. blog.blade.php @foreach($blogs as $blog) <div class="col-md-6" style="padding: 25px;"> <div class="card" style="border: 0;"> <div class="card-body"> <h3 class="card-title"><a href="viewblog?blog_id=" target="_blank"></a></h3> <p></p> <a href="viewblog?blog_id=" class="btn btn-outline-danger" target="_blank">Continue reading...</a> </div> </div> ...

Wordpress store search returns empty when selecting a category

So I have a bit of a weird issue Using WordPress, store max theme, and woo-commerce to create my first online store for my local shop in France. The theme 'StoreMax' (Child them of StoreBiz), provides me with a nice built-in search feature which the option to select from a category. The problem is, if I select a category but don't put in a search term, it returns an empty list, even though the select category can see there are items for said category. I want it to generate a list of all products within the selected category, pretty much the same as if I was to simply select the category in question from the side widget. my site is www.thecorner-shop.com Thanks for any help you can provide. source https://stackoverflow.com/questions/69359953/wordpress-store-search-returns-empty-when-selecting-a-category