Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/12/2023 in all areas

  1. Hey Ryan! This is basically a full-viewport Threejs scene on a fixed element behind the content. Planets have a static position, and the probe just moves along the Z axis with the camera attached to it. As the user scrolls, the scrollTop is translated to a Z position for the probe. I had to add a little compensation for the window size so that the probe's position matches the content the user is seeing as is intended. There's also an intersectionObserver detecting each slide coming into view, and depending on what's visible the camera changes position to look left or right. The flying logos are relatively simple. From PW I just generate a JSON with the list from an images field. The script that generates the scene loops through that array, adds planes and textures for each one. X and Y positions just cycle through an array with presets, and Z is incremented with a set distance between them. Content itself is basic Tailwind stuff. Although I have some custom made scripts handling entrance animations, like the typing effect on the dotted text. The game is the result of a conversation with ChatGTP. I had the basic idea of making the user spin the cursor around a dot, mimicking the probe's orbit around Earth, but took the opportunity to challenge the AI. It actually gave me a pretty decent script right off the bat that served as a proof of concept. Then I discussed how to make it challenging and it gave me a few ideas. I iterated over them, and eventually came to the solution of adding movement speed to a variable multiplied by the number of consecutive unbroken turns. Had to refactor the whole thing to make it work properly, but ChatGTP was pretty darn useful in the process.
    5 points
  2. I've just bumped the dev branch version to 3.0.220. Relative to 3.0.219, this version is largely focused on issue resolutions, and there are 11 of them, among 14 commits. See the dev branch commit log for details. This is just a brief update so I don't have more to add other than that I hope you are having a great week, and have a great weekend!
    2 points
  3. Alright, latest version is now published and available through the Upgrade module. Thanks again!
    2 points
  4. Ah! You uncovered my evil plan to put my website on every newsletter generated from my module ? Joke aside, thanks for spotting this one, it was because of $page->getText returning an empty string when there were no {brackets} in the string. I also spotted another bug if you left the "ignore" textarea empty. Here’s the updated file. Let me know if you notice anything else and otherwise I’ll publish the release! Edit: noticed and fixed another small issue with slashes (if missing in the custom host, or if the relative url doesn’t start with one) It shouldn’t make any difference indeed but thank you anyway for sharing your usage of the module!
    2 points
  5. I'll go ahead and invite myself to share some JS thoughts nobody asked for... The don't-reinvent-the-wheel message in the "Do not use React Server Components" video is good, but I think there's a lot more to it when it comes to full stack JS overall. Not only are JS devs largely solving problems that have already be solved, the JS ecosystem is constantly solving problems that it causes for itself. Obviously new features can cause issues to address- but it feels like JS really takes the cake on this one. Hydration and rendering issues were pretty much inevitable when you start overloading the front end and forcing the browser to do so much heavy lifting. Wait... sending a blank page that waits for JavaScript murdered your SEO?! Rendering pages on the server is relatively simple, rendering them in the browser- boy howdy... So then the JS devs cheered when it invented server side rendering... for JavaScript. Then there's the bundle sizes, which is noted in this article about React Server Components: So now they're solving for asset sizes, another layer of complexity to solve an issue that didn't exist (at the level it does now) until massive front end frameworks caused them. We used to worry (showing my age here) about jQuery library sizes... React is excited about saving 240k while the entire jQuery library is 85.4k (uncompressed), and all you have to do is redesign your app architecture with server side JS! BRILLIANT! Before someone interjects to correct me, I'm not saying that React and jQuery are the same, or comparable in functionality and purpose. I am saying that the JavaScript-first approach allowed a lot of people to accept compromises to create the Next Hot Thing™ and a lot of problems with it. JavaScript on the server pretty much just made this more complex by providing increasingly complex ways to make itself more complex- lol, recursion. "But", the full stack JS dev will say, "you can use the same language everywhere so there's consistency." My brother in Christ, you don't even import code between files the same way in Node and and client side ES6. So when I read this in that video: This is from a developer who goes to bed at night thinking about how their Next.js application codebase might be outdated by the time it launches. Then I go back to feeling like this: I used to kind of stress about not pursuing full stack JS, then I realized that I'm happy. Having a front end (whether SSR or a JS framework) and a back end (CMF or non-js app framework) keeps me sane. I know where things go, what they do, and why. There's consistency between projects. It's easier to maintain best practices. My NPM headaches are smaller. My PHP doesn't need nodemon or pm2 to restart the server application if there's a JS error. The amount of documentation I read that has a big red box in the middle saying "Note: this thing that you've built several apps with and know well is going away. We're destroying it because someone on Github said we need to move to stateless functions. Soon there will be pain, and you will cry." is very limited. I made that one up, but you get the idea. I'm not dragging front-end JS frameworks per se, but making the case for why they should not pave the way to the JS-ification of all that is holy and aren't automatically better. Maybe putting JS everywhere has made SPA solutions worse because they didn't leverage how well traditional server side languages worked already. Went off on a tangent here, but I've had a few moments of zen this year about being a PHP developer and wanted to share the energy. All that aside, to answer your question @wbmnfktr I've wanted to pair up a front end framework with PW but haven't had the time or right project to give it a try with. I do like the idea of using PW as a JSON delivery backend in general.
    2 points
  6. So I've just updated my personal website after some 7 or 8 years. It's a small one pager, but with some quirks that I hope you'll enjoy. Have a look: https://heldercervantes.com/ First, the approach was to somehow reinterpret my CV into a web experience. My last CV, along with my Supertiny agency's website share this space exploration / alien contact theme, so the idea here was to incorporate a journey through space as the user scrolls through the website. In the end you'll find a mini-game, where you can attempt to reach the far depths of space and discover what's out there. Most content is static, but I'm using PW to manage the logos you'll fly by at some point and the projects, the game's highscores and SEO. I intend to improve it a bit in time. Sound is probably the next thing I'll add, and I have some ideas to make the game more interesting. Fun fact: Setting up PW for this one took about 2h.
    1 point
  7. Planets are sphere primitives with an image texture applied. The Voyager is a GTLF model from NASA (threejs has importers for that). There's a background that's basically a cube with inward facing images and the Saturn rings is just a plane with a PNG texture. You can also see some specs coming towards the camera that's a particle system. Basically 2000 randomly placed vertices that move and get reset once they're past the camera. It's a ton of fun to work with this stuff.
    1 point
  8. It looks great on mobile too. Very elegant.
    1 point
  9. Wouldn't it be possible to use Github Actions for this? Just a theoretical thought - as I already made my peace with NPM workflows in my local setup. In theory you could create a workflow that does what PurgeCSS/TailwindCSS workflows would do. So there wouldn't be the need of build-tools on your side/in your workflow.
    1 point
  10. Hi, have used the site/config.php $config->allowSession handler in combination with the PrivacyWire module to disable frontend cookies unless the user opt-in to accept technical required cookies for a booking form shown on my frontend w/o user login required. The booking form is not displayed and processed until user opt-in. Instead a message is shown that the booking form requires cookies to work. The other pages can be viewed but with the consent form displayed. Once the user opt-in, the PW wire cookie is created and the booking form can be used as normal. Don‘t know if that is really necessary, but that way should be ok with the lawyers out there in EU/Germany. P.S.: If Url contains backend path, sessions and cookies are enabled by default. Its just disabled for the frontend guest users by default.
    1 point
  11. Hey @AndZyk thx for the update! Have you seen https://github.com/TomS-/UIKit-TailwindCSS/blob/master/postcss.config.js ? I think you can use Toms regex. So the interesting part for me would be how we could add that to RockFrontend? I'd much more prefer a PHP way to do it similar to the LESS parser. But I did not find a solution on my research. Yeah that's why I did not add it to my workflow until now. But if it were really plug-and-play it would be nice, maybe..
    1 point
  12. Hello, two days ago I filed a issue on GitHub regarding a problem I encountered while using TinyMCE, where TinyMCE field keeps modifying HTML markup which is pasted via code editor (code plugin) after saving the page a second time. The issue can be found here: https://github.com/processwire/processwire-issues/issues/1751 Could someone please confirm if this is a bug in the TinyMCE field or just me having the problem? Thanks, Martin
    1 point
  13. A small step to world domination! Love the idea. ? So, just updated the file, tested again, added a {bracket} value. No issues. Everything works as expected!
    1 point
  14. Just uploaded the module files to my Github profile in case someone is interested in. If you want to use it, just download the attached Zip file in the Github Release section of the linked repo.
    1 point
  15. So... I updated to the version you linked in your post. No errors while updating. New module settings page looks great and works as expected so far. I added query paramters just to test them: And got this: Only updated relative links are affected - as far as I can see right now.
    1 point
  16. Hello @monollonom, I updated the site I'm using this module of yours from v1.1.8 to the this RC version and could not notice any difference. I do not know if it makes any difference or not, but I'm using the module with the "Bypass cache for superusers?" option turned on, because as a superuser, I will ever be the only one to have the module convert MJML to HTML. It is because I am using it for generating HTML templates for transactional emails which are only changed by me. I implemented a simple interface in the admin for rendering and previewing requested MJML templates which are first saved as HTML files and after that parsed for some simple "custom template tags" I made up, so that tags can be populated with actual values and the whole email can be sent in the end. So these MJML templates rarely change (except during development, of course) and that's why I do not use caching at all. When sending a transactional email, its saved HTML template is used. cheers Szabesz
    1 point
  17. Following the previous addition to convert relative URLs into absolute ones I quickly needed to ignore some that weren’t just starting with either "http", "tel" or "mailto" but were also keywords from mailing tools such as "*|UNSUBSCRIBE|*". However I also did some changes in the module’s config, mostly for clarity but also to avoid a call to the MJML API on every save. So before I publish a new release, I wouldn’t mind if any users (@wbmnfktr, @szabesz?) would try it out in a local environment and confirm everything is still working (it is on my side) before I create a new release and update it in the module directory. Thanks!
    1 point
  18. @flydev: Damn red pill ?. Created my first module hooking after Page::render and replacing text emails like (example@domain.com) into encrypted mailto links which gets automatically decrypted from a Javascript function embedded into the head section if emails are found on the rendered page. Really enjoy my PW journey so far. If you need more options, want to configure stuff from the backend etc. I propose you try out the EMO module from Roope. My module will stay like this without more profound checks like mailto: links, embedded emails in other tags. If you are interested in the code, just send me a PM or post here.
    1 point
  19. I really like it! I wanted to take a similar approach in terms of atmosphere. The shaders look great, good job ?
    1 point
  20. Personally, I am just ripping on React. About my own experience with all this JS mess, I had the same sentiment you described about the frustration, I was totally in, until webpack "disappeared". I then got interest on bundlers, studied the core of rollup and then vite to finally turning the pile of JS bricks living my brain into a solid wall. Writing chromium bindings for Pascal language helped a lot, as the goal was to build an alternative to Electron. Yes, Angular... I wanted to talk about the NestJS infra inspired by Angular. Anyway, another stack and breaking changes.. Missed this details, I thought you was using InertiaJS with ProcessWire ?
    1 point
  21. So, I wasn't ripping on JS. I was expressing frustration that I think a lot of people have about the ecosystem. I don't use jQuery but I used it as an example of bloat growth. My point really is the JS-ification of everything and how that mentality has caused a high-intensity recursion of problems stemming from forcing a language written for the browser into a server. I remember when it was first announced that someone was got the V8 engine to run in a server environment and the first thing I thought was "well, that sounds like a box of headaches". The main point was to throw some extra things in about the point that the first video makes: traditional server side programming languages and their frameworks (like Laravel) are not only very capable, they're enjoyable to use. They're also incredibly stable and PHP overall is so much easier to work and upgrade over time. That's not a JavaScript problem, it's not a PHP problem, that's an entire internet problem ha! Angular is a front end framework. It's also a big example of a framework with a rough history of development. Used to introduce a ton of breaking changes regularly and went through a complete rewrite. It wasn't a great developer experience. I was learning it years ago, I watched a presentation by Google where they made a list of all of the breaking changes that would be happening in several months without a major release version. This was after they split it off from AngularJS. I walked away from it. This is a great example of great JavaScript and what a focused UI library can be. I was mainly using React as a punching bag because the video above it was talking about server side components for React. I'm not anti-JS! I mean, yes, but there are a small number of people that have to worry about speed at a scale that it would matter. Tons of applications and websites of all sizes run on "slow" languages and environments like PHP and Ruby, but in the real world the end user isn't going to notice unless something is really really wrong with the code or the server. Where NodeJS is really useful is handling Socket connections. It's really the only choice. I've played around with a tiny SocketIO server I built to it's pretty great. That said, I'm not changing my entire server environment just to implement that. I'm building an application that revolves around timers and control messages between clients and there are services that do this better than managing your own code/server, especially when geolocation is concerned. At that point network latency is a bigger issue. PHP8's JIT compiling will continue to push speed. Is it going to match Node? Nope. Am I worried about it? Nah. Should anyone reading this right now? I'd love to see what you're working on if you are... That was hilarious, but the story behind it also says a lot about the state of package management in JS. NPM was a massive jerk. Yes! I'm using InertiaJS with Laravel and Vue. The reason I chose Vue was pretty much just because it's very commonly paired with Laravel so it's good skill experience. Inertia is really great and simplifies a ton of stuff out of the box. Like I said- having a great server side application and a solid JS front-end is where it's at.
    1 point
  22. When this answer come, you already know the dev is confused. I will not even speak about React as it's a piece of software I cannot really understand but only that's the big elephant called Wordpress in the JS world, I feel like the folks was trying to make things complex for an obscure reason, maybe they worked for the DoD in the '70 when they realised they was writing code in something like 500 differents languages. "We need consistency and simple complex things". Look at this sample (React vs Svelte) and try to understand ?: svelte: --- <script> let a = 1; let b = 2; </script> <input type="number" bind:value={a}> <input type="number" bind:value={b}> <p>{a} + {b} = {a + b}</p> react: --- const [a, setA] = useState(1); const [b, setB] = useState(2); function handleChange (event, setValue) { const { value } = event.target; setValue(value); }; return ( <div> <input type="number" value={a} onChange={(e) => handleChange(e, setA)} /> <input type="number" value={b} onChange={(e) => handleChange(e, setB)} /> <p>{a} + {b} = { parseInt(a) + parseInt(b) } </p> </div> ); } ?‍♂️ (taken from logrocket.com) Not going into SSR things, but I must admit that since some years, I am mostly writing desktop software UI in JS where all complex things are not required, keeping a good architecture and making the user experience really far way above native UI, and even more when mixing real-time with 3D libs. About the backend side, it's worth mentioning Angular and an awesome framework inspired from it, NestJS. NodeJS is really fast. I Read in your previous thread you are using InertiaJS, what about rendering then ? Maybe you do not need it / care of it ? I couldn't resist to add a note for Svelte's size where source top at less than 4kb and less than 2kb compressed without brotli. It happened ? PS: The screenshots seem to be not viewables.
    1 point
  23. I think that you make a good point about the frontend/backend crossover. Writing the same language everywhere introduces some comfort in mixing up what does what and where. Then there's the perception or need for performance, "how can we reduce API calls to make our application 'snappier'". There's an entire generation of developers that have only ever known full stack JS, massive front ends, and a browser-focused approach. Like the video above said "you're solving problems that were already solved". I think there's a great place for sane client side UI frameworks and server side frameworks. It does create a great opportunity for user experiences.
    1 point
  24. I don't really get the point of the video, and associated with you question, it make me confusing, can you elaborate what you had in mind by asking ? ? (keep in mind I am not following the current bashing) I think I am in not the targeted audience. Like him I always ever been confused by people trying to reinvent the wheel, or trying to do in the frontend what the backend already do/ship, or even without it. A fact is (and I hope not a global one), among others, schools recruiters need to focus on the teachers they are recruiting to give good habits and knowledges to students. I have a real example as since one month as I have a trainee at home (first year of a Bachelor Digital School in France), she asked me to help make things about coding more clear in his head. I could see what she learnt in his first year making me not surprised that this kind of video pops. Experienced devs have no excuses anyway. edit: just a (maybe useless ) comment, this is what I like (even if I am not using it) about HTMX philosophy.
    1 point
  25. Hey @snck, This should be fixed in the latest version of the module, 0.35.4. I'm not entirely sure of the circumstances causing this issue, but the warning was pretty clear, so it should be fine now.
    1 point
  26. @olafgleba As I understand it, you've got pages that live at /members/blog/<name> and you want them to be accessible at /blog/<name>. First thing is to make it so that the blog post pages ->url property reflects the URL you want them to use. You can do this with a hook in /site/init.php: $wire->addHookAfter('Page::path', function($event) { $path = $event->return; if(strpos($path, '/members/blog/') !== 0) return; $event->return = str_replace('/members/', '/', $path); }); Next, you want to make it so that ProcessWire will deliver those blog post pages at the /blog/<name> URL. You can do this either by enabling and handling URL segments on a /blog/ page, or you can use a URL/path hook, again in /site/init.php. I'm going to assume there is no /blog/ page, so a URL/path hook may be the best bet: $wire->addHook('/blog/{name}', function($event) { $name = $event->arguments('name'); $blog = wire()->pages->get("/members/blog/$name"); return $blog->id && $blog->viewable() ? $blog : false; }); Are those /members/blog/ pages are access protected from public users? If so, the above hook is not going to let them through because of the $blog->viewable() condition at the end. You could remove that, or better yet, replace it with a different condition: if($blog->isUnpublished()) return false; return $blog->id && $blog->template->name === 'blog-post' ? $blog : false; I can't remember at the moment if ProcessWire does another access control check on the returned page ($blog). So if you find it doesn't work returning the $blog page, try having it return $blog->render() instead.
    1 point
  27. You need to get regular PHP arrays (from any WireArray descending object, i.e. all PW collections) using $arr->getArray() if (in_array("1", $user->trader_type->getArray())) { echo "found!"; } https://processwire.com/api/ref/wire-array/get-array/
    1 point
×
×
  • Create New...